Snowflake integration

Your Snowflake account from a flow. The action reads, counts, adds, changes, upserts and deletes rows with forms, lists your databases, schemas, tables, columns and warehouses without waking a warehouse, and, for what the forms don't say, runs your own SQL, calls procedures, starts long queries and calls the REST API, and creates and changes tables, controls warehouses and tasks, loads files from a stage and exports a result as CSV, and adds rows with no warehouse through Snowpipe Streaming. What can empty a table, drop it or change a warehouse has a switch of its own, and it is off. A trigger starts a flow when rows are new or changed, a query gives a result, the schema changes or a task fails, and wakes the warehouse only when it has to. In AI toolkit mode an AI Node gets 11 tools: three that read, and eight that start blocked until you unlock them. HostWebhook signs in with a key pair that it creates and never shows, with an access token you paste, or with Sign in with Snowflake: you sign in to your own Snowflake in a window. A Snowflake warehouse bills while it is awake, so this page also says what each thing costs.

ℹHostWebhook can do whatever the Snowflake role can do. Give it a user and a role of their own, with only what your flows need: The Snowflake user and role.

Setup

1. Prepare Snowflake

Run the lines in The Snowflake user and role once, as an administrator: a small warehouse, a role with only the privileges the flows use, and a service user for the key or the token. Snowflake can't sign in a service user with a password, so the next step uses a key or an access token with it. Sign in with Snowflake is for a person: the user is your own Snowflake user (TYPE = PERSON), who signs in in a browser, and a service user can't.

2. Create the credential

Under Settings → Credentials, or straight from the node, pick the Snowflake credential type, name it, and fill in:

  • Account: your account identifier or URL, e.g. myorg-myaccount or https://myorg-myaccount.snowflakecomputing.com. HostWebhook builds the address from it. It also reads a locator such as xy12345.us-east-2.aws.
  • Authentication: Key pair (the default: HostWebhook creates the key and never shows it), Access token (a programmatic access token, PAT, that you create in Snowflake) or Sign in with Snowflake (you sign in to Snowflake yourself, in a window: no key or token to copy, and you run one SQL once).
  • User: the login name HostWebhook signs in as, e.g. HOSTWEBHOOK_SVC. Best a service user just for this. With Sign in with Snowflake it is a person (TYPE = PERSON), who signs in in the browser: a service user can't.
  • Role: required. The role HostWebhook uses, e.g. HOSTWEBHOOK_ROLE. Never ACCOUNTADMIN: without a role Snowflake would use the user's default one, which could be an administrator. With Sign in with Snowflake an administrator role is refused, not only warned about.
  • Warehouse (optional, but required with Sign in with Snowflake): the one that runs the queries when a node doesn't pick another, e.g. HOSTWEBHOOK_WH. You can pick it from your list after the first Test.
  • Database and Schema (optional): where the lists start, e.g. SHOP and PUBLIC.

There is no password: Snowflake stopped accepting them for service users, and its SQL API never took them. HostWebhook reads the account in lower case, and an underscore in the account name is a hyphen in the address (my_account becomes my-account): it does that for you. The names of your databases, schemas, tables and columns keep the case Snowflake has.

With a key pair (recommended)

Save the credential and HostWebhook shows a line to run in a Snowflake worksheet. It holds only the public half of the key:

sqlWhat the credential shows
ALTER USER HOSTWEBHOOK_SVC ADD KEY PAIR HOSTWEBHOOK_1A2B3C4D
  PUBLIC_KEY = 'MIIBIjANBgkq…'
  ROLE_RESTRICTION = 'HOSTWEBHOOK_ROLE';
  • The private key is never shown: not to you, not in the panel, not to an AI. It is created and encrypted inside the service that keeps your credentials and it never leaves it. That service signs the short sign-in token (valid for less than an hour) and only gives out that token: the other services never receive the key.
  • The line is limited to the role: with ROLE_RESTRICTION the key only works with that role.
  • The key has a name of its own. It is HOSTWEBHOOK_ and 8 hex digits that come from the key itself, like HOSTWEBHOOK_1A2B3C4D, so two credentials on the same Snowflake user, or two rotations, never meet the same name (Snowflake refuses a name that already exists). A credential made before this keeps its first key under the name it has, HOSTWEBHOOK or HOSTWEBHOOK_NEXT, until its first rotation, and the line that removes it says that name.
  • The key doesn't expire by itself, and needs no network policy (a PAT does).
  • Rotate it with Generate new key: it makes a second key next to the first. Run its line in Snowflake, press Test, and when the Test passes with the new key the old one is removed here. The panel then shows the line that removes the old key in Snowflake.
  • Changing the Account, the User or the Role asks you to prove the credential again with the Test.

With an access token (PAT)

Create the token in Snowflake and paste it once. Snowflake shows its value only when it is created:

sqlIn Snowflake
ALTER USER HOSTWEBHOOK_SVC ADD PROGRAMMATIC ACCESS TOKEN HOSTWEBHOOK
  ROLE_RESTRICTION = 'HOSTWEBHOOK_ROLE' DAYS_TO_EXPIRY = 90;
  • The token expires (15 days unless you say otherwise, up to 365): when it does, the nodes fail with “Snowflake didn't accept the key or the token. Check the credential and press Test.” and you create a new one and reconnect.
  • For a service user Snowflake requires a network policy to create and use a token: see below.
  • The token is encrypted and never comes back to the panel. Unlike a key, it travels to the service that runs the node each time.

With Sign in with Snowflake

You sign in to your own Snowflake, in a window, with your own user. There is no key and no token to copy, and HostWebhook never sees your password. You run one SQL once, which creates an integration in your account, and paste the two values it shows. The sign-in lasts up to 90 days, then you sign in again.

  • 1. The role. Make the role from The Snowflake user and role and give it to the user who will sign in, e.g. GRANT ROLE HOSTWEBHOOK_ROLE TO USER ANA;. The user has to be able to sign in in a browser (a person, not a service user). The role can never be an administrator one, and it has to be a plain name: letters, numbers, _ and $.
  • 2. The integration. In the form, pick Sign in with Snowflake. It shows this SQL with HostWebhook's return address already in it. Run it once in a worksheet, with a role that can create integrations (e.g. ACCOUNTADMIN, only for this). It holds no secret:
sqlThe integration (the form shows it with the return address)
CREATE SECURITY INTEGRATION HOSTWEBHOOK_OAUTH
  TYPE = OAUTH
  OAUTH_CLIENT = CUSTOM
  OAUTH_CLIENT_TYPE = 'CONFIDENTIAL'
  OAUTH_REDIRECT_URI = 'https://api.hostwebhook.com/api/credentials/snowflake/oauth/callback'
  OAUTH_ENFORCE_PKCE = TRUE
  OAUTH_ISSUE_REFRESH_TOKENS = TRUE
  OAUTH_REFRESH_TOKEN_VALIDITY = 7776000
  OAUTH_USE_SECONDARY_ROLES = NONE
  ENABLED = TRUE;
  • Copy the return address from the form, don't type it: Snowflake compares it exactly. It is https://api.hostwebhook.com/api/credentials/snowflake/oauth/callback on HostWebhook's cloud.
  • OAUTH_CLIENT_TYPE = 'CONFIDENTIAL': HostWebhook is a server and keeps the client secret, encrypted, where nothing else reads it.
  • OAUTH_ENFORCE_PKCE = TRUE: Snowflake leaves it off unless you ask. With it, a sign-in that doesn't carry its own proof is refused by Snowflake itself.
  • OAUTH_ISSUE_REFRESH_TOKENS = TRUE and OAUTH_REFRESH_TOKEN_VALIDITY = 7776000: without a refresh token the access would end in minutes. 7,776,000 seconds are 90 days, the longest Snowflake allows.
  • OAUTH_USE_SECONDARY_ROLES = NONE: the session has the one role you asked for, not the other roles of the user.
  • What it never says: PRE_AUTHORIZED_ROLES_LIST (you give your consent), a return address that isn't https, a role (the role is the credential's) and CREATE OR REPLACE: if the integration already exists, running it again fails instead of replacing the one in use.
  • 3. The two values. Run this and copy the OAUTH_CLIENT_ID and the OAUTH_CLIENT_SECRET it shows:
sqlThe client id and the client secret
SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('HOSTWEBHOOK_OAUTH');
  • 4. The credential. Fill in the form: the Account, the User, the Role, the Warehouse, the client id and the client secret. The secret is stored encrypted and never shown again. Save it.
  • 5. Sign in. On the page of the credential, press Sign in with Snowflake. A window opens on Snowflake: sign in and allow it. The window closes and the card says it is signed in and the date by which you sign in again. Then press Test.

The Warehouse is required. HostWebhook checks which role your session got with one SELECT CURRENT_ROLE(), and Snowflake refuses a statement that names no warehouse (and a user with no default warehouse has none to fall back on). The statement reads no table, so it is not meant to start a suspended warehouse.

Administrator roles are blocked. ACCOUNTADMIN, SECURITYADMIN, SYSADMIN, ORGADMIN and GLOBALORGADMIN are refused when you save the credential and again when you sign in. It is also checked on every connection: if Snowflake gives the session a role that isn't the credential's, or an administrator one, HostWebhook doesn't use that session and asks you to sign in again.

If you use a network policy, it has to let in the address HostWebhook's calls come from (below).

When the sign-in ends: Reconnect

Snowflake stops accepting the sign-in after 90 days, when someone disables or drops the integration, or when it refuses the role. The credential then asks you to sign in again, on its page, in the Test and in the lists of a node:

textWhat you see
Snowflake no longer accepts this sign-in: it expired or was revoked. Press Sign in again on the page of the credential.
  • Press Sign in with Snowflake on the page of the credential, as the line says. It shows NEEDS RECONNECT and a Reconnect button too. You don't run the SQL again and you don't type the client secret: they are kept.
  • Until you do, nothing can use the credential, because HostWebhook has no access to give. A trigger that couldn't check Snowflake meanwhile may have paused: turn it on again after you sign in.
  • If you change the Account, the User, the Role or the client, press Sign in with Snowflake again: the sign-in belongs to what it was made for.
  • The page of the credential shows the date by which you sign in again, so it never surprises you.

Ending it for good

Deleting the credential deletes the tokens HostWebhook holds. It doesn't revoke the refresh token in Snowflake: Snowflake keeps it until it expires, up to 90 days, unless you disable the integration. Disabling it revokes every sign-in. To end it now, run this in Snowflake:

sqlStop every sign-in of this integration
ALTER SECURITY INTEGRATION HOSTWEBHOOK_OAUTH SET ENABLED = FALSE;
  • It cuts the access at once, and enabling it again does not bring the sign-in back: Snowflake no longer accepts the refresh token, so the credential says “Snowflake no longer accepts this sign-in: it expired or was revoked. Press Sign in again on the page of the credential.”: in Sign in with Snowflake, on the page of the credential, press Sign in again.
  • While it is disabled, the Test says “Snowflake did not accept the client id or the secret. Check them in the credential. The integration may also be disabled: ALTER SECURITY INTEGRATION … SET ENABLED = TRUE.”: it names the disabled integration as a possible cause, and the statement that turns it on. The lists of a node say “Snowflake didn't accept the sign-in. Press Sign in again in the credential.”, which does not name the integration: if signing in again does not help, look at the integration.

Where HostWebhook connects from

HostWebhook only connects to the public address of your account, https://<account>.snowflakecomputing.com, with the certificate checked. It never follows a redirect, and the key or the token only go to that address. It looks up the name, checks the address it got and connects to that same address. Private-link addresses and the China region (snowflakecomputing.cn) aren't supported yet.

If your account or the user has a network policy, allow HostWebhook's static egress IP, 18.225.52.125. The form of the credential shows it under «Allow this IP in a Snowflake network rule», with a button that copies it, and so does the form of Reconnect. It is the same for every HostWebhook customer: the policy shows the call comes from HostWebhook, and what keeps it yours is the key or the token.

sqlA network policy for the user
CREATE NETWORK RULE SHOP.PUBLIC.HOSTWEBHOOK_IP MODE = INGRESS TYPE = IPV4 VALUE_LIST = ('18.225.52.125');
CREATE NETWORK POLICY HOSTWEBHOOK_ONLY ALLOWED_NETWORK_RULE_LIST = ('SHOP.PUBLIC.HOSTWEBHOOK_IP');
ALTER USER HOSTWEBHOOK_SVC SET NETWORK_POLICY = HOSTWEBHOOK_ONLY;

3. Test the connection

Test connection asks Snowflake a few fixed questions and writes nothing, and it doesn't wake your warehouse. The lists need no warehouse. The last question, which secondary roles the user has, names the warehouse of the credential, because Snowflake refuses a statement with none, and Snowflake answers it without running the warehouse. (Snowflake bills cloud services only above 10% of the day's warehouse credits.) It tells you in one line the account, the user, the role and the warehouse with its size and its auto suspend. It warns you when:

  • the role is an administrator role (ACCOUNTADMIN, SECURITYADMIN, SYSADMIN…): far more than a flow needs;
  • the warehouse is bigger than X-Small, or never goes to sleep (auto suspend of 0 or more than 10 minutes), or can't wake by itself (no auto resume);
  • the warehouse has no resource monitor, which caps what it can spend;
  • the user is a person and not a service user.

The Test fails if the user has secondary roles active: HostWebhook would act with more than the role you chose. Its answer says what to run, as an administrator: ALTER USER <user> SET DEFAULT_SECONDARY_ROLES = (); (with the name of your user). Then press Test again. If the user only asks for them (DEFAULT_SECONDARY_ROLES is set, but it has no other role yet), or the Test couldn't check (the credential has no warehouse, for one), it passes and warns you, with the same command to run.

With a key pair, if Snowflake doesn't have the public key yet, the Test says so: run the line above in Snowflake and press Test again. With Sign in with Snowflake, press Sign in on the credential first; the Test also asks which role the session got, and says “Snowflake no longer accepts this sign-in: it expired or was revoked. Press Sign in again on the page of the credential.” when that sign-in is over.

