Skip to main content
This integration is ideal for data engineers who need to enrich large datasets with web intelligence directly in their Snowflake pipelines — without leaving SQL or building custom API integrations. Nimble provides a SQL-native User Defined Table Function (UDTF) for Snowflake that runs structured web extraction directly inside your queries. The integration uses Snowflake’s External Access Integration to securely connect to the Nimble API, and invokes one template per row — every template returns typed, domain-specific fields server-side, so no LLM is needed downstream to extract structured data from raw HTML.
Enrich a product master with live Amazon details, in one statement
One SQL statement, one Snowflake-native function — no stored procedures, no CALL + RESULT_SCAN round-trips, no Python middle-tier. dbt models, Snowflake Tasks, Streamlit apps, and any BI tool consume the output transparently.

What you get

  • One UDTF, every Web Search Agent. Pass an agent name (amazon_pdp, google_maps_search, linkedin_search_companies, yelp_serp, walmart_serp, zillow_pdp, …) and that agent’s input params. The same function shape covers every domain — retail, real estate, social, local business, healthcare, jobs.
  • Typed structured output, no LLM in the loop. Each agent parses its target domain server-side and returns purpose-built fields — product title, price, ratings, review count, ranking position. No Cortex Complete pass needed to extract values from markdown.
  • One input row → one or many output rows. PDP-style agents return a single product object per input. SERP-style agents return an array; pair the UDTF with LATERAL FLATTEN to expand into per-product rows.
  • Per-row error isolation. A 429 on one input row surfaces as status='http_429' for that row only. The rest of the lateral join still completes — easy to filter, easy to retry.
  • Stays inside your Snowflake account. Only authorized outbound calls hit Nimble. Secrets live in Snowflake’s secret manager.

Prerequisites

  • ACCOUNTADMIN role for one-time setup
  • Snowflake Enterprise edition or higher
  • A Nimble API key (sign up free)

Install in Snowflake

1

Run the shared setup (skip if already installed)

NIMBLE_AGENT_RUN shares the same role, database, warehouse, secret, and External Access Integration as NIMBLE_SEARCH and NIMBLE_EXTRACT. If you already deployed those for the Cortex Agents integration, skip ahead.

cookbook/snowflake/setup/setup.sql

Full setup script: role, grants, database, schema, warehouse, network rule, secret, EAI
2

Deploy NIMBLE_AGENT_RUN

A Python UDTF that wraps Nimble’s extract templates run API. The signature is (agent_name STRING, params OBJECT) — every Web Search Agent’s params body is a JSON object, so OBJECT removes the need for a ::VARIANT cast on every call site.

cookbook/snowflake/udtf-data-feeds/nimble_agent_run.sql

Full UDTF with per-row error isolation, request-timeout handling, and smoke tests
3

Verify with a smoke test

Pick the response shape that matches the agent you want to call. PDP-style agents (Amazon PDP, LinkedIn Profile, Walmart PDP, …) return a single product object. SERP-style agents (Amazon SERP, Google Search, …) return an array of products.
Both should return a populated result within ~30 seconds.
Discover an agent’s field names before pinning a projection. Each agent in the gallery returns its own shape — product_title vs. product_name, web_price vs. price, review_count vs. reviews_count. Inspect once before wiring into a dbt model: SELECT raw FROM TABLE(NIMBLE_AGENT_RUN(<agent>, …)) shows the full response; SELECT OBJECT_KEYS(parsing[0]) FROM … lists the per-product keys for SERP-style agents.

Common workflows

Local business discovery at scale

