.png)
Most of the customer data your business collects now arrives as JSON: product events, ad clicks, CRM webhooks, chatbot transcripts. Snowflake is built for this world. Its VARIANT type lets you land raw JSON unchanged, then explore it with dot or bracket notation like src:customer.name or src['vehicle'][0].price. When arrays appear, functions such as LATERAL FLATTEN turn nested records into clean, relational rows you can join to campaigns, accounts, or invoices. Instead of writing brittle ETL scripts, you keep a single source of truth in Snowflake and project only the fields each team needs.
Now imagine an AI computer agent living beside that warehouse. Every hour it connects to Snowflake, runs tested JSON queries, writes fresh tables for revenue reports, and alerts sales when a high-intent pattern appears. No one on your team is babysitting queries—the agent quietly translates messy JSON into decision-ready dashboards while your people stay focused on strategy and creative work.
If you run a growing business, agency, or sales team, chances are your most valuable data is already in Snowflake—and a lot of it is JSON. Product events, ad impressions, lead activity, support logs: they all arrive as semi-structured blobs. The good news is Snowflake treats JSON as a first-class citizen. The better news is that an AI computer agent can learn your patterns and run these JSON queries for you at scale.
Below are three practical levels of maturity: from hands-on SQL, to no-code automation, to fully delegated AI-agent workflows.
CREATE OR REPLACE TABLE events (src VARIANT);
PARSE_JSON for small samples:INSERT INTO events
SELECT PARSE_JSON(column1) AS src
FROM VALUES ('{"customer": {"name": "Joyce"}}');
Learn more in the official docs: https://docs.snowflake.com/en/sql-reference/functions/parse_jsonFor production loads from cloud storage, follow Snowflake's JSON basics tutorial: https://docs.snowflake.com/en/user-guide/json-basics-tutorial
Snowflake lets you traverse JSON using column:field.subfield.
src:SELECT src:dealership
FROM car_sales
ORDER BY 1;
SELECT src:salesperson.name
FROM car_sales;
Reference: https://docs.snowflake.com/en/user-guide/querying-semistructured
If a JSON key has spaces, numbers, or symbols, use bracket notation:
SELECT src['company name'], zipcode_info['94987']
FROM partners, addresses;
This is also handy when you’re not sure about case sensitivity.
JSON arrays (like lists of line_items or vehicles) are accessed by index starting at 0:
SELECT src:customer[0].name,
src:vehicle[0].price
FROM car_sales;
This is perfect for “first item only” scenarios.
When you want every array element as its own row (e.g., each line item on an invoice), use LATERAL FLATTEN:
SELECT e.src:customer[0].name AS customer_name,
f.value:description::string AS item_desc,
f.value:price::number AS item_price
FROM events e,
LATERAL FLATTEN(input => e.src:line_items) f;
Official flatten tutorial: https://docs.snowflake.com/en/user-guide/json-basics-tutorial-flatten
Everything you select with : or [] is a VARIANT. Cast to concrete types so analysts and tools can use them:
SELECT src:vehicle[0].price::number AS price_num,
src:date::date AS sale_date
FROM car_sales;
Manual pros: full control, great for debugging, flexible for complex logic.
Manual cons: repetitive, fragile if JSON schema shifts, time-consuming for non-technical marketers or sales leaders.
Once you know the core SQL, you can wrap it in friendlier tools so your team doesn’t live in worksheets all day.
Create business-friendly views that expose clean columns:
CREATE OR REPLACE VIEW v_lead_events AS
SELECT src:lead.id::string AS lead_id,
src:lead.source::string AS source,
src:event_type::string AS event_type,
src:timestamp::timestamp AS ts
FROM events;
Now non-SQL users can query v_lead_events without ever seeing JSON. Learn more about views: https://docs.snowflake.com/en/user-guide/views-intro
Snowflake Tasks let you run JSON-flattening SQL on a schedule—no cron, no servers:
CREATE OR REPLACE TASK nightly_flatten
WAREHOUSE = analytics_wh
SCHEDULE = 'USING CRON 0 2 * * * America/Los_Angeles'
AS
INSERT INTO fact_lead_events
SELECT * FROM v_lead_events
WHERE ts::date = CURRENT_DATE - 1;
Tasks overview: https://docs.snowflake.com/en/user-guide/tasks-intro
Connect Snowflake to orchestration tools (e.g., data integration or workflow platforms) that can:
This gives operations teams a drag-and-drop way to trigger JSON queries without touching SQL daily.
No-code pros: easier for business teams, fewer manual runs, better consistency.
No-code cons: still requires someone to design and maintain flows; changing requirements often lead to a tangle of tasks and dashboards.
This is where an AI computer agent, like one powered by Sai, changes the game. Instead of you orchestrating every step, you describe the outcome and let the agent operate your tools—Snowflake, browser, spreadsheets—like a tireless analyst.
Imagine onboarding an AI agent with the story: “Every Monday, pull last week’s events.src JSON from Snowflake, flatten arrays, segment by campaign, and paste a summary into our revenue Notion page.”
The agent can:
Because Sai executes real UI actions with transparent logs, every click and query is auditable and tweakable.
Take it further:
COPY INTO.Here, you’ve effectively handed the operational burden of JSON querying to an AI teammate.
Pros:
Cons:
To see how Sai is built for long, reliable computer workflows, explore: https://www.sai.work/ and learn about the research-driven team behind it at https://www.simular.ai/about