Install and try
A Snowflake Native App, available on the Snowflake Marketplace. It runs entirely inside your Snowflake account: no container, no external connection, nothing on a schedule.
- 01 · INSTALL
From the listing
Install into your account and approve the privileges, each explained at install.
- 02 · GRANT
Two roles
Grant
LEADS_USERto the people and agents who work leads,LEADS_INTEGRATIONto the systems that send and collect. - 03 · TRY
Sample company
One click, or one call, loads a fictional company: three sources, six folders, about 430 leads over 30 days.
- 04 · CONFIGURE
Your sources
Declare your sources, folders and rules in the console; try any payload before it goes live.
CALL SHUNTLINE_LEADS.API.MANAGE('load_sample', {});
| Privilege requested | Why |
|---|---|
CREATE WAREHOUSE | The app's own small warehouse for the console and the API, suspended when idle. |
EXECUTE TASK, EXECUTE MANAGED TASK | A serverless background task for phone checks and re-reading leads after a source changes. It has no schedule: it runs only after work arrives. |
Concepts
Four words carry the whole app: source, rule, folder, status.
| Source | A system or form that sends leads (a website form, trade fair scans, a partner portal, an import), each in its own JSON. A source declares the fields that identify a lead (an email, a phone, a contact id) and the fields that scope access (a country, a brand). |
|---|---|
| Rules | Per source, in five steps: formatting (trim, case), validation (flags such as "no consent"), enrichment (fill what is blank), dedup (the same key across sources within a time window) and dispatch (the first matching rule files the lead). |
| Folder | Where leads are filed for a team or a system to collect: a dealer network, a sales team, key accounts. |
| Status | To review: no rule matched, a person decides. To collect: waiting for its folder's system. Collected: acknowledged by that system. Delivery failed. |
| Revisions | Every lead is stored exactly as sent. Rules and people add revisions beside it; the original stays readable. |
| Duplicates | Found, linked and flagged, never merged: both records stay. |
API
Procedures in the app's API schema, called through the Snowflake SQL API (HTTPS) or any Snowflake driver; read views in the DATA schema.
| Object | Purpose |
|---|---|
API.INTAKE(source, payload, idempotency_key) | Send one lead. The answer says where it was filed. A repeat of the same lead is recognised by the sender's id or the idempotency key. |
API.INTAKE_BATCH | Send up to 2,000 leads in one call. |
API.CLAIM(folder, n) | Reserve a folder's waiting leads for 30 minutes. Two systems never take the same lead. |
API.ACK | Acknowledge what was stored: the leads become Collected. Leads not acknowledged go back to the folder. |
API.CORRECT_LEAD, API.PLACE_LEAD | Correct a lead (a new revision) or file a lead a person decided on. |
API.SIMULATE(source, payload) | Run a source's rules on a payload and show each step and the destination, writing nothing. |
API.MANAGE(action, args) | Configuration and administration, including load_sample. |
DATA.LEADS, DATA.SOURCES, DATA.FOLDERS | Read views for analytics, dashboards and AI agents. |
Examples
They run in order on a fresh install, as the role that installed the app, after the sample company is loaded. SHUNTLINE_LEADS is the default app name.
Send a lead
The call a website or a partner makes. The rules tidy the email and the country, check the keys, look for a duplicate and file the lead; the answer says where.
CALL SHUNTLINE_LEADS.API.INTAKE('website', PARSE_JSON('{
"ref": "WEB-26-77001", "first_name": "Claire", "last_name": "Dumont",
"email": " Claire.Dumont@Paysages-Dumont.fr ", "phone": "+33 6 41 27 83 90",
"company": "Paysages Dumont", "city": "Annecy", "postal_code": "74000",
"country": " fr ", "brand": "acme_pro", "product": "Mini excavator 3.5 t", "optin": true
}'));
Try a payload without storing it
In the dealer portal's own shape; this one goes to Key accounts, its quote being over 50,000.
CALL SHUNTLINE_LEADS.API.SIMULATE('dealers', PARSE_JSON('{
"dealer_ref": "DLR-77001", "dealer": "Macchine Padane",
"customer": {"email": "giulia.rossi@libero.it", "mobile": "+39 333 123 4567"},
"country_code": "it", "brand": "acme_pro", "quote_amount": 72000
}'));
Where leads are
SELECT folder_code, status, COUNT(*) AS leads
FROM SHUNTLINE_LEADS.DATA.LEADS
GROUP BY folder_code, status
ORDER BY folder_code, status;
Leads a person should look at
SELECT id, source_name, keys, flags, received_at
FROM SHUNTLINE_LEADS.DATA.LEADS
WHERE status = 'manual' OR ARRAY_CONTAINS('possible_duplicate'::VARIANT, flags)
ORDER BY received_at DESC
LIMIT 10;
Collect a folder
What a CRM or a dealer extranet does: claim the waiting leads, store them, then acknowledge them with API.ACK.
CALL SHUNTLINE_LEADS.API.CLAIM('france-benelux', 5);
Access
The same rule applies at every way in: the console, the API, intake (a sender only sends leads of its scope), collection (a collector only takes leads of its scope) and the view AI agents query.
The app's two roles
LEADS_USER for people and their AI agents: console, corrections, configuration, every lead. LEADS_INTEGRATION for systems: send and collect. Granted by your Snowflake administrator; works at once after install.
Roles per team and scope
Administrator, router, viewer, sender, collector, each optionally limited to values of a scope: a source, a country, a brand. Team access reaches sub-teams; start and end dates; reviews; one audit log. Connected by one call; a Hub that does not answer refuses rather than opens. Shuntline Hub →
Connecting the stack
What the app does itself, and what sits next to it.
| Need | How | Status |
|---|---|---|
| A system sends leads | Snowflake SQL API (HTTPS) or any Snowflake driver, as a service user: API.INTAKE, or API.INTAKE_BATCH for up to 2,000 at once. | Available now |
| A partner or SaaS form without Snowflake credentials | An API gateway (Apigee, Azure API Management, AWS API Gateway) in front of the SQL API: partner keys, rate limits and webhook signatures checked there. | Outside the app |
| A CRM or extranet collects its folder | API.CLAIM then API.ACK, on its own schedule. | Available now |
| Leads pushed to a webhook | A small job outside the app that claims, posts (HTTPS, idempotency key) and acknowledges. | Outside the app |
| AI agents read and act | Cortex Agents or an MCP server over DATA.LEADS and the API procedures, as the person using them. | Available now |
| Analytics | DATA.LEADS in Snowflake, next to the rest of your data. | Available now |
Architecture
Installed from the Marketplace into your account, the app runs there with your data, and nothing leaves.
| Component | What it is |
|---|---|
| Console | Streamlit in Snowsight: dashboard, register with filters and search, each lead with its keys, scope, checks, revisions, duplicates and hand-overs; sources, rules, flags and lists; intake journal and audit trail. |
| API procedures | INTAKE, INTAKE_BATCH, CLAIM, ACK, CORRECT_LEAD, PLACE_LEAD, SIMULATE, MANAGE. |
| Rule engine | JavaScript procedures. |
| Hybrid tables | Leads, revisions, dedup keys, claims, hand-overs, journal, audit. |
| Standard tables | Sources, folders, rules, settings. |
| Background task | Serverless, no schedule: phone checks (Google's libphonenumber) and re-keying. |
| Read views | DATA.LEADS, DATA.SOURCES, DATA.FOLDERS. |
Design choices
| Hybrid tables for everything written lead by lead | Row locks and enforced unique keys: concurrent senders don't slow each other, and a repeat of the same lead is refused by the database. |
|---|---|
| JSON payloads, typed columns for what is searched | Each source keeps its own shape; status, folder, dates, keys and scope values are extracted at intake into indexed columns, so lists and filters never read the JSON. |
| JavaScript for every call someone waits on | A JavaScript procedure starts at once, so senders and people never wait on a cold start. |
| Background work on events only | A call that leaves work records it; a stream triggers a serverless task shortly after. An idle install costs nothing. |
| No container, no external connection | Simpler to install and to review; nothing to patch; nothing leaves the account. |
Structure
Schemas inside the app: core (state), logic (internal procedures), api (what people, agents and systems call), data (read views), setup (installation), ui (the console).