What HostWebhook keeps

  • The private key (key pair) or the token (PAT) is encrypted, like the passwords of your other credentials. It never comes back to the panel, a log, an error or a run.
  • The short sign-in token of a key pair lives only in memory, for less than an hour.
  • With Sign in with Snowflake: the client secret, the access token and the refresh token are encrypted and never come back to the panel, a log, an error or a run. HostWebhook renews the access by itself, and only the short access token reaches the service that runs the node, like a PAT. The refresh token and the client secret stay in the service that keeps your credentials.
  • The rows your account answers are not stored: they are in the run that used them, like the other databases.

The Snowflake user and role

Give HostWebhook a user and a role of their own, and a small warehouse that sleeps. Run this once, as administrators (only ACCOUNTADMIN creates a resource monitor). Change the names to yours:

sqlWarehouse, role and user
-- A small warehouse just for HostWebhook, asleep by default
CREATE WAREHOUSE HOSTWEBHOOK_WH
  WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 60 AUTO_RESUME = TRUE INITIALLY_SUSPENDED = TRUE;
-- A monthly credit quota for it
CREATE RESOURCE MONITOR HOSTWEBHOOK_RM WITH CREDIT_QUOTA = 20 FREQUENCY = MONTHLY
  START_TIMESTAMP = IMMEDIATELY
  TRIGGERS ON 75 PERCENT DO NOTIFY ON 90 PERCENT DO SUSPEND ON 100 PERCENT DO SUSPEND_IMMEDIATE;