Build a fresh, location-aware view of every business that matters for a category in a market: feed a LOCATION_QUERIES table of research terms, get back the ranked Google Maps landscape — one row per business per query per refresh. Useful for market sizing, account-universe building, competitive territory mapping, and POI databases. google_maps_search returns up to 20 results per query with rich per-place data: name, address, rating, review count, phone, business status, price level, sponsored flag, plus opening hours and accessibility metadata. The lateral join plus LATERAL FLATTEN on the nested results array is a single SQL statement.
Input: LOCATION_QUERIES Output: LOCAL_BUSINESSES (one row per business per refresh)
google_maps_search returns parsing.entities.SearchResult (a nested array inside the parsing dict), not a flat parsing array like Amazon SERP. LATERAL FLATTEN(INPUT => a.parsing:entities:SearchResult) is the correct unfold path. Different agents nest results differently — always inspect with SELECT raw FROM … once per agent before pinning the FLATTEN target.
A V_NEW_ENTRANTS view can layer on top, flagging place IDs ranking in the top 20 for a tracked query for the first time in the last 7 days — useful for catching new market entrants before they take real share.

cookbook/snowflake/recipes/amazon_keyword_research/

Companion cookbook recipe (Amazon SERP flavor): full notebook, sample data, the lateral-join INSERT, the V_NEW_ENTRANTS view, and the daily Task — drop-in adapt the agent name and FLATTEN target to switch to google_maps_search or any other SERP-style WSA

Product-master enrichment

Some agents return a single structured object instead of an array — Amazon PDP, LinkedIn Profile, Walmart PDP, Best Buy PDP. Use them when you already know which products you care about and want a full attribute dump per identifier: brand, description, color, packaging, pricing, availability, reviews.
One row per input row. No LATERAL FLATTEN needed — the agent already returns the typed product as a single object. PDP-style agents typically return ~30 attribute fields per product; project whichever subset your downstream models need.

Schedule recurring enrichment

NIMBLE_AGENT_RUN runs at a single SQL statement, which means a Snowflake Task can execute the enrichment directly. No wrapper procedure required.

cookbook/snowflake/recipes/amazon_keyword_research/schedule.sql

Reference cookbook Task (Amazon SERP flavor): incremental load, category column, error-row filtering — adapt the agent name and FLATTEN target for google_maps_search or any other WSA

Use as a dbt incremental model

The lateral-join + FLATTEN shape is also a valid dbt model body. Drop the SQL block above into models/local_businesses.sql, add a config block for incremental materialization, and dbt orchestrates the daily refresh — the same way it would for any other model.

Roll out across your organization

  • Tune for your Nimble rate-limit tier. Each NIMBLE_AGENT_RUN call is one upstream request — one per row in your input table. For high-cardinality inputs (thousands of rows), watch for 429s; they surface per-row as status='http_429', so a single retry pass over those rows is the typical recovery. Nimble’s rate-limits page lists per-tier ceilings.
  • Right-size the warehouse. XSMALL with 60-second auto-suspend is fine for daily Task runs over a few hundred input rows. For larger enrichments (10K+ rows), step up to SMALL or MEDIUM only for the duration of the scheduled task; Snowflake bills per second.
  • Surface failures separately. Filter status='success' for analytical views, but log non-success rows to a _FAILURES audit table — status='http_429', 'http_4xx', 'request_error' — so a sudden spike is visible without grepping Task logs.
  • Don’t ship guesses. Field names inside parsing differ per agent. Inspect the shape once per agent (SELECT raw FROM … or SELECT OBJECT_KEYS(parsing[0]) FROM …) before pinning a projection into a dbt model or production view.

When to use which surface

The Snowflake integration ships three primitives across two pages. Pick by question: Cortex Agent custom tools can only be scalar functions or procedures — they can’t be UDTFs. So NIMBLE_AGENT_RUN lives here as a sibling surface, not as a third tool on the agent.

Resources

Nimbleway/cookbook (snowflake/)

Every SQL file referenced on this page, plus the Amazon keyword research recipe

Nimble Templates

Overview of templates — what they are, when to use them, how they parse

Nimble Agent Gallery

Browse the catalog of pre-built agents and their per-agent parsing shapes

Snowflake Python UDTFs

How Snowflake’s tabular UDFs work — process() handler, RETURNS TABLE, lateral-join semantics

Snowflake External Access Integration

How Snowflake gates outbound HTTPS from UDFs and stored procedures

Cortex Agents (sibling surface)

Scalar UDFs for Search + Extract, wired into a pre-built Cortex Agent