

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-semistructuredIf 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 Simular Pro, 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 Simular Pro 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 Simular Pro is built for long, reliable computer workflows, explore: https://www.simular.ai/simular-pro and learn about the research-driven team behind it at https://www.simular.ai/about
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
Block quote
Ordered list
Unordered list
Bold text
Emphasis
Superscript
Subscript
To extract fields from JSON in Snowflake, first ensure the JSON is stored in a VARIANT column (commonly named src or json_record). Snowflake lets you traverse JSON with colon and dot notation.
SELECT src:customer
FROM events;
SELECT src:customer.name
FROM events;
customer is an object and name is a key inside it.SELECT src['customer']['name']
FROM events;
SELECT src:customer.name::string AS customer_name
FROM events;
To convert JSON arrays into individual rows in Snowflake, use the LATERAL FLATTEN function. This is essential when your JSON has lists like line_items, orders, or vehicles.
SELECT src:order_id, src:line_items
FROM orders;
SELECT o.src:order_id::string AS order_id,
f.value:description::string AS item_desc,
f.value:price::number AS item_price
FROM orders o,
LATERAL FLATTEN(input => o.src:line_items) f;
SELECT DISTINCT o.src:order_id
FROM orders o,
LATERAL FLATTEN(input => o.src:line_items) f
WHERE f.value:sourceSupplier ILIKE '%AMAZON%';
When you access JSON in Snowflake using : or [], you always get a VARIANT. To use those values in math, joins, or date filters, cast them to concrete types.
:: cast operator:SELECT src:vehicle[0].price::number AS price_num,
src:vehicle[0].year::integer AS year_num,
src:date::date AS sale_date
FROM car_sales;
SELECT PARSE_JSON(raw_col):total::number AS total_amount
FROM raw_table;
SELECT v, TYPEOF(v)
FROM vartab;
Snowflake’s PARSE_JSON preserves numeric precision where possible and maps JSON nulls carefully. See the PARSE_JSON docs for details: https://docs.snowflake.com/en/sql-reference/functions/parse_jsonAlways cast before aggregations or joins to avoid silent type mismatches and odd sorting behaviour.
JSON queries in Snowflake can be very fast if you design them carefully.1) Select only what you need: Avoid `SELECT *` on wide VARIANT columns. Instead, project specific paths: `src:event_type`, `src:customer.id`, etc.2) Flatten only when required: `LATERAL FLATTEN` is powerful but can expand data dramatically. Use `WHERE` filters before flattening when possible, and avoid flattening high-cardinality arrays unless necessary.3) Use Search Optimization Service: For heavily queried JSON paths, enable search optimization on the table so Snowflake can index those fields. Docs: https://docs.snowflake.com/en/user-guide/search-optimization-service4) Materialize hot paths: For popular dashboards, create a derived table or view that extracts the key JSON fields into normal columns and update it via Tasks.5) Size the warehouse appropriately: Underpowered warehouses force more disk I/O; a correctly sized warehouse often reduces cost by finishing jobs faster.
An AI computer agent can behave like a tireless analytics assistant that logs into Snowflake, runs JSON queries, and moves results into the tools your teams use every day.With a platform like Simular Pro, you can:1) Record or describe a workflow: “Open Snowflake, run this JSON-flattening SQL, export the result, and paste metrics into our revenue sheet.”2) Let the agent operate across desktop and browser: it clicks through the Snowflake UI, executes queries, downloads results, and updates dashboards or CRMs.3) Schedule and scale: configure the agent to run hourly, daily, or on demand from a webhook in your existing pipeline.4) Inspect and refine: every action is logged and editable, so data leaders can review exactly which queries ran and how fields were mapped.This turns repetitive, error-prone JSON querying into a reliable, automated loop, freeing your marketers, sales ops, and founders to focus on strategy instead of SQL babysitting.