ALTER WAREHOUSE HOSTWEBHOOK_WH SET RESOURCE_MONITOR = HOSTWEBHOOK_RM;
-- A role with only what the flows need
CREATE ROLE HOSTWEBHOOK_ROLE;
GRANT USAGE ON WAREHOUSE HOSTWEBHOOK_WH TO ROLE HOSTWEBHOOK_ROLE;
GRANT USAGE ON DATABASE SHOP TO ROLE HOSTWEBHOOK_ROLE;
GRANT USAGE ON SCHEMA SHOP.PUBLIC TO ROLE HOSTWEBHOOK_ROLE;
GRANT SELECT, INSERT, UPDATE ON TABLE SHOP.PUBLIC.ORDERS TO ROLE HOSTWEBHOOK_ROLE;  -- DELETE only if a flow deletes
-- A service user for the key pair or the PAT (it can't have a password; Sign in with Snowflake uses a person instead), with timeouts as a second barrier, and no default warehouse
CREATE USER HOSTWEBHOOK_SVC TYPE = SERVICE DEFAULT_ROLE = HOSTWEBHOOK_ROLE;
GRANT ROLE HOSTWEBHOOK_ROLE TO USER HOSTWEBHOOK_SVC;
ALTER USER HOSTWEBHOOK_SVC SET STATEMENT_TIMEOUT_IN_SECONDS = 300 STATEMENT_QUEUED_TIMEOUT_IN_SECONDS = 60;
-- No secondary roles: HostWebhook acts with HOSTWEBHOOK_ROLE and with nothing else the user may have
ALTER USER HOSTWEBHOOK_SVC SET DEFAULT_SECONDARY_ROLES = ();
  • The warehouse is X-Small with AUTO_SUSPEND = 60: it sleeps a minute after the last query. Each size doubles the cost, so don't pick a bigger one for rows.
  • The user has no default warehouse on purpose: HostWebhook names the warehouse in the request (the node's, or the credential's), so when there is none the query fails with “No warehouse. Pick one in the node or in the credential, e.g. HOSTWEBHOOK_WH.” instead of waking another.
  • Never ACCOUNTADMIN, SECURITYADMIN, SYSADMIN, OWNERSHIP of your data or MANAGE GRANTS.
  • No secondary roles, on purpose. A user can have other roles of its own active next to the one HostWebhook signs in with (secondary roles; Snowflake turns them on for every new user with DEFAULT_SECONDARY_ROLES = ('ALL')), and then a flow acts with all of them, an administrator role included, even if the role of the credential is small. The last line of the script sets none. The Test refuses a user that has any active. If you can't change the user, use a service user that has no other roles.
  • Then the lines of the key pair or the PAT above, which sign in as this service user, and the network policy. With Sign in with Snowflake the user is a person (TYPE = PERSON), not this service user: give the role to that person, e.g. GRANT ROLE HOSTWEBHOOK_ROLE TO USER ANA;.
  • Lists (databases, schemas, tables, columns, warehouses) only need USAGE on what they list and show only what the role can see.
  • This role has none of the privileges that creating a table, emptying or dropping one, controlling a warehouse, running a task or loading a stage need. Give those, one by one, only to the flow that uses the operation.
  • A trigger on a table reads it with this role: USAGE on its database and schema, SELECT on the table and USAGE on the warehouse that reads the rows. Row changes also needs change tracking on the table, which its owner turns on. The trigger never needs a privilege to write.
  • The four account events need no privilege on a table. User changes, Role grants and Credit usage need a database role of Snowflake instead (SNOWFLAKE.SECURITY_VIEWER or SNOWFLAKE.USAGE_VIEWER), and the role must not be able to grant privileges.
  • An AI toolkit needs the privileges of the tools you unlock and no more. Give it a credential and a role of its own: for query_snowflake and execute_snowflake_sql the role is the only limit, because they aren't limited to the tables on your list (A role for the AI).

Operations

Drop a Snowflake node, pick the credential, choose Single operation and an operation. There are 32. Database, Schema, Table, the columns and the warehouse are picked from lists that HostWebhook reads from your account, so a name is never typed by hand where it can be chosen, and the data of a flow can fill a value but never choose which database, schema, table or warehouse is used. It can only bring columns with the whole-value switches, which are off by default.

In the dropdownWhat it doesFieldsComes back as
Select rowsReads rows from a table or view, with filters, order and a limit.Database · Schema · Table · Columns (empty = all) · Filters · Order · Limit (1–1,000, 100 by default) · Return allrows · count · truncated
Count rowsHow many rows match the filters.Database · Schema · Table · Filterscount
Insert rowsAdds one or more rows, up to 1,000 a run.Database · Schema · Table · Rowsinserted · chunks · rows, as you sent them
Update rowsChanges some columns of the rows that match the filters. At least one filter is required.Database · Schema · Table · Set · Filters · Stop if more than · Limitupdated · matched
Upsert rowsInserts rows, or changes the ones that already have the same key.Database · Schema · Table · Rows · Key columns · Columns to updateinserted · updated · chunks
Delete rowsDeletes the rows that match the filters. At least one filter is required.Database · Schema · Table · Filters · Stop if more than · Limitdeleted · matched
List databasesThe databases the role can see.(none)databases
List schemasThe schemas of a database.Databaseschemas
List tables and viewsThe tables and views of a schema, with their rows, bytes and change tracking.Database · Schematables (each marked table or view)
Describe tableThe columns of a table or view, with their types.Database · Schema · Tablecolumns
List warehousesThe warehouses the role can see, with their state, size and auto suspend.(none)warehouses
Run SQLRuns one SQL statement that you write. A {{ }} is sent as a value, never as text of the SQL.SQL · Parameters · Allow multiple statements · Return rows · Limit (1–1,000, 100 by default) · Return all · Warehouse · Timeoutrows · count · truncated · changed · queryId
Call procedureCalls a stored procedure with one typed value for each argument.Database · Schema · Procedure · Signature · Arguments · Return rows · Limit · Return all · Warehouse · Timeoutrows · count · truncated · result · queryId
Run SQL in backgroundStarts a SQL statement and gives back its query id at once, for long loads.SQL · Parameters · Allow multiple statements · Query timeout (1–1,440 minutes, 60 by default) · Warehouse · TimeoutqueryId · state
Get query resultsThe state of a query that Run SQL in background started, and its rows when it is done. It doesn't wait.Query id · Limit · Return all · TimeoutqueryId · state · done · rows · count · truncated
Cancel queryStops a query that Run SQL in background started.Query id · Timeoutcancelled · queryId
API requestA call to the REST API of Snowflake with the credential put on it.Method · Path · Query · Body · Allow account administration · Timeoutstatus · body
Create tableCreates a table from a list of columns and their types.Database · Schema · New table · Columns · Only if it doesn't exist · Change tracking · Timeoutdone · table · columns
Add columnsAdds columns to a table that exists.Database · Schema · Table · Columns · Timeoutdone · table · added
Truncate tableDeletes every row of a table and keeps the table. Needs «Allow emptying or dropping tables».Database · Schema · Table · Allow emptying or dropping tables · Timeoutdone · table · emptied
Drop tableDeletes a table. Needs «Allow emptying or dropping tables».Database · Schema · Table · Allow emptying or dropping tables · Timeoutdone · table · dropped
Resume warehouseTurns a warehouse on. Needs «Allow warehouse control».Warehouse · Allow warehouse control · Timeoutdone · warehouse · resumed
Suspend warehouseTurns a warehouse off when its queries end. Needs «Allow warehouse control».Warehouse · Allow warehouse control · Timeoutdone · warehouse · suspended
Resize warehouseChanges the size of a warehouse. Needs «Allow warehouse control».Warehouse · Size · Allow warehouse control · Timeoutdone · warehouse · size
List tasksThe tasks of a schema, with their state and schedule.Database · Schema · Timeouttasks · truncated
Run taskRuns a task now, with the warehouse of the task.Database · Schema · Task · Timeoutstarted · task
Suspend or resume taskStops or starts the schedule of a task.Database · Schema · Task · Action · Timeoutdone · task · action
List stagesThe stages of a schema, internal and external.Database · Schema · Timeoutstages · truncated
List stage filesThe files of a stage, with their size and date.Database · Schema · Stage · Path · Pattern · Timeoutfiles · count · truncated
Copy into tableLoads files from a stage into a table, with their format and what to do on an error.Database · Schema · Table · Stage · Path · Files · Pattern · Format · Skip header · On error · Match by column name · Warehouse · Timeoutfiles · loaded · failed · message
Export query resultRuns a query and gives the rows as CSV text with a file name, with the formulas protected.Source (Table or SQL) · Database · Schema · Table · Columns · Filters · Order · SQL · Parameters · Limit · Return all · File name · Protect formulas · Warehouse · Timeoutcsv · fileName · rows · bytes · truncated
Append rowsAdds rows with no warehouse, through Snowpipe Streaming, up to 1,000 a run. Key pair only.Database · Schema · Table · Rows · Timeoutsent · batches · bytes · requestIds · retried · note

Filling in the fields

  • Filters are a list, not SQL: =, !=, >, >=, <, <=, LIKE, IN, IS NULL and IS NOT NULL, all of which must match. The column names are only ones your table has, and each value is sent as a parameter, never inside the text of the SQL. A filter with no value matches nothing in SQL, so use IS NULL to look for empty values.
  • Rows (Insert, Upsert): one JSON object per row, like {"ID": "{{payload.id}}", "STATUS": "new"}, up to 1,000 a run, all with the same columns. A {{ }} fills one value. A VARIANT, OBJECT or ARRAY column takes JSON; a binary column takes hexadecimal text. A column of a type a form can't write (geography, vector…) is refused: use Run SQL for it.
  • Set (Update): the columns to change, like {"STATUS": "shipped"}. Filters say which rows.
  • Key columns (Upsert): the columns that identify a row, e.g. ID. Snowflake doesn't enforce keys, so two rows with the same key would stop the upsert: HostWebhook refuses them before it sends anything (1 and "1" are the same key). A key can't be empty.
  • Insert and Upsert write in groups of up to 1,000 rows, and each group is one statement that is sent once: a failure never writes a group twice. The answer says how many groups went in.
  • Insert gives back the rows you sent, not the values Snowflake generates (ids, defaults): Snowflake doesn't return them.
  • Return all (Select) reads every row up to the limit of your plan, and the answer says truncated if there were more. Nothing is cut in silence: a read always asks for one row more than it gives back.
  • Warehouse: empty means the credential's. A sleeping warehouse wakes and bills at least a minute.
  • Every call has a timeout (30 seconds by default, from 1 to 3,600). When it passes, HostWebhook cancels the query in Snowflake, so a runaway query doesn't keep the warehouse awake. Every query carries a tag, hostwebhook:<flow>:<node>, so you can find ours in your query history and see how long they take.
  • Types: Snowflake answers everything as text, and HostWebhook reads it without losing anything. A NUMBER(38,0) that fits is a number, and above 253 it stays text; every decimal stays text ("12.50"); a FLOAT is a number; dates and timestamps come as ISO text in UTC; VARIANT, OBJECT and ARRAY come as JSON; binary comes as hexadecimal text.

The brake: Stop if more than N match

Update rows and Delete rows need at least one filter (“The filters are missing: add at least one. A change with no filter would touch every row.”) and count first. If more than the Limit rows match, nothing is changed, and you see “1,001 rows match, more than the limit of 1,000. Nothing was changed. Narrow the filters or raise the limit.” The limit is 1,000 unless you change it.

  • The change repeats the count in the same statement, so rows that arrive between the count and the change can't make it go past the limit.
  • You can turn the brake off with Stop if more than. Only an explicit Off does; a missing value or a text keeps it on.
  • Snowflake has no recycle bin for rows. What it has is Time Travel, set per table (1 day by default, up to 90 on some editions), which can bring back rows you deleted by mistake.

Letting the event bring a whole list

By default, each {{ }} in Rows, Set and Filters fills one value, and what the flow can write is only what you typed. Under each of those fields there is an Off switch (Rows whole value, Set whole value, Filters whole value): turned On, whoever calls the flow's URL can bring the whole list or object. For Insert, Upsert, Update and Delete that means they decide which columns are written and which rows change, so the panel marks those switches in red. Names (database, schema, table, key columns, warehouse) have no switch: the event never chooses one.

SQL and API

Six operations for what the forms of rows don't say: Run SQL, Call procedure, Run SQL in background with Get query results and Cancel query, and API request. They are in the same dropdown. A name (the database, the schema, the warehouse, the procedure and its signature, and the method, the path and the query of an API request) is never filled by the event, and the two switches of the owner are off until you turn them on.

ℹThese run what you write, with the role of the credential. HostWebhook doesn't judge whether a SQL only reads: a SELECT can call a function that changes things. The role is the limit, so give it only what the flow needs, and try a new SQL on a copy first.

Run SQL

Write one statement. Each {{ }} that stands where a value goes (outside quotes and comments) is sent to Snowflake as a value, never as text of the SQL, so the text that reaches Snowflake is the same whatever the event says.

sqlA SQL with values
SELECT ID, STATUS, TOTAL
FROM SHOP.PUBLIC.ORDERS
WHERE STATUS = {{payload.status}} AND TOTAL > {{payload.minimum}}
  • A value keeps its kind: text stays text, a whole number stays a number and true or false stays a boolean. An object or a list goes as JSON text: write PARSE_JSON({{payload.data}}) to use it as a VARIANT.
  • Not inside quotes. A {{ }} inside quotes, $$ or a comment would be text, not a value, and the node refuses it. Write the placeholder alone and send the whole value: WHERE NAME LIKE {{payload.pattern}} with pattern = %ana%, or WHERE NAME = CONCAT('%', {{payload.name}}, '%').
  • A value can't choose what runs. A SQL with a {{ }} can't use IDENTIFIER(, TABLE(, TO_QUERY, EXECUTE IMMEDIATE, RESULT_SCAN, a SYSTEM$ function or a Scripting block (DECLARE, BEGIN): they would let the data of an event pick a table or run a text as code. Without a {{ }} you can write all of them. A SQL with a {{ }} is one statement.
  • What the event doesn't have is sent as NULL, and the answer says which: _unresolvedPlaceholders lists them and _note says it. A comparison with NULL matches no row, so such a query usually returns nothing.
  • Your own ?: write ? in the SQL, leave no {{ }} in it, and fill Parameters with a list, one value for each ?, like ["paid", 100]. The node refuses to mix the two, and refuses a list whose count doesn't match. The list is yours: a {{ }} in it goes between quotes, one for each value (["{{payload.status}}", 100]), so the event fills values and can't add an item.
  • Allow multiple statements (off): several statements in one run, like a transaction. Snowflake takes no values with several statements, so the SQL then takes no {{ }} and no Parameters: you write the values into the SQL yourself. With it off, the request holds one statement.
  • Return rows (on) gives rows, count and truncated: the first Limit rows (1 to 1,000, 100 by default), or all of them up to the limit of your plan with Return all; truncated says if there were more. Off, for statements that only change data, the answer has changed (inserted, updated or deleted, the ones Snowflake gives) or done.
  • The id of the query: the answer has queryId, the id Snowflake gave the statement. With several statements, queryIds lists the ones of each statement.
  • It runs in the warehouse of the node, or the credential's: a sleeping one wakes and bills at least a minute. The timeout is 30 seconds by default (1 to 3,600): when it passes, HostWebhook cancels the query in Snowflake.
  • After a Run SQL that returns rows, the node after it runs once per row, as after Select rows.

Call procedure

Calls a stored procedure with typed values. Pick the Database and the Schema, type the Procedure name and its Signature, the type of each argument in order, like ["VARCHAR", "NUMBER(38,0)"], and give the Arguments: one value for each argument, in order, like ["{{payload.id}}", 3].

  • HostWebhook writes the call itself, CALL "SHOP"."PUBLIC"."ADD_ORDER"(CAST(? AS VARCHAR), CAST(? AS NUMBER(38,0))), with every value as a value and never as text. The signature is what picks the procedure when several have the same name.
  • The database, the schema, the procedure and its signature are written once and never filled by the event: a {{ }} in them is refused. The values of Arguments take a {{ }}.
  • Pick the procedure from the list of the schema: picking it fills its signature. If the list doesn't load, type the name and the signature as Snowflake has them. One value for each type, or the node says how many it expects.
  • An argument of a type a form can't send (geography or vector, for example) is refused: use Run SQL for it.
  • The procedure decides what it changes, with the privileges of its owner or of the role of the credential. The node can't tell what is inside it.
  • The answer has rows, count and truncated like Run SQL, result (the first value of the first row, handy for a procedure that returns one value) and queryId. It runs in the warehouse, with the same Return rows, Limit, Return all and Timeout.

Run SQL in background, Get query results and Cancel query

A long load shouldn't hold the flow. Run SQL in background starts the statement and answers at once with its queryId and state, and the query keeps running in Snowflake. Read it later with Get query results and the id, like {{runSql.queryId}} (runSql is the name of the node that started it), or stop it with Cancel query.

  • The SQL takes the same rules as Run SQL: {{ }} as values, or Parameters with your own ?, and the switch Allow multiple statements.
  • Query timeout is the number of minutes after which Snowflake stops the query: 1 to 1,440, 60 by default. The Timeout in seconds only covers the call that starts it.
  • It keeps running, and billing, until it ends or Snowflake stops it. It uses the warehouse of the node, or the credential's.
  • Get query results says the state, running or done, and done as true or false. It doesn't wait: if the query is still running there are no rows, and you read it again later. When it is done the answer has rows, count and truncated, with Limit or Return all as in Run SQL.
  • Cancel query stops the query and answers cancelled and its queryId.
  • Only ids that Run SQL in background gave in this flow, in the last 24 hours, work. HostWebhook keeps those ids (not the SQL, not the rows), up to 1,000 for each flow. Any other id (one typed by hand, one from another flow, one from Run SQL, one older than a day) is refused before the credential is asked for and without calling Snowflake.
  • A flow keeps up to 1,000 ids for 24 hours. When it already has them all, Run SQL in background starts nothing and says so (a 422, before it asks Snowflake for anything): “This flow already has too many Run SQL in background queries in the last 24 hours (the limit is 1,000), so nothing was started. Start fewer of them, or wait until the oldest ones are forgotten.” A new id fits when the oldest are a day old: reading or cancelling a query doesn't free a place.
  • If the id can't be written at that moment, for any other reason, HostWebhook stops the query it just started and says so (“The id of the query could not be saved, so the query was stopped. Try again.”), so nothing is left running that nobody can reach.
  • With Allow multiple statements, the id that is kept is the one of the whole request. Get query results reads the query by that id and nothing more: it doesn't read the statements inside it one by one, because their ids aren't kept.

API request

A free call to the REST API of Snowflake (/api/v2/…) with the credential put on it, for what the other operations don't cover: listing, creating or changing objects such as databases, tables, stages or tasks. You pick the Method (GET, POST, PUT, PATCH or DELETE), write the Path, and fill Query and Body when the call takes them.

textListing the schemas of a database
GET /api/v2/databases/SHOP/schemas
Query: {"like": "%PUB%", "showLimit": 100}
  • The event never chooses what is called. The method, the path and the query are written once, and a {{ }} in them is refused. The path starts with /api/v2/ and holds names as they are: no ?, #, .., // or {{ }}, and filters go in Query.
  • Not available here: /api/v2/statements and /api/v2/results (Run SQL, Run SQL in background and Get query results cover them), /api/v2/cortex (Ask Cortex covers it) and Spark Connect.
  • With Allow account administration off, only reads (GET) of the objects of the catalog go: databases, schemas, tables, views, dynamic tables, event tables, iceberg tables, stages and their files, streams, pipes, tasks (and the dependents and the graphs of a task), alerts, sequences, procedures, functions, tags and warehouses. Every other call needs the switch: every write, every call with an action, and the reads that show how the account is set up (users, roles, grants, policies, integrations, secrets…).
  • Query takes only these names: like, startsWith, fromName, pattern, prefix, showLimit, history, withLineage, rootOnly and recursive; with the switch on, also createMode, ifExists and copyGrants. createMode is errorIfExists, ifNotExists or orReplace: orReplace replaces, and so drops, what was there.
  • Body is a JSON object (GET and DELETE take none: use Query), up to 1 MB. A {{ }} can only go in comment, the free text of the calls that create or change an object, and between quotes: {"comment": "{{payload.note}}"}. The fields that hold SQL or code (definition and condition of a task, query of a view, body of a procedure) are written by you, without {{ }}: with one, the data of an event could write the SQL of a task.
  • The answer is status and body, as Snowflake gave them (up to 5 MiB). Nothing in the answer is followed, like a redirect or a link.
  • It names no warehouse, so it wakes none. A call that changes something isn't repeated once it may have gone through: if it fails by a timeout or a 5xx, the line says “The call may already have been made: check before you run it again.”

The two switches of the owner

SwitchDefaultInWhat it lets the node do
Allow multiple statementsOffRun SQL, Run SQL in backgroundSeveral statements in one run. No {{ }} and no Parameters then.
Allow account administrationOffAPI requestCalls beyond the reads of the catalog: writes, users, roles, and createMode, ifExists and copyGrants.

Only you turn them on, and only a real On counts: the event can't turn one on (a {{ }} in them is refused), and a value that comes from somewhere else, like the text true, leaves it off. The panel says what each one lets the node do, right where you turn it on, and marks the second one in red.

Tables, warehouses, tasks and stages

Fourteen operations for the account itself: Create table and Add columns, Truncate table and Drop table, Resume, Suspend and Resize warehouse, List tasks, Run task and Suspend or resume task, List stages, List stage files and Copy into table, and Export query result. The database, the schema, the table, the warehouse, the task and the stage are names: the event never chooses one. Three switches decide what can empty a table, drop it or change a warehouse, and what protects a CSV.

ℹThese change or delete things in your account, with the role of the credential. HostWebhook asks for a switch before it empties a table, drops one or changes a warehouse, but it can't tell whether the change is a good idea: the role is the limit.

Create table and Add columns

Create table takes the Database, the Schema, the New table (its name keeps the case you type) and the Columns: one object per column.

jsonColumns
[
  {"name": "ID", "type": "NUMBER(38,0)", "nullable": false},
  {"name": "STATUS", "type": "VARCHAR"}
]
  • The type is one a form can write: NUMBER, DECIMAL, NUMERIC, INT, INTEGER, BIGINT, SMALLINT, TINYINT, BYTEINT, FLOAT, FLOAT4, FLOAT8, DOUBLE, REAL, VARCHAR, CHAR, CHARACTER, STRING, TEXT, BINARY, VARBINARY, BOOLEAN, DATE, TIME, DATETIME, TIMESTAMP, TIMESTAMP_NTZ, TIMESTAMP_LTZ, TIMESTAMP_TZ, VARIANT, OBJECT and ARRAY, with numbers inside the ranges of Snowflake, like VARCHAR(100). Anything else (geography, vector…) is for Run SQL.
  • The definition is yours. A {{ }} anywhere in Columns is refused, so the data of an event can't choose what a table holds. Up to 200 columns, none listed twice.
  • Only if it doesn't exist (on) writes CREATE TABLE IF NOT EXISTS: if the table is there, nothing happens. Off, Snowflake says that it exists. HostWebhook never writes OR REPLACE, so it never replaces a table.
  • Change tracking (off): Snowflake keeps the changes of the table. It uses a little storage.
  • Snowflake doesn't enforce keys. The node names no warehouse for it. The answer has done, table and columns, the number of columns.

Add columns takes the table and a list like [{"name": "NOTES", "type": "VARCHAR"}], with the same rules for types and for {{ }}. The new columns start empty (NULL), so a new column can't be NOT NULL and the node refuses it. A column can't change its type later. The answer has done, table and added.

Truncate table and Drop table

  • Both need Allow emptying or dropping tables, which is off. Without it the node refuses and says “Emptying or dropping a table is off. Turn on «Allow emptying or dropping tables» in the node to do it, e.g. for a table you can create again.”
  • Truncate table deletes every row of the table and keeps the table. There is no recycle bin: only Time Travel brings the rows back.
  • Drop table deletes the table. It only comes back with UNDROP, and only inside the retention time of the table.
  • They have no filter and no brake: they touch the whole table. HostWebhook writes the plain statements, TRUNCATE TABLE and DROP TABLE, never with CASCADE or IF EXISTS.
  • They name no warehouse. The answer has done, table and emptied or dropped.

Resume, Suspend and Resize warehouse

  • All three need Allow warehouse control, which is off. Without it the node refuses and says “Controlling a warehouse is off. Turn on «Allow warehouse control» in the node to resume, suspend or resize one.”
  • The Warehouse is the one that is controlled, a required choice. These steps run on no warehouse of their own.
  • Resume turns it on (RESUME IF SUSPENDED: one that is already awake is not an error). It bills while it is awake, until it suspends.
  • Suspend turns it off when its queries end. It affects everything that uses it.
  • Resize takes a Size: X-Small, Small, Medium, Large, X-Large, 2X-Large, 3X-Large, 4X-Large, 5X-Large or 6X-Large. It changes the size for everything that uses the warehouse, and each size up doubles the credits an hour.
  • It never creates or drops a warehouse. The answer has done, warehouse and resumed, suspended or size.

List tasks, Run task and Suspend or resume task

  • List tasks gives the tasks of a schema with their state and schedule (up to 10,000, and truncated says when there may be more). It never gives the code of a task: definition, condition and config are not in the answer. The next nodes run once per task.
  • Run task runs a task now, with the warehouse of the task, and bills like any run of the task. The answer is started and task. It has no switch of its own: it only runs a task that already exists, and what the task does is up to its owner.
  • Suspend or resume task takes an Action: Suspend stops the schedule of the task, and so what depends on it; Resume starts it again. The answer has done, task and action.
  • The task is a name: you choose it, and the event never does. These steps name no warehouse.

List stages, List stage files and Copy into table

  • List stages gives the stages of a schema, internal and external, each with what Snowflake says of it, and truncated. The next nodes run once per stage.
  • List stage files gives the files of a Stage, with their size and date, and count and truncated. Path (a folder or a prefix inside the stage) and Pattern (a regular expression for the whole file path, like .*orders.*[.]csv) narrow it.
  • The path, the files and the pattern are written into the statement, so they are strict. A path has letters, numbers and _ - . / = % + ~, up to 500 characters, with no .., no // and no -- (a / at the start is dropped). A pattern or a file name has no quotes, no $$, no $ at the end and no control characters, and is up to 255 characters. What doesn't pass is refused.

Copy into table loads files from a stage into a table. The stage is always in the same database and schema as the table.

  • Which files: all the files under the Path, or the Files you list (one per line, up to 1,000), or a Pattern. The files and the pattern are exclusive.
  • Format: CSV (the default), JSON or Parquet. Skip header (0 to 10) is for CSV only. Match by column name (off) is for JSON and Parquet only: the fields go to the columns of the table with the same name, ignoring case.
  • On error: Abort (the default) stops the load, Continue loads the good rows, and Skip file leaves out the file that has a bad row.
  • HostWebhook never sends FORCE, PURGE, OVERWRITE or VALIDATION_MODE. Snowflake skips a file it already loaded, and nothing is deleted from the stage.
  • It runs in the warehouse of the node, or the credential's: it wakes it and bills while it loads.
  • The answer has files, one for each file with its status, rowsParsed, rowsLoaded, errorsSeen and, if there is one, firstError; loaded, the rows loaded in all; failed, the files that did not load; and message when there was nothing to load. With Continue or Skip file, some rows or files may not load, and failed and errorsSeen say so.

Export query result

Runs a query and gives the rows as CSV text with a file name. Nothing is written in Snowflake. Pick the Source:

  • Table: Database, Schema, Table, Columns, Filters, Order, and Limit or Return all. It is exactly Select rows.
  • SQL: one query that you write, read as Run SQL reads it (the {{ }} as values, the doors shut, Parameters with your own ?), but with no switch for several statements. It has to be one statement that starts with SELECT, or with WITH and ends in a SELECT. A WITH that ends in INSERT, UPDATE, DELETE or MERGE, a change of data, a schema change or a call is refused: use Run SQL for those. It is a read, so it has no switch of its own.
  • File name: letters, numbers and _ - ., ending in .csv, up to 100 characters. It is export.csv if you leave it empty.
  • The CSV follows RFC 4180: the header is the names of the columns of the first row, a field with a comma, a quote or a line break goes between quotes, lines end in \r\n, a NULL is an empty cell, and an object or a list is written as JSON. It is at most 5 MiB of UTF-8: the rows stop at the last one that fits, nothing is cut inside a row, and truncated says it.
  • Protect formulas (on): a spreadsheet runs a cell that starts with =, +, - or @ (or a tab or a carriage return) as a formula, so a text cell or a header that starts with one gets a quote in front. A plain number, like -5, is left alone.
  • It runs in the warehouse of the node, or the credential's. The answer has csv, fileName, rows, bytes and truncated.

The three switches of group 3

SwitchDefaultInWhat it does
Allow emptying or dropping tablesOffTruncate table, Drop tableOff: both refuse. On: they empty or delete the table.
Allow warehouse controlOffResume, Suspend, Resize warehouseOff: all three refuse. On: they change the state or the size of the warehouse.
Protect formulasOnExport query resultOn: a cell that starts like a formula gets a quote in front. Off: it goes as it is.

The first two are off until you turn them on, and only a real On counts: the event can't turn one on, and a value that comes from somewhere else, like the text true, leaves it off. Protect formulas stays on unless it is a real Off: a missing value or a text keeps it on, and the event can't turn it off.


Append rows (Snowpipe Streaming)

Append rows adds rows to a table without a warehouse. It sends them through Snowflake's Snowpipe Streaming, to the default pipe of the table, so nothing has to be created in your account. Snowflake bills it by the GB of data it receives, not by the minutes of a warehouse. It suits a flow that gets many small events a day, where Insert rows would wake the warehouse on every run. The node says it:

ℹNo warehouse: Snowpipe Streaming, billed by the GB sent. A row Snowflake can't load isn't reported here, and a retry can add a row twice.
  • The fields are those of Insert rows: Database, Schema and Table from the lists, and Rows, one object per row with the same columns, up to 1,000 a run. A {{ }} fills a value, never the name of a table or a column. HostWebhook sends them in batches of up to 4 MB, one after the other.
  • Only with a key pair. Snowflake documents only a key pair for streaming, so with an access token (PAT) the node stops before sending anything: “Append rows needs a key pair credential. Snowflake doesn't take an access token for streaming.” Use a credential with a key pair.
  • The role needs INSERT on the table and USAGE on its database and schema, as for Insert rows.
  • «Sent» is not «in the table». Snowflake answers when it has the rows, and they show up in the table within seconds. The answer has sent, batches, bytes, the requestIds of each batch, retried and this note: “Sent to Snowflake. Rows show up within seconds; a row it can't load goes to the error table if error logging is on, and a retry can add a row twice.”

A row can arrive twice

Snowpipe Streaming delivers at least once. When a batch fails with a network failure, a 429 or a 5xx, HostWebhook sends it again with the same request id, and Snowflake can keep both copies. Then retried is true. For the same reason the node never runs a failed Append rows again by itself: a failure says how many rows the earlier batches already sent. If a duplicate matters, give each row an id of its own (e.g. {{payload.id}}) and remove the copies in Snowflake, e.g. with a QUALIFY ROW_NUMBER() in the query that reads the table.

The rows Snowflake can't load

A row with a column the table doesn't have, or a value of the wrong type, is checked by Snowflake after it answered, so it is not in the answer of the node, and it is lost unless the table keeps it. Error logging is off by default. Turn it on once, and read the rows it couldn't load when you need them:

sqlIn Snowflake
ALTER TABLE SHOP.PUBLIC.ORDERS SET ERROR_LOGGING = TRUE;

SELECT * FROM ERROR_TABLE(SHOP.PUBLIC.ORDERS);

When Snowflake refuses a whole batch (the table doesn't exist, the role can't write it), the run fails, and its answer shows what Snowflake said under streaming, with the rows already sent.

Append rows and the trigger

«Ignore changes made by this flow» doesn't cover Append rows. The rows arrive later, through the pipe, and the node can't mark them, so a trigger on the same table fires on them. Watch another table, or use filters that the rows the flow appends don't match.

If you don't see Append rows in the list of operations, it isn't open for your organization yet.


Ask Cortex

Ask Cortex asks an AI model that runs inside your own Snowflake account and gives its answer back as text: summarize a row, classify a ticket, pull a field out of a message, translate. The data stays in your account, and so does the bill. It goes through the Cortex REST API, with no warehouse. If Snowflake says that your account is not allowed to use the REST API, it asks the same question through SQL and then it uses the warehouse of the credential (when that happens). It is the only operation of the group AI.

ℹIt spends AI credits. Snowflake bills them by the tokens that go in and the tokens that come out, on your Snowflake bill; HostWebhook pays nothing. It is off until the owner of the HostWebhook organization turns on Allow Cortex (AI credits) in the node, and Cortex stops at the daily limit of the account: 500 calls a day unless HostWebhook sets another number, and the node shows the one that applies under the switch. Below is how much one call can cost and where each limit stops it. If you don't see Ask Cortex in the list of operations, it isn't open for your organization yet.

Filling in the fields

FieldWhat to write
ModelOne of the list below, never typed and never filled by an event: a model is a price. Llama 3.1 8B by default.
PromptWhat to ask, up to 32,768 characters (about 8,000 tokens). It is the only field that takes a {{ }}, like Summarize this in one sentence: {{payload.text}}.
Max tokensThe most tokens the answer can have: 1,024 by default, up to 8,192. Advanced. It is always sent, so a call never costs more than you chose.
TemperatureOptional, from 0 to 1, like 0.2. Lower answers more steadily, higher more freely. Advanced.
TimeoutThe seconds to wait for the answer, 30 by default.

The prompt carries data of the event, and anyone who can write text that reaches it can try to steer the model: treat the prompt as untrusted data, like in the AI Node.

The models and what they cost

Only the models of this list are offered. Each one has its own price per token, and a model that is not on the list is refused. The prices are AI credits for every million tokens, quoted from the Snowflake Service Consumption Table (table 6(b), Cortex Inference with Prompt Caching, and table 6(c), Cortex Inference), effective 12 November 2026 and read on 16 November 2026. They can change: the table has the current ones. What a credit costs depends on your contract, so this page gives credits, not money.

ModelIts nameCredits, a million tokens inCredits, a million tokens outNeeds cross-region inference
Llama 3.1 8Bllama3.1-8b0.110.11No. The default, and the cheapest
Claude Haiku 4.5claude-haiku-4-50.52.5Yes
Claude Sonnet 4.5claude-sonnet-4-51.57.5Yes
Claude Sonnet 4.6claude-sonnet-4-61.57.5Yes

The two caps together are the cap of one call. Both the tokens in and the tokens out are billed, so the prompt (up to 32,768 characters, about 8,192 tokens) and Max tokens (1,024 by default) decide the most a call can cost. With the default caps:

ModelThe most one call costs, in creditsAt 500 calls a day, all of them at the most
Llama 3.1 8Babout 0.001about 0.5 credits
Claude Haiku 4.5about 0.0067about 3.3 credits
Claude Sonnet 4.5 and 4.6about 0.02about 10 credits
  • The credits in the answer is what that call cost by this table. Snowflake's own usage records are the bill.
  • The Claude models need cross-region inference, which an account administrator turns on in Snowflake (the account setting CORTEX_ENABLED_CROSS_REGION). Llama 3.1 8B is available where your account is, in the regions Snowflake lists. If the model is not available in your region, the node says so (see the lines below).
  • On a Snowflake trial account the AI features are off. Snowflake turns them on when an administrator adds a credit card, and that does not make the trial a paid account.

The daily limit and the switch

  • The daily limit is 500 calls for the account unless HostWebhook sets another number (up to 5,000), and under the switch the node shows the number that applies. It is counted for the account and the day (UTC), not for each node, so ten nodes or a loop of sub-flows don't make ten times as many calls. A call that fails counts too, and the node never repeats a call by itself. When it is reached, the node says “Cortex stopped for today: this account reached its limit of 500 calls a day.” (with the number that applies).
  • Allow Cortex (AI credits) is a switch of the node, off by default, and only the owner of the organization turns it on: a member who isn't the owner can't save a node with it on, and neither can an API key. While it is off, Ask Cortex does nothing and sends nothing, and the node says it is off. HostWebhook checks it when the flow runs, not only in the panel. Hermes never turns it on.
  • Max tokens is always sent, up to 8,192. If it were left out, Snowflake would answer with up to 4,096, and the call would cost what Snowflake chose, not what you chose. Hermes never raises it above 1,024.
  • A Snowflake budget for AI is a good second brake, but check in your account whether it stops the spending or only warns. If a call is refused because the budget is used up, the node says so (see the lines below).

The role of the user

The Cortex REST API runs with the default role of the Snowflake user of the credential, not with the role you set in the credential (that one is for the other operations). So it is the default role that needs a database role for Cortex:

  • SNOWFLAKE.CORTEX_REST_API_USER (the one to use) opens the REST API and nothing else of Cortex: not the AI functions, the agents, Analyst or Search. Snowflake does not grant it to PUBLIC. It can't be granted to a user directly: grant it to a role, and make that role the default role of the user.
  • SNOWFLAKE.CORTEX_USER is the wide one, and Snowflake grants it to PUBLIC by default, so most users have it already. For the narrow role to be the only way in, revoke it from PUBLIC first.
  • Never an administrator role as the default role (ACCOUNTADMIN, SECURITYADMIN, SYSADMIN…): the token would open Cortex with all that power. HostWebhook looks at the default role of the user before the first call, and again once a day and when the user of the credential changes: with an administrator role, or none, it doesn't ask Cortex and says why (the lines are below). The Test of the credential warns you about it too, and still passes.
sqlThe default role of the user, with only the REST API of Cortex
-- HOSTWEBHOOK_ROLE is the default role of the user in the lines above: the REST API of Cortex and no other Cortex feature
GRANT DATABASE ROLE SNOWFLAKE.CORTEX_REST_API_USER TO ROLE HOSTWEBHOOK_ROLE;
-- Only if you want it to be the only way in: every role has CORTEX_USER through PUBLIC by default
REVOKE DATABASE ROLE SNOWFLAKE.CORTEX_USER FROM ROLE PUBLIC;
ℹThe REVOKE changes your whole account: everyone who has Cortex through PUBLIC loses it. Run it only if that is what you want, and tell the people who use Cortex first. Hermes never writes a grant.

What it gives, and where the answer may not go

FieldWhat it is
textThe answer of the model, as text. Untrusted.
modelThe model that answered.
truncatedtrue when the answer was cut because it reached Max tokens.
promptTokensThe tokens of the prompt, as Snowflake counted them. Empty if it didn't say.
completionTokensThe tokens of the answer, as Snowflake counted them. Empty if it didn't say.
creditsThe AI credits that call cost, from the table of prices of this page. It is a quote, not your bill: the bill is Snowflake's. Empty when a count is missing.
untrustedAlways true.
noteOne sentence that says the answer is text from a model and can be wrong.
ℹThe answer is text from a model: it can be wrong, make things up, or follow instructions hidden in the text you sent. Anyone who can write text that reaches the prompt can try. HostWebhook never runs the answer, and it comes marked untrusted: true. Check what matters before you act on it.
  • The answer never goes to what Snowflake runs: not into the SQL or the Parameters of Run SQL, Run SQL in background or Export query result, not into the method, path, query or body of an API request, and not into the id of a query of Get query results or Cancel query.
  • The answer never becomes a name: not the database, the schema, the table, a column, the warehouse, the task, the stage or the procedure, nor the columns of a table that Create table or Add columns defines, nor the model, the numbers or the switch of another Ask Cortex. You pick those from lists, and an event never decides them.
  • Once an Ask Cortex has run in a run, no Snowflake node that runs after it, in that run, takes a {{ }} in those fields, whatever the {{ }} reads: the other branch of the flow, a step in between, a text that was changed, a flow that your flow calls, $("Ask Cortex") by its name. HostWebhook doesn't try to follow the text: it refuses before anything is sent, with the line below. A step that runs before the Ask Cortex isn't affected. Hermes also refuses to build a flow that does it.
  • As a value it is fine: in a row of Insert rows, in a filter or in a message, it is data, like any text that comes from outside.
  • It is not a tool of the AI toolkit mode, and the AI Node does not use Cortex as its model in this version. If it becomes a tool, it is born blocked, and its answer never goes to a tool that changes something.

When the REST API isn't allowed to the account

Ask Cortex always tries the REST API first. If Snowflake answers that the account is not allowed to use it (a 403 with the code 003001 and the words “This account is not allowed to access this endpoint”, the three together: never any other 403), HostWebhook makes the same call through SQL, with AI_COMPLETE:

  • It wakes the warehouse of the credential and bills it while it is awake, on top of the AI credits. Through the REST API Ask Cortex wakes none. If the credential has no Warehouse, the node says so (below) and sends nothing.
  • Nothing you wrote is part of the SQL. The statement is fixed and written by HostWebhook; the model, the prompt, Max tokens and the temperature go in as values, never in its text.
  • It runs with the role of the credential (the REST API uses the default role of the user). That role needs SNOWFLAKE.CORTEX_USER, the wide database role: SNOWFLAKE.CORTEX_REST_API_USER opens the REST API only, so if you revoked CORTEX_USER from PUBLIC, grant it to that role.
  • The same models, prices, caps, answer and limit of the day. A run takes one place of the day, whichever road it took. The answer has the same text, tokens and credits, and is untrusted in the same way.
  • HostWebhook remembers for an hour, for that account only and in memory, that the REST API is refused, so the next runs go straight to SQL. After the hour it tries the REST API again. Nothing is stored.
  • If the call through SQL fails too, the node says both things, and the answer of the run shows the owner what Snowflake said: its code and a short extract of its message.

When Ask Cortex says no

These are the lines the node shows, and what to do:

What happenedWhat the node says
The switch Allow Cortex (AI credits) is offAsk Cortex is off. Turn on «Allow Cortex (AI credits)» in the node to ask a model: every call spends AI credits.
Snowflake says the default role of the user can't call CortexSnowflake didn't let this user call Cortex. The default role of the user needs SNOWFLAKE.CORTEX_USER or SNOWFLAKE.CORTEX_REST_API_USER.
Snowflake says the REST API of Cortex isn't turned on for the accountSnowflake says the Cortex REST API isn't turned on for this account. Ask Snowflake to turn it on; the AI functions in SQL can work without it.
Snowflake refuses with a 403 and doesn't say whySnowflake refused the call (403) and didn't say why: the default role needs SNOWFLAKE.CORTEX_USER or SNOWFLAKE.CORTEX_REST_API_USER, or the account needs the REST API turned on.
The account isn't allowed the REST API and the credential has no warehouseSnowflake doesn't let this account use the Cortex REST API, so Ask Cortex goes through SQL, which needs a warehouse. Set one in the credential, e.g. HOSTWEBHOOK_WH.
The account isn't allowed the REST API and the call through SQL failed tooSnowflake doesn't let this account use the Cortex REST API (003001), and the same call through SQL failed too. The answer of the run shows what Snowflake said.
Your Snowflake budget for AI is used upYour Snowflake budget for AI is used up. Raise it in Snowflake, or wait for the next period.
Snowflake limits how fast Cortex is calledSnowflake limits how fast Cortex can be called on this account. Try again in a moment.
The model took too longThe model took too long to answer. Try again, or use a smaller model or a shorter prompt.
Snowflake didn't take the requestSnowflake didn't accept the request. Check that the model is available in your region, e.g. llama3.1-8b, and that the sizes are within its limits.
The limit of the day is reached (the number is the limit of the account)Cortex stopped for today: this account reached its limit of 500 calls a day.
The answer reached Max tokensThe answer was cut because it reached Max tokens. Raise it, up to 8,192.
The default role of the user is an administrator roleThe default role of this Snowflake user is an administrator role, and Cortex runs as that role. Give the user a default role made for HostWebhook, e.g. HOSTWEBHOOK_ROLE.
The user has no default roleThis Snowflake user has no default role, so Cortex would not know which role to use. Give the user a default role made for HostWebhook, e.g. HOSTWEBHOOK_ROLE.
The default role couldn't be looked atHostWebhook could not look at the default role of the Snowflake user, so nothing was asked of Cortex. Press Test on the credential, or try again in a moment.
The limit of the day couldn't be countedHostWebhook could not check the daily limit of Cortex, so nothing was asked. Try again in a moment.
The run couldn't be markedHostWebhook could not note which run this is, so nothing was asked of Cortex. Try again in a moment.
An Ask Cortex already ran in this run, and a Snowflake node after it has a {{ }} in SQL, Parameters, a body, a query id or a name (the line starts with the field that has the {{ }}: sql, parameters, body, queryId…)sql: an Ask Cortex already ran in this run, and a {{ }} here could carry its answer. The answer of Cortex is text from a model: it can fill a value, but never SQL, a call to Snowflake or the name of a table, a column, a warehouse or anything else you pick from a list. Write the value itself, or put this step before the Ask Cortex, or use the answer only as a value (a row, a filter, a message).
The same, when it could not be checked that no Ask Cortex ran beforesql: This Snowflake node puts a {{ }} where Snowflake's SQL or call is written, and it could not be checked that no Ask Cortex ran before it in this run. Try again.

The 403 of Cortex has two causes: the default role of the user lacks the database role, or the account doesn't have the Cortex REST API turned on. Only what Snowflake says tells them apart, so the node follows it: it names the role when Snowflake names the role, says the REST API isn't turned on when Snowflake says so, and when Snowflake doesn't say it names both and never claims one. The answer of the run, which only the owner reads, also carries what Snowflake said (its code and a short extract of its message, with tokens and keys taken out); the log keeps only the code.

If the data that reaches the node holds an answer of Ask Cortex, the line of the {{ }} row says “this reads data that holds an answer of Ask Cortex.” instead of its first sentence. How big the data is never matters. Every call counts in the limit of the day, and one that fails counts too. By the REST API Ask Cortex wakes no warehouse; through SQL it wakes the warehouse of the credential, and that bills too.


The trigger

Pick Snowflake as the service on a Trigger node, with a Snowflake credential. It checks your account on a timer and sends what is new to the flow, once. It only reads, with the role of the credential: it creates no stream, task, alert or table in your account and changes no setting. It needs the privileges to read and, for Row changes, change tracking on the table. Deactivating or deleting the trigger stops it.

ℹA warehouse bills while it is awake. The trigger looks first without a warehouse and wakes it only when the table changed, but some events always need it. What a trigger costs says how much, for each event and each interval.

What fires it

Pick one Event. The first three watch one table; the next three watch a query, a schema or the tasks of a schema; the last four watch your account (Account events).

EventIt fires onWakes the warehouseSees deletes
New rowsA row with a timestamp or a number above the last one seen.Only when the table changedNo
New or updated rowsA row that is new, or whose update column moved past the last one seen. Each version is sent once.Only when the table changedNo
Row changesA row that change tracking says was added, changed or deleted. A deleted row comes as it was.Only when the table changedYes
Query resultRuns your SELECT on each check, and fires on new rows in the result or when its first column passes a number.On every check, unless you name a table to wait forNo
Schema changesA table, a view or a column (or a schema or a database) that appeared or went away since the last check.Never: it only uses SHOWNo
Failed taskA run of a task of a schema that failed, with its error.On every checkNo
User changesA user of the account that was created, disabled or dropped. Snowflake shows it about 2 hours late.On every check—
Role grantsA role of your list that was given or taken away, to a user or to another role. About 2 hours late.On every check—
Warehouse changesA warehouse that was created, dropped, resized, or whose auto-suspend or resource monitor changed.Never: it only uses SHOW—
Credit usageA day on which the credits used pass the limit you set. About 3 hours late.Once a day—
ℹOnly Row changes sees a deleted row. A cursor can only find rows that exist. To react to a deletion, use Row changes, which reads the change tracking of the table.

Fields

  • Database, Schema and Table are picked from your account, like in the node. A {{ }} is refused anywhere in a Snowflake trigger: a trigger has no event to fill it.
  • Cursor column (New rows): a column that only grows, e.g. CREATED_AT. The cursor says which columns count.
  • Update column and Cursor column (New or updated rows): the update column is a timestamp that moves on every change, usually UPDATED_AT (a number is refused: “"New or updated rows" needs a timestamp that moves on every change, usually UPDATED_AT.”). The cursor column is optional, the one that is set when the row is created: a row touched within 2 seconds of its creation is sent as row.created and a later change as row.updated. With only the update column, every row is row.updated, new ones too. Key columns (up to 10) identify a row, e.g. ID, so each version of it is sent once.
  • Append only (Row changes): on, only added rows, for a table that is never updated; it is cheaper for Snowflake to read. Off, added, changed and deleted rows. The old version of a changed row is not an event.
  • Query, Fire when, Threshold, Key columns, Re-arm and Check only when this table changes (Query result): see Query result.
  • Watch (Schema changes): some of tables, views, columns, schemas and databases; tables and columns by default. Pick the Database and, if you want only one, the Schema (watching only databases needs neither). It uses only SHOW, so it wakes no warehouse. A SHOW answers up to 10,000 names: a full answer is taken as cut, and what is missing from it is not read as removed.
  • Database and Schema (Failed task): the failed runs of the tasks of that schema (the ones Snowflake marks FAILED or FAILED_AND_AUTO_SUSPENDED), each with its error. It reads the task history, which needs the warehouse awake on every check, so it checks every 15 minutes unless you say otherwise.
  • Filters (optional, up to 10): only rows that match all of them, as in Select rows.
  • Delay and the rule for rows that share a cursor: Delay and tie-break.
  • Rows per check: the most rows one check sends to the flow. 100 by default, up to 500. If more arrived, the next check goes on where this one stopped.
  • Rows to send on first activation: how many rows that already exist are sent the first time. 0 by default, up to 500. Only the first activation sends them: activating again, or changing the table, does not send old rows again.
  • The warehouse: a trigger has no warehouse of its own. The statements that read rows run in the Warehouse of the credential, and metadata and the look are sent with none. If the credential has none, a check that has to read rows fails with “No warehouse. Pick one in the node or in the credential, e.g. HOSTWEBHOOK_WH.”; Schema changes needs none. That line says «in the node or in the credential», but a trigger has no node warehouse: pick it in the credential.
  • Check every, in seconds: 300 (5 minutes) by default, 900 (15 minutes) for Failed task, up to 86,400 (a day). The least is the one of your plan: 60 (1 minute) on a paid plan and 900 on Free.
  • Deliver as and Ignore changes made by this flow have their own sections below.
  • Only rows that arrive after you activate it fire the flow, except the ones you ask for in Rows to send on first activation: a timestamp cursor starts at the clock of Snowflake minus the delay, a whole-number cursor at the biggest value there is (it reads the table for it, so activating wakes the warehouse once), and Row changes at the clock minus the delay.

The cursor

New rows and New or updated rows read in order of a cursor, a column that only grows, and go on from the last value they sent. It is a timestamp (TIMESTAMP_NTZ, TIMESTAMP_LTZ, TIMESTAMP_TZ or DATETIME) or a whole number. The mark is kept as Snowflake writes it, and goes back to Snowflake as a value, never inside the text of the SQL. These columns are not accepted, each with its line:

The column isWhat you see
An id made with NOORDER (the default for AUTOINCREMENT since 2024)That id was made with NOORDER, so it does not grow in order. Use a timestamp like CREATED_AT, or an id made with ORDER.
A column that takes its default from a sequenceThat id comes from a sequence, and a sequence may not grow in order. Use a timestamp like CREATED_AT.
A DATEA date has no time of day, so every row of a day looks the same. Use a timestamp like CREATED_AT.
A number with decimalsA number with decimals is not a cursor. Use a timestamp, or a whole number that only grows.
A FLOATA FLOAT does not compare exactly. Use a timestamp, or a whole number that only grows.
A text or an ID like a UUIDA text or an ID like a UUID doesn't grow, so rows would be missed. Use a timestamp, or a whole number that only grows.
Any other typeThat column can't be the cursor. Use a timestamp, or a whole number that only grows.
  • A timestamp is the best cursor. A name like CREATED_AT is a good sign. HostWebhook reads a TIMESTAMP_NTZ as UTC, so write UTC into it. If your app writes local time, the delay is longer east of UTC, and there is none at all west of it.
  • A column that can be empty hides rows. Rows where the cursor is empty are never seen: “That column allows empty values, and rows where it is empty are never seen.” Make the cursor NOT NULL.
  • The same cursor, many rows. A bulk load (INSERT … SELECT, COPY INTO) gives every row the same CURRENT_TIMESTAMP. See Delay and tie-break.
  • The columns are read again each time: if the table changes and the cursor no longer fits, the trigger pauses with its line.
⚠A whole-number cursor can miss a row. An id made with ORDER is handed out in order, but not committed in order: a transaction that took id 10 can commit after id 11 was already read, and 10 is skipped. A timestamp has the delay for this; a number has no clock to take away, so it has none. HostWebhook accepts the number and warns you, under the picker and when you activate or press Test push: “A long transaction can commit an id after a higher one was already read, and that row is skipped. A timestamp like CREATED_AT is safer.” Use a timestamp (CREATED_AT) as the cursor when you can. A number that jumps far ahead (over 250), maybe from a row with a huge id, pauses the trigger.

Delay and tie-break

  • Delay (New rows, New or updated rows and Row changes): the trigger reads only rows older than this, by the clock of Snowflake, not ours. It is 60 seconds by default, from 0 to 3,600. A transaction that commits within the delay is not skipped. One that takes longer than the delay to commit can be: give the delay what your longest write needs, and no more. The trigger reads up to the clock minus the delay and then goes on from there, so a row whose cursor is older than that, and that commits after the trigger passed it, is not seen. The longer the delay, the later the flow runs.
  • Rows that share a cursor. The trigger goes on from the last value it sent with >=, not >, and remembers which rows at that value it already sent, so a row at the mark is neither sent twice nor skipped. If more rows than Rows per check share one value, it reads them in pages ordered by a tie-break column. In New rows it is the one-column primary key that the table declares; in New or updated rows it is the only key column you gave (a key that the table declares doesn't count there). Snowflake doesn't enforce keys, but a declared one tells the order.
  • With no tie-break, such a group would be read from the first row for ever, so the trigger pauses and says so (see Pauses) instead of going quiet. Add a one-column primary key, or raise Rows per check.
  • A whole-number cursor has no delay (see the warning above). Row changes has its own handling: if more rows than the limit changed in a stretch of time, the stretch is cut in half and read again, up to 8 times, because a change has no row to page by.

The look without a warehouse

Snowflake answers SYSTEM$LAST_CHANGE_COMMIT_TIME with the warehouse asleep (so do SHOW, DESCRIBE, LIST and COUNT(*); a SELECT * wakes it). So every check of New rows, New or updated rows and Row changes first asks Snowflake for the commit token of the table:

  • The token moved: something was committed. The warehouse wakes, the rows are read and sent. The token is only compared with the last one, never read as a number or a date.
  • The token is the same: nothing was committed, so nothing is read and the warehouse stays asleep. A table that doesn't change costs no credits to watch.
  • One more read after a change. A row committed just before the check can be younger than the delay, so it is not read yet. The trigger reads once more after the delay (plus 30 seconds) has passed since it first saw that token, so such a row doesn't wait for another write. Only after a read that happened after that does it go back to skipping.
  • If the token can't be read, it reads the rows: an unreadable token never says that nothing changed.
  • Row changes with an unchanged token moves its stretch of time up to the clock minus the delay without reading, so it never falls outside what the table keeps.

Query result

Write a Query: one statement that starts with SELECT, or with WITH and ends in a SELECT, e.g. SELECT COUNT(*) AS N FROM SHOP.PUBLIC.ORDERS WHERE STATUS = 'failed'. It runs on every check, and Fire when says what makes it fire:

  • New rows in the result: it fires on the rows that are new in the result. Key columns (up to 10) say which columns identify a row of the result.
  • Above or Below a number: the first column of the result against the Threshold, e.g. N > 10.
  • Re-arm: on, it fires once until the condition clears, e.g. one alert for each outage.
  • Check only when this table changes: name a table (e.g. ORDERS) and the check is skipped while that table is unchanged, with the same look as above, so the warehouse stays asleep. Without it the query runs, and wakes the warehouse, on every check.
  • The query takes no {{ }}, because a timer repeats it and there is no event to fill it. It also keeps shut the doors that Run SQL shuts when it has a value: SYSTEM$ functions, IDENTIFIER(, TABLE(, TO_QUERY, EXECUTE IMMEDIATE, RESULT_SCAN and Scripting blocks. Anything that is not a query is refused.
  • The role is still the limit. Snowflake has no read-only session, so a SELECT can still draw from a sequence or call a function that changes things. Give the role only what the query needs.

Ignore changes made by this flow

On by default (table events). Rows that this flow writes with Insert, Update or Upsert rows don't fire it, so a flow that changes the table it watches doesn't start itself for ever. Snowflake leaves no mark of who changed a row, so the node remembers what it wrote: after each write it keeps a fingerprint (a SHA-256 of the columns it wrote, with their names, and not the values) and the trigger skips a row that is exactly that. It skips only that exact version, so an edit by someone else a moment later does fire.

  • Not covered: “Run SQL, Call procedure, Copy into table and Run task don't tell which rows they changed, so the trigger may fire on them.” Snowflake doesn't say which rows a statement changed. Append rows isn't covered either.
  • A doubt is a send. If a row doesn't match a fingerprint, or the node couldn't remember it (“Some rows this flow wrote could not be remembered as yours. The trigger may fire on them.”), the row fires the flow. It errs on firing too often, never too little.
  • A deleted row always fires (Row changes), even one this flow deleted.
  • Only the same connection counts: the credential, the account, the user and the role. A fingerprint made under another one doesn't hide a change.
  • HostWebhook keeps the fingerprints for a limited time and removes them when you delete the trigger. Snowflake doesn't enforce keys, so the trigger tries each set of columns the node wrote for the table, up to 10.

Deliver as

One event per row (the default) runs the flow once for each row. One event per check sends all the rows of a check in one event, so the flow runs once and not once per row, e.g. to load them together. A check that finds nothing sends nothing, either way.

jsonOne event per check
{
  "event": "batch.found",
  "count": 2,
  "items": [
    { "event": "row.created", "operation": "inserted", "database": "SHOP", "schema": "PUBLIC", "table": "ORDERS", "row": { "ID": 1042, "STATUS": "new" } },
    { "event": "row.created", "operation": "inserted", "database": "SHOP", "schema": "PUBLIC", "table": "ORDERS", "row": { "ID": 1043, "STATUS": "new" } }
  ]
}
  • count is the number of items, and each item is the event that a row would have had on its own. With a cursor, truncated (true) appears only when the check read as many rows as Rows per check, so more may follow.
  • A batch goes out all or nothing, and the mark moves only with what was really handled. A row whose event doesn't fit in 16 MiB is skipped, and the trigger says so.
  • With one event per check, {{payload.count}} and {{payload.items}} are what the flow gets; the nodes after the trigger run once.

What the trigger sends downstream

jsonOne event per row
{
  "event": "row.created",
  "operation": "inserted",
  "database": "SHOP",
  "schema": "PUBLIC",
  "table": "ORDERS",
  "row": { "ID": 1042, "STATUS": "new", "TOTAL": "59.97" }
}
  • event is row.created (operation inserted), row.updated (updated) or row.deleted (deleted, Row changes only). New rows only sends row.created.
  • row is the whole row with the types the node gives (a decimal stays text). The column names keep the case Snowflake has, so write {{payload.row.STATUS}}. A deleted row comes as it was. The columns Snowflake adds to describe a change (METADATA$ACTION and the others) are not in it.
  • The three other events of a table, a query or a schema send query.fired, schema.changed and task.failed in event.
  • The four events of the account send user.changed, role.grant.changed, warehouse.changed and credits.exceeded, with no row (Account events).
  • Each row runs once: if a delivery fails, the trigger goes on from the last row that went out, and a retry doesn't send the same event twice.

Trying it out

The trigger's Test push shows what it would pick up now, as it will arrive (up to 10 rows), so you can write {{payload.row.STATUS}} in the nodes below it from the start. For the cursor events it shows the latest rows, newest first, with the filters and the delay; for Row changes, the changes of the last hour. Nothing is sent to the flow and the mark doesn't move, so it never swallows what it showed. It reads rows, so it wakes the warehouse like any other read, and a whole-number cursor shows its warning there too.

Account events

User changes, Role grants, Warehouse changes and Credit usage are in the group Account events of the event list. They watch your account, not a table, so they have no database, schema, table or cursor: they read who is in the account, who has a role, and what the warehouses and the spending do. They only read, and the first check only learns what exists and sends nothing (Credit usage is the one exception, below).

EventWhat you pickCheck every (the least)Snowflake shows it
User changesWhat to watch: created, disabled, dropped (all three by default).1 hourAbout 2 hours late
Role grantsRoles to watch: up to 20. Empty means the administrator roles: ACCOUNTADMIN, SECURITYADMIN, ORGADMIN, SYSADMIN and GLOBALORGADMIN.1 hourAbout 2 hours late
Warehouse changesWarehouses to watch: up to 50, all of them if empty. What to watch: created, dropped, size, auto-suspend, resource monitor.15 minutesWithin the interval
Credit usageCredits in a day, above which it fires: more than 0, up to 1,000,000. Optionally one Warehouse, the whole account if empty.1 day: it checks once a dayAbout 3 hours late

The least is the one of the event, and the least of your plan never lowers it. Rows per check and Deliver as work as in the other events: a check sends up to that many changes and the rest come out in the next one. Filters, Delay, Rows to send on first activation and Ignore changes made by this flow are for tables, so an account event does not show them.

The role needs a database role. An account event needs no USAGE on a database or SELECT on a table. User changes and Role grants read the users and the grants of the account through the database role SNOWFLAKE.SECURITY_VIEWER, and Credit usage reads the credits through SNOWFLAKE.USAGE_VIEWER. Warehouse changes needs neither: it reads SHOW WAREHOUSES, which lists the warehouses the role has a privilege on. As an administrator of the account (ACCOUNTADMIN), run only the ones you need, with the name of your role:

sqlThe database roles
-- User changes and Role grants
GRANT DATABASE ROLE SNOWFLAKE.SECURITY_VIEWER TO ROLE HOSTWEBHOOK_ROLE;
-- Credit usage
GRANT DATABASE ROLE SNOWFLAKE.USAGE_VIEWER TO ROLE HOSTWEBHOOK_ROLE;
  • Snowflake keeps these views up to 2 hours behind for users and grants, and 3 hours for the credits, so a change reaches the flow later than it happened. Three of the four events read them with the warehouse of the credential, so they wake it (Warehouse changes does not).
  • HostWebhook never asks for the right to give rights. The role of the credential must be one that can only read: it must not hold MANAGE GRANTS or own a user or a role, and no role it inherits and no secondary role of its user can either. HostWebhook looks at the role, the roles it inherits and the secondary roles that are active when the event is turned on, on Test push, and again when the credential or the event changes; if one of them can grant, or if it could not check them all, the event stays off and says why (the lines).
  • Role names. A name without quotes is upper case in Snowflake (accountadmin is ACCOUNTADMIN). Between double quotes it is exact, so to watch a role that was created in lower case, write it as "my_role": my_role and MY_ROLE are different roles. A quote inside a name is written twice, and a name whose quote is never closed is refused.
ℹThe user name goes to your flow, and in Snowflake it is often an e-mail. User changes sends the name of the user (the NAME of SNOWFLAKE.ACCOUNT_USAGE.USERS) and Role grants the name of who got the role (the GRANTEE_NAME of the grants). In many accounts that name is an e-mail address, so treat these events as personal data: wherever your flow sends them (a message, a sheet, an e-mail), they go too. The e-mail column and the login history are never read, even though SNOWFLAKE.SECURITY_VIEWER would let HostWebhook read them: it asks for a fixed list of columns and never uses SELECT *. Between two checks it keeps nothing personal: only a hash of what identifies each user or grant, and its state.

What each event sends: one event for each change (or one for each check, with One event per check), with the fields flat next to event, so you write {{payload.user}}. The detected_at of all of them is the moment of the check that saw it.

EventThe eventWhat is in it
User changesuser.changedchange (created, disabled or dropped), user, user_type, disabled, created_on, deleted_on, detected_at
Role grantsrole.grant.changedchange (granted or revoked), role, grantee_type (user or role), grantee, granted_by, granted_on, revoked_on, detected_at
Warehouse changeswarehouse.changedchange (created, dropped, size, auto_suspend or resource_monitor), warehouse, before, after, detected_at
Credit usagecredits.exceededday, credits, threshold_credits, warehouse (if you picked one) or scope with the value account, detected_at
jsonUser changes, one event per row
{
  "event": "user.changed",
  "change": "created",
  "user": "ANA",
  "user_type": "PERSON",
  "disabled": false,
  "created_on": "2026-11-16T09:00:00.000Z",
  "deleted_on": null,
  "detected_at": "2026-11-16T10:00:00.000Z"
}
  • A user is told apart by its name and the moment it was created, so a user that is dropped and made again with the same name is a new one. The view has no date for a change, so the detected_at of a disabled user is the moment HostWebhook saw it. Enabling a user again sends nothing.
  • A grant is told apart by who got it, which role and when. A role that is taken away and given again is a new grant, and one that was given and taken away between two checks comes as both.
  • Credit usage looks at the last two days and sends each day once that is at or above the limit, even if its credits keep growing. Unlike the others, its first check sends the days that are already above the limit, because it is a limit and not a change.
  • Too many to compare. An account with more than 5,000 users, roles you watch with more than 5,000 grants, or more than 1,000 warehouses pauses the trigger with a line that says so, never a silent cut. Watch fewer roles. If the saved state of a trigger can't be read, it learns the account again and warns you that the changes between the two checks were not sent.
  • Test push shows what each one would send now, up to 10, with every user, grant or warehouse it sees as a new one, and sends nothing. It reads the same views, so it wakes the warehouse like a check does, except for Warehouse changes.

Health check and pauses

Once a day HostWebhook checks each trigger by reading the columns of its table (DESCRIBE) and, for Row changes, whether change tracking is still on (SHOW TABLES). Both are metadata, wake no warehouse, and read no rows. A check that runs out of its time never counts as a failure, and a failure of the moment (a cut connection, Snowflake busy) is tried again by the next check: only five in a row pause the trigger. These pause it, each with its own line on its card:

What happenedWhat the card saysPauses
Snowflake rejects the key or the tokenSnowflake didn't accept the key or the token. Check the credential and press Test.The credential
Your network policy blocks HostWebhook's IPYour Snowflake network policy blocks HostWebhook. Allow HostWebhook's IP, the one the credential shows.The credential
The role of the credential is missing a privilege the trigger needsThe credential's role is missing a privilege this trigger needs. Grant it in Snowflake, then turn the trigger back on.This trigger
The table isn't there any more, or the role can't see itThe table ORDERS doesn't exist any more, or the role of the credential can't see it. Pick another table.This trigger
The cursor column, or another column the trigger uses, isn't in the table any moreThe column CREATED_AT isn't in the table any more. Pick another one.This trigger
Change tracking was turned off on the table (Row changes)Change tracking is off on ORDERS. Its owner can run ALTER TABLE ORDERS SET CHANGE_TRACKING = TRUE, then turn the trigger on.This trigger
Five checks fail in a rowPaused after 5 failed checks in a row. Fix the cause and turn it on again.This trigger
More rows than one check can read share the same cursor value, and nothing tells them apartMore rows than one check can read share the same cursor value. Add a one-column primary key to tell them apart, or read more rows per check.This trigger
Row changes: more rows than one check can read changed in one secondMore rows than one check can read changed within one second. Raise "Rows per check".This trigger
A whole-number cursor jumped far aheadThe cursor jumped far ahead, maybe from a row with a huge id. Use a timestamp like CREATED_AT as the cursor.This trigger
The key of a row is empty or over 1,000 charactersA row's key is empty or over 1,000 characters, so the check can't go past it. Fix or delete that row, then turn the trigger on again.This trigger
User changes or Role grants: the role doesn't have SNOWFLAKE.SECURITY_VIEWERThe role of the credential doesn't have the database role SNOWFLAKE.SECURITY_VIEWER. Ask the owner of the account to grant it to the role.This trigger, at once
Credit usage: the role doesn't have SNOWFLAKE.USAGE_VIEWERThe role of the credential doesn't have the database role SNOWFLAKE.USAGE_VIEWER. Ask the owner of the account to grant it to the role.This trigger, at once
An account event: the role can grant privilegesThis role can grant privileges (MANAGE GRANTS or ownership of users or roles). Use a role that can only read.This trigger
An account event: the roles could not all be checkedHostWebhook couldn't check every role this credential can use (the roles its role inherits and its secondary roles), so it couldn't make sure that none of them can grant privileges (MANAGE GRANTS or ownership of users or roles). Account events read users and grants, so they stay off until that check passes.This trigger
An account event: more users, grants or warehouses than a trigger can compareThis account has more users than a trigger can compare (5,000). Ask for a smaller account or contact support. (The same for the grants of the roles you watch, 5,000, and for the warehouses, 1,000.)This trigger
  • The credential: a key or a token that Snowflake rejects, or an IP that its network policy blocks, pauses every Snowflake trigger of that credential, and the credential asks to be reconnected.
  • A check that starts and never finishes, three times in a row, pauses the trigger too.
  • Fix the cause and turn it on again. The mark is kept between activations on purpose, so what changed while it was off is still sent. If what it watches changed (the account, the table, the event, the cursor, the keys or the filters), it starts again from now and doesn't send old rows.
  • Changing the event, the table, the cursor, the keys, the filters or Append only of an active trigger asks you to confirm the credential and the flow.

What a trigger costs

HostWebhook pays Snowflake nothing: the credits are yours. A check costs what the warehouse bills for waking, at least a minute each time. Your edition, cloud, region and contract set the price of a credit, so this gives credits, not money.

  • New rows, New or updated rows and Row changes wake the warehouse only when the table changed (see the look). A table that doesn't change costs nothing to watch; the cost is the share of checks that find a change.
  • Schema changes uses only SHOW: no warehouse, no credits.
  • Failed task reads the task history, which needs the warehouse awake on every check, so every check bills. It checks every 15 minutes by default for that reason.
  • User changes and Role grants read the views of the account with the warehouse awake on every check, and a check is never more often than once an hour, so they wake it at most 24 times a day: about 0.4 credits a day in the table below. Credit usage wakes it once a day, and Warehouse changes uses only SHOW: no warehouse, no credits.
  • Query result runs your query on every check and wakes the warehouse each time, unless you name a table in Check only when this table changes.
  • Test push reads rows, and so does the backfill of the first activation if you ask for rows, and so does activating a trigger with a whole-number cursor (it reads the biggest value of the table), so each wakes the warehouse once.
  • The look, the lists of the node and the Test of the credential wake no warehouse.

The most a trigger can cost, with an X-Small warehouse (1 credit an hour) and AUTO_SUSPEND = 60, if every check finds the table changed and wakes it:

Check everyWakes a dayCredits a day (about)Credits a month (about)
15 minutes (the least on Free)961.648
5 minutes (the default)2884.8144
1 minute (the least on a paid plan)It never gets to sleep24720
  • A warehouse also stays awake for its AUTO_SUSPEND after the last query, so a longer one costs more for each wake: with AUTO_SUSPEND = 600 (10 minutes), every 15 minutes is about 16 credits a day. Keep it at 60.
  • Each size up doubles the cost. A small, quiet table on an X-Small warehouse with a resource monitor is the cheapest way to watch Snowflake.
  • Give the warehouse a resource monitor (the lines to create one). If it runs out of credits, the checks fail and, after five in a row, the trigger pauses.
  • Change tracking, which Row changes needs, and the Time Travel retention of a table use a little storage.

AI toolkit mode

In AI toolkit mode the node becomes 11 tools that an AI Node calls by name. Three read and start open; the other eight start blocked until you unlock each one. The tools of rows and the ones for procedures and tasks never receive SQL from the model: HostWebhook writes the statement, with the names quoted and every value sent as a value. Only two tools take SQL that the model writes, and they have their own walls.

⚠The role of the credential is the limit. Snowflake has no read-only session, so no tool can promise that it only reads, and the two tools of SQL are not limited to the tables on your list. Give the AI a credential whose role has only what its tools need (the lines are below), and unlock a tool only if the agent should do that.
ToolWhat it doesClassAt the start
describe_snowflake_tablesLists the tables you chose, with their columns and types. It uses DESCRIBE, so it wakes no warehouse.ReadOpen
select_snowflake_rowsReads rows with structured filters and an order, up to 200.ReadOpen
count_snowflake_rowsCounts the rows that match the filters.ReadOpen
insert_snowflake_rowsAdds rows, up to 100 a call.WriteBlocked
update_snowflake_rowsChanges the rows that match the filters. Filters are required and the brake is on.DestructiveBlocked
upsert_snowflake_rowsAdds rows or overwrites the ones with the same key, up to 100 a call.DestructiveBlocked
delete_snowflake_rowsDeletes the rows that match the filters. Filters are required and the brake is on.DestructiveBlocked
query_snowflakeRuns a SELECT that the model writes. Meant for reading, but not read only.DestructiveBlocked
execute_snowflake_sqlRuns one data statement that the model writes: SELECT, INSERT, UPDATE, DELETE or MERGE.DestructiveBlocked
call_snowflake_procedureCalls a stored procedure from your list.DestructiveBlocked
run_snowflake_taskRuns a task from your list now.DestructiveBlocked
⚠Only a tool call picks the tool. In AI toolkit mode, only an AI Node, an MCP client or a voice agent chooses which tool the node runs. Run Test, a flow or a webhook run the operation saved on the node: an operation in their payload that names another tool is refused.
✦To try a tool, call it from an AI Node or from an MCP client. Its arguments look like this:

What you control

  • Tables the AI can use. One per line, e.g. SHOP.PUBLIC.ORDERS, always with the database, the schema and the table. The tools of rows touch only those tables, and empty means none: until you add a table, they refuse. It is checked before HostWebhook connects, and the refusal names the tables that are allowed, so the model can ask for one of them: “The AI can't use "SHOP.PUBLIC.ORDERS". It can use: SHOP.PUBLIC.CUSTOMERS. Add another to "Tables the AI can use".” The description of each tool carries the list. The model never picks a database or a schema: they come from the entry of the list.
  • Columns the AI can see. One per line, e.g. EMAIL. It is optional, and empty means all columns (the opposite of the other lists, on purpose). With it set, the model can only name those columns to read, filter by, sort by, write, key an upsert or update, and a read that names none gets them and not *. describe_snowflake_tables shows only them. It fails closed: a list the check can't read is a refusal. With it set, both tools of SQL are off, because they can name any column: “The owner limited the columns the AI can see, and this tool can name any column, so it is off. Use select_snowflake_rows, or ask the owner to empty "Columns the AI can see".”
  • Procedures the AI can use. One per line, with the types of its arguments, e.g. SHOP.PUBLIC.ADD_ORDER(VARCHAR, NUMBER(38,0)). Empty means none. The model sends the name (and its types only when two listed procedures share a name) and the values, and the signature that runs is always yours, so it never picks the overload. A comma never separates two entries: it is part of a signature.
  • Tasks the AI can use. One per line, e.g. SHOP.PUBLIC.NIGHTLY_LOAD. Empty means none. run_snowflake_task runs only those.
  • Names are plain. Each part is letters, numbers, _ and $, and does not start with a number. A name with a dot, a quote, a space or a {{ }} is left out of a list instead of widening it, and a name is compared as it is written: shop.public.orders is not SHOP.PUBLIC.ORDERS. Each list takes up to 100 entries, and the columns up to 200. You can still use any other name in the node with its own forms.
  • Blocked at the start. Insert, update, upsert and delete rows, query_snowflake, execute_snowflake_sql, call_snowflake_procedure and run_snowflake_task are off until you unlock them, one by one. A blocked tool can't be used by any AI node. Blocking delete_snowflake_rows does not block deleting if you unlock execute_snowflake_sql, which takes a DELETE too.
  • Fixed limits. Up to 200 rows when reading and 100 rows when inserting or upserting; the node's Limit doesn't count for the AI. Return all is off. The brake of Update and Delete is on, with the limit of the node (1,000 if it has none), even if the node turned it off for its own single operations. Several statements are never allowed. The warehouse, the timeout, the database and the schema are never a parameter: the node's warehouse and timeout are used.
  • Nothing the model writes is filled in. A {{ }} in a filter, a row or a SQL is literal text, never replaced with data of the flow.
  • What goes back to the model is cut to 200 rows, to 100,000 characters and to the cap the node sets on what the model reads (20,000 characters by default, from 1,000 to 200,000), and the answer says what was left out. With no table named, describe_snowflake_tables describes up to 25 tables of your list and says if there are more; with an empty list it doesn't even connect.
  • Rows are data, not instructions. What comes back is written by the users of your app, so it can say anything. The descriptions of the tools tell the model to treat it as data, and every refusal line clips what the model wrote. A model can still be fooled by a row: block the tools it doesn't need.
  • What the AI reads goes to the AI. The rows a tool gives back are sent to the provider of the AI Node, under its terms. Decide which tables and columns it may touch.

The two tools that take SQL from the model

query_snowflake and execute_snowflake_sql are the only tools where the model writes the SQL. It sends one statement with a ? for each value and the values in params, like ["paid", 100](text, numbers, true, false or null), and the count has to match. Both are born blocked, are refused while you limit the columns, and are not limited to the tables on your list: they reach any table, and any column, that the role can.

  • query_snowflake is classed as destructive although its verb is a read, and it does not promise to be read only. It takes one statement that starts with SELECT, or with WITH and ends in a SELECT, and gives back up to 200 rows. But Snowflake has no read-only session: a SELECT can still draw from a sequence, call a function that changes things or spend credits in an AI function. It reads everything the role can read, and your list of tables doesn't cover it. If you unlock it, use a credential whose role only has SELECT.
  • execute_snowflake_sql takes data statements only: one statement whose main verb is SELECT, INSERT, UPDATE, DELETE or MERGE (or a WITH that ends in one of them). It can't create, alter or drop anything, TRUNCATE, GRANT, USE, COPY INTO or CALL, and it never runs INSERT OVERWRITE, which empties the table first (“INSERT OVERWRITE empties the table first, and this tool never does that. Use INSERT INTO.”). Anything else gets “This tool takes ONE statement that starts with SELECT, INSERT, UPDATE, DELETE or MERGE, e.g. UPDATE SHOP.PUBLIC.ORDERS SET STATUS = ? WHERE ID = ?. It can not create, alter or drop anything, empty a table, grant rights, load files or call a procedure.” It says to prefer select_snowflake_rows, insert_snowflake_rows, update_snowflake_rows or delete_snowflake_rows when one of them can do the job.
  • An UPDATE or a DELETE needs a WHERE of its own, outside every bracket (one in a string, a comment, a quoted name or a subquery doesn't count): “An UPDATE or a DELETE needs a WHERE, so that it never changes every row by accident. Add the condition, e.g. WHERE ID = ?.” This is a seat belt, not a wall. WHERE 1=1 passes, and so does MERGE … ON 1=1 WHEN MATCHED THEN DELETE, because a MERGE has no WHERE to ask for: it deletes every row of the table. What stops it is that the tool starts blocked and that the role can only change what you gave it.
  • The walls both share: one statement, read token by token so that a comment, a quote or a line break can't hide a second statement or a door; no {{ }} (a marker written by a model is refused, never replaced); up to 20,000 characters; and the doors that Run SQL shuts when it has a value are shut here always: SYSTEM$ functions, IDENTIFIER(, TABLE(, TO_QUERY, EXECUTE IMMEDIATE, RESULT_SCAN and Scripting blocks. In Snowflake even a SELECT can send data out by mail (SYSTEM$SEND_EMAIL) or cancel other people's queries (SYSTEM$CANCEL_ALL_QUERIES), so that is why they are shut.

A role for the AI

The lists keep the model to what you named, but only for the tools of rows. For everything else the role of the credential is the limit, so give the AI a credential of its own, with its own role and a small warehouse, and only the privileges the tools you unlock need. For reading only (the three open tools, and query_snowflake if you unlock it):

sqlA role that only reads
CREATE ROLE HOSTWEBHOOK_AI_ROLE;
GRANT USAGE ON WAREHOUSE HOSTWEBHOOK_WH TO ROLE HOSTWEBHOOK_AI_ROLE;
GRANT USAGE ON DATABASE SHOP TO ROLE HOSTWEBHOOK_AI_ROLE;
GRANT USAGE ON SCHEMA SHOP.PUBLIC TO ROLE HOSTWEBHOOK_AI_ROLE;
GRANT SELECT ON TABLE SHOP.PUBLIC.ORDERS TO ROLE HOSTWEBHOOK_AI_ROLE;
  • Add INSERT, UPDATE or DELETE on a table only for the write tool you unlock, USAGE on a procedure only for one on your list, and what Snowflake asks to run a task only for a task on your list.
  • A role with only SELECT can't change a table, which is what makes query_snowflake reasonable to unlock. It still reads every table it has SELECT on, and it still spends warehouse credits.
  • Never ACCOUNTADMIN, SECURITYADMIN, SYSADMIN, OWNERSHIP of your data or MANAGE GRANTS: a SQL tool would use them.

What a call costs

  • Every call that runs a statement can wake the warehouse and bills at least a minute: select, count, insert, update, upsert, delete, both tools of SQL and call_snowflake_procedure. An AI can call them as often as it wants, so use a small warehouse with a resource monitor.
  • describe_snowflake_tables uses DESCRIBE and wakes nothing. run_snowflake_task names no warehouse: it bills with the warehouse of the task.

What it costs

HostWebhook pays Snowflake nothing: the credits are yours. A warehouse bills while it is awake, per second, with a minimum of a minute every time it wakes. Each size doubles the cost: X-Small is 1 credit an hour, Small 2, Medium 4.

  • The lists (databases, schemas, tables, columns, warehouses) use only SHOW and DESCRIBE, which need no warehouse, so they don't wake it. The Test does the same and asks one more question, about the secondary roles of the user (SELECT CURRENT_SECONDARY_ROLES()): it names the warehouse of the credential, because Snowflake refuses a statement with none, and Snowflake answers it without running the warehouse, so it doesn't wake it either. Snowflake bills cloud services only above 10% of the day's warehouse credits.
  • Select, Count, Insert, Update, Upsert, Delete, Run SQL, Call procedure and Run SQL in background run in the warehouse. If it sleeps, the run wakes it, and the node warns you of that.
  • Run SQL in background keeps billing until the query ends: it runs in Snowflake after the node has answered. Set its Query timeout to what the load needs, and stop it with Cancel query if it is no longer wanted.
  • Get query results, Cancel query and API request name no warehouse, so HostWebhook doesn't wake one for them.
  • Copy into table and Export query result run in the warehouse: they wake it, and it bills while they work.
  • Append rows wakes no warehouse: Snowflake bills Snowpipe Streaming by the GB of data it receives, at its own rate (see Snowflake's Service Consumption Table). A flow that sends the same rows in a loop keeps adding to it.
  • Ask Cortex wakes no warehouse by the REST API; if Snowflake doesn't let the account use it, the call goes through SQL and wakes the warehouse of the credential (when), which bills while it is awake. It spends AI credits by the tokens in and out, and stops at the daily limit of the account (500 calls a day unless HostWebhook sets another number): the prices and the most one call can cost.
  • Create table, Add columns, Truncate, Drop, the three warehouse controls, the three task operations and the lists of stages and files name no warehouse, so HostWebhook doesn't wake one for them. Run task bills with the warehouse of the task, and Resume warehouse bills until the warehouse suspends.
  • A trigger: the three events of a table wake the warehouse only when the table changed, Schema changes wakes none, and Failed task and a Query result with no table to wait for wake it on every check. What a trigger costs has the numbers.
  • An AI toolkit: every call of a tool that runs a statement can wake the warehouse, and the AI decides how often. describe_snowflake_tables wakes none, and run_snowflake_task bills with the warehouse of the task (What a call costs).
  • A warehouse that never sleeps costs 24 credits a day if it is X-Small. Keep AUTO_SUSPEND short (60 seconds is enough for HostWebhook) and give it a resource monitor.
  • The cost of Snowflake depends on your edition, cloud, region and contract: this page gives credits, not money.

When Snowflake says no

A failure says what to do, with no value of a row, no SQL and no text of Snowflake (its own messages can carry your values). The lines are HostWebhook's:

What happenedWhat you see
The key or the token is rejected (401)Snowflake didn't accept the key or the token. Check the credential and press Test.
The sign-in is rejected (401), with Sign in with SnowflakeSnowflake didn't accept the sign-in. Press Sign in again in the credential.
Your network policy doesn't allow HostWebhook's IP (403)Your Snowflake network policy blocks HostWebhook. Allow HostWebhook's IP, the one the credential shows.
The role has no privilege (403)Snowflake refused this. The role of the credential may not have the privilege.
Too many requests (429)Snowflake is rate limiting the requests. Try again in a moment.
The query passes the timeout (408)The query took longer than the timeout and was cancelled. Raise the timeout, or narrow the filters.
The answer is over 5 MiBThe answer is too large. Pick fewer columns or lower the limit.
Snowflake can't be reachedHostWebhook couldn't reach Snowflake. Check the account, e.g. myorg-myaccount.
SQLSTATE 42S02That table doesn't exist, or the role of the credential can't see it.
SQLSTATE 42501The role of the credential has no privilege for that. Grant it in Snowflake, e.g. SELECT on the table.
SQLSTATE 22018A value doesn't fit its column, e.g. text in a number. Check the values you send.
No warehouse (000606)No warehouse. Pick one in the node or in the credential, e.g. HOSTWEBHOOK_WH.
Get query results or Cancel query with an id that this flow didn't startThat query id was not started by Run SQL in background in this flow in the last 24 hours, so it cannot be read or cancelled here. Use the id that Run SQL in background gave, e.g. {{runSql.queryId}}.
Run SQL in background when the flow already keeps 1,000 ids of the last 24 hours (422)This flow already has too many Run SQL in background queries in the last 24 hours (the limit is 1,000), so nothing was started. Start fewer of them, or wait until the oldest ones are forgotten.
Run SQL in background can't write the id of the query at that momentThe id of the query could not be saved, so the query was stopped. Try again.
A statement of Run SQL, Call procedure or Run SQL in background fails when it may have started (a timeout, a 5xx)Some rows may already have been changed: check before you run it again.
An API request that changes something fails when it may have gone throughThe call may already have been made: check before you run it again.
A {{ }} inside quotes in the SQLDon't put {{ }} inside quotes, $$ or comments. Write the placeholder alone and send the whole value, e.g. WHERE name LIKE {{payload.pattern}} with pattern = %ana%, or WHERE name = CONCAT('%', {{payload.name}}, '%').
Several statements with a {{ }} or ParametersSnowflake doesn't take values (bindings) in a request of several statements. Turn off «Allow multiple statements», or write the values into the SQL yourself without {{ }} or Parameters.
An API request that needs «Allow account administration»This call changes the account or shows how it is set. Turn on «Allow account administration» in the node to send it. Without it, only reads of databases, schemas, tables, views, stages, streams, pipes, tasks, alerts, procedures, functions and warehouses are sent.
Truncate table or Drop table with «Allow emptying or dropping tables» offEmptying or dropping a table is off. Turn on «Allow emptying or dropping tables» in the node to do it, e.g. for a table you can create again.
Resume, Suspend or Resize warehouse with «Allow warehouse control» offControlling a warehouse is off. Turn on «Allow warehouse control» in the node to resume, suspend or resize one.
Export query result with a SQL that is not a queryExport query result takes a query: one statement that starts with SELECT or WITH and ends in a SELECT, e.g. SELECT * FROM SHOP.PUBLIC.ORDERS. To change data use Run SQL.
Export query result with several statementsExport query result takes one statement. Remove the ; and what follows, or put the second one in its own Run SQL.
Append rows with an access token (PAT)Append rows needs a key pair credential. Snowflake doesn't take an access token for streaming.

A 429, a 503 and a network failure are tried again by themselves, with a wait between tries. A retry carries the same request ID, so Snowflake never runs a statement twice that already finished. A 401 is never retried with the same key or token, and a 408 or a timeout isn't retried at all. Run SQL, Call procedure, Run SQL in background, Cancel query and API request are tried again only after a 429 or a 503, which come before the statement ran; after a timeout or a 5xx they aren't, and the line says that it may have gone through.

Limits

WhatHow much
Select1 to 1,000 rows (100 by default), or Return all up to the limit of your plan.
Insert and UpsertUp to 1,000 rows a run, in groups of at most 1,000 rows and no more than 16,384 values a statement.
The answer5 MiB in all, counted after it is decompressed, and at most 4,096 columns.
A value1 MiB; a JSON value of at most 64 levels.
ListsUp to 10,000 names (what SHOW gives). The answer says when there may be more.
Timeout30 seconds by default, from 1 to 3,600 per node.
Run SQL and Call procedureA SQL of up to 1 MB, one statement unless you turn on Allow multiple statements. A procedure takes up to 100 arguments. Rows: 1 to 1,000 (100 by default), or Return all up to the limit of your plan.
Run SQL in backgroundQuery timeout from 1 to 1,440 minutes (60 by default). Up to 1,000 query ids kept for each flow, for 24 hours; with all of them kept, it starts nothing until the oldest are a day old.
API requestA path of up to 2,048 characters, a body of up to 1 MB and 64 levels, an answer of up to 5 MiB.
Ask CortexA prompt of up to 32,768 characters. Max tokens from 1 to 8,192 (1,024 by default). Temperature from 0 to 1. 500 calls a day for the account unless HostWebhook sets another number (up to 5,000); a call that fails counts. Timeout 30 seconds by default.
Create table and Add columnsUp to 200 columns, and the types of the list above.
Lists of tasks and stagesUp to 10,000 entries (what SHOW gives). The answer says when there may be more.
StagesA path of up to 500 characters, a file name or a pattern of up to 255, up to 1,000 files in a Copy into table, and Skip header from 0 to 10.
Export query resultA CSV of up to 5 MiB, counted in UTF-8, with no row cut in the middle, and a file name of up to 100 characters.
The trigger: whenChecks every 300 seconds (5 minutes) by default and 900 (15 minutes) for Failed task, down to 60 seconds on a paid plan (900 on Free) and up to 86,400 (a day). A delay from 0 to 3,600 seconds (60 by default).
The trigger: how much100 rows for each check by default, up to 500; 0 to 500 rows sent on the first activation; up to 10 filters and 10 key columns; Test push shows up to 10 rows; an event that doesn't fit in 16 MiB is skipped.
AI toolkit: rowsUp to 200 rows for each read and 100 for each insert or upsert; the SQL tools give back up to 200 rows. A SQL of up to 20,000 characters. What goes back to the model is cut to 100,000 characters and to the cap of the node (20,000 by default, 1,000 to 200,000).
AI toolkit: listsUp to 100 tables, 100 procedures and 100 tasks, and 200 columns. describe_snowflake_tables describes up to 25 tables a call.
The trigger: pauses5 failed checks in a row, or 3 checks that start and never finish. Row changes cuts a stretch of time in half up to 8 times when more rows than the limit changed in it.

Gotchas

  • Names keep their case. A name written without quotes is stored in upper case; a name created in quotes keeps its case. HostWebhook uses the names exactly as Snowflake lists them.
  • Snowflake doesn't enforce primary or unique keys on ordinary tables: two rows can share one. Upsert refuses repeated keys, but it can't know what is already in the table.
  • A row you insert may have values you don't see: generated ids and defaults aren't returned. Read it back with Select if you need them.
  • The role decides what is listed: a database or table the role can't see isn't in the lists, and the node says “That table doesn't exist, or the role of the credential can't see it.”
  • The role is the limit: whatever it can do, a flow can do. Give the credential only the role in The Snowflake user and role.
  • Run SQL, Call procedure and API request are not read only. HostWebhook doesn't judge what the SQL, the procedure or the call does: the role of the credential decides. Try a new one on a copy, and give the role only what the flow needs.
  • A value that the event doesn't bring is NULL in a SQL with {{ }}, not an empty text: WHERE ID = NULL matches nothing, so check _unresolvedPlaceholders in the answer when a SQL returns no rows.
  • Truncate and Drop touch the whole table, with no filter and no brake, and Suspend and Resize change a warehouse for everyone who uses it. That is why each one has a switch that is off: turn it on only in the flow that needs it.
  • An export is text, and the formulas are protected in it. With Protect formulas on, a text that starts with =, +, - or @ shows a quote in front, so what you read in the CSV is not always the value in the table.
  • A query id is only good for 24 hours and only in its own flow. Read or stop a background query in the same flow that started it, and keep reading it in the same day.
  • A cursor that is a whole number can miss a row. ORDER hands ids out in order, not in the order they are committed, and a number has no delay. Use a timestamp like CREATED_AT when you can (The cursor).
  • A TIMESTAMP_NTZ cursor is read as UTC. If your app writes local time into it, the delay is longer east of UTC and there is none west of it.
  • Only Row changes sees a deletion, and it needs change tracking on the table. Snowflake only keeps the changes for the retention time of the table, so a trigger that was off for longer than that has lost some.
  • A trigger on a bulk load needs a tie-break. A COPY INTO gives every row the same timestamp: with more rows than Rows per check and no one-column primary key, the trigger pauses instead of going quiet.
  • Run SQL, Call procedure, Copy into table, Run task and Append rows aren't ignored by the trigger. Only Insert, Update and Upsert rows leave a fingerprint, so a flow that changes its own table with the others can start itself. Use filters that the rows the flow writes don't match, e.g. STATUS = new while the flow sets STATUS to done.
  • The trigger reads in the warehouse of the credential. It has none of its own, so pick one in the credential.
  • query_snowflake is not read only. Snowflake has no read-only session. It is classed as destructive, reads any table the role can read (your list of tables doesn't cover it), and starts blocked.
  • Unlocking execute_snowflake_sql unlocks writing and deleting in every table the role can write, even if delete_snowflake_rows stays blocked. Its WHERE rule for UPDATE and DELETE is a seat belt (WHERE 1=1 passes), and MERGE … ON 1=1 WHEN MATCHED THEN DELETE deletes every row.
  • A name in a list of the AI is compared as it is written. shop.public.orders doesn't match SHOP.PUBLIC.ORDERS, and a name with a dot, a quote or a space can't be listed.
  • Limiting the columns turns off both tools of SQL. They can name any column, so they can't keep to the list.

What isn't here yet

  • Reading each statement of a background request of several statements: only the id of the whole request is kept.
  • Creating a database, a schema, a stage or a task with a form (the API request can, with its switch).
  • The AI toolkit through an MCP server or the Claude connector, with the read, write and destructive classes of its tools: today the tools are for an AI Node.
  • A push from Snowflake, a call to HostWebhook the moment a table changes: the trigger checks on a timer.
  • Private-link addresses and a tunnel.
  • Cortex as the model of an AI Node, and separate forms for Classify and Extract (Ask Cortex covers them with a good prompt).

Snowflake is a trademark or registered trademark of Snowflake Inc. in the United States and other countries. HostWebhook is not affiliated with, sponsored or endorsed by Snowflake Inc.