HostWebhook Help Center

Connect Snowflake to your flows

Connect your Snowflake account, read, count, add, change, upsert and delete rows without writing SQL, list your databases, schemas, tables and warehouses, run your own SQL, call procedures, start long queries, call the REST API, create and change tables, control warehouses and tasks, load files from a stage and export a result as CSV, add rows without a warehouse through Snowpipe Streaming, start a flow from new or changed rows, a query result, schema changes or a failed task, let an AI node use your tables with its tools blocked by default, and know what each thing costs. Sign in with your own Snowflake user, in a window, or with a key or a token.

Time about 35 minutesYou need a HostWebhook account and a Snowflake accountUpdated November 26, 2026

Connect your Snowflake account once, and your flows can read, count, add, change, upsert and delete rows, and list your databases, schemas, tables, columns and warehouses. They can also run your own SQL, call procedures, start long queries and read them later, call the REST API, create and change tables, control warehouses and tasks, load files from a stage and export a result as CSV. 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. An AI node can use the node as 11 tools, three that read and eight that start blocked. HostWebhook signs in with a key it creates and never shows, with an access token you paste, or with Sign in with Snowflake, where you sign in to your own Snowflake in a window. A Snowflake warehouse bills while it is awake, so this guide 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 flow needs (see the box in step 01).

Connect your account

In HostWebhook, click Settings in the left sidebar, then Credentials, and start a new credential. Choose Snowflake and give it a name.

Fill in:

FieldWhat to write
AccountYour account identifier or URL, like myorg-myaccount or https://myorg-myaccount.snowflakecomputing.com. HostWebhook builds the address from it. A locator like xy12345.us-east-2.aws works too
AuthenticationKey pair (the default): HostWebhook creates the key and never shows it. Access token: a token you create in Snowflake. Sign in with Snowflake: you sign in to Snowflake yourself, in a window, with no key or token to copy
UserThe login name HostWebhook signs in as, like HOSTWEBHOOK_SVC. Best a service user just for this. With Sign in with Snowflake it is a person (TYPE = PERSON), because the sign-in is made in a browser: a service user can't
RoleRequired. The role HostWebhook uses, like HOSTWEBHOOK_ROLE. Never ACCOUNTADMIN: without a role Snowflake would use the user's default one. With Sign in with Snowflake an administrator role is refused
WarehouseOptional, but required with Sign in with Snowflake. Runs the queries and bills while awake, like HOSTWEBHOOK_WH. X-Small is enough
Database and SchemaOptional. Where the lists start, like SHOP and PUBLIC

There is no password: Snowflake no longer accepts one for a service user. HostWebhook only connects to the public address of your account, https://<account>.snowflakecomputing.com.

Prepare Snowflake: a user, a role and a small warehouse

Run this once in a Snowflake worksheet, as administrators (only ACCOUNTADMIN creates a resource monitor). Change the names to yours:

SQL
CREATE WAREHOUSE HOSTWEBHOOK_WH
WAREHOUSE_SIZE = XSMALL AUTO_SUSPEND = 60 AUTO_RESUME = TRUE INITIALLY_SUSPENDED = TRUE;
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;
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;
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;
ALTER USER HOSTWEBHOOK_SVC SET DEFAULT_SECONDARY_ROLES = ();

The warehouse is X-Small and goes to sleep a minute after its last query. Add DELETE on the table only if a flow deletes. 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, like HOSTWEBHOOK_WH. instead of waking another. Never give the role ACCOUNTADMIN, SECURITYADMIN, SYSADMIN, OWNERSHIP of your data or MANAGE GRANTS.

The last line sets no secondary roles, on purpose. A user can have other roles of its own active next to the one HostWebhook signs in with (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 in the credential is small. 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.

  1. Marker 1: Sign in with: Key pair (recommended) or Access token. Above it, Account takes your account identifier, like myorg-myaccount.
  2. Marker 2: User and Role: the service user and the role HostWebhook signs in as. With Sign in with Snowflake the user is a person, not a service user. Never ACCOUNTADMIN.
  3. Marker 3: Warehouse (optional): the one that runs the queries. X-Small is enough.
  4. Marker 4: Allow this IP in a Snowflake network rule: HostWebhook's IP, 18.225.52.125, with a button that copies it. Skip it if neither your account nor the user has a network policy. Below it, Save Snowflake connection saves the credential and, with a key pair, creates the key.
The New Credential form for Snowflake with Key pair, the user and the role, the warehouse and the notice that shows HostWebhook's IP to allow in a network rule

With a key pair. Click Save Snowflake connection. The credential shows a line to run in a Snowflake worksheet. It holds only the public half of the key, and no secret:

SQL
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 only gives out a sign-in token that lasts less than an hour. The line limits the key to your role. The key has a name of its own, HOSTWEBHOOK_ and 8 hex digits that come from the key, like HOSTWEBHOOK_1A2B3C4D, so two credentials on the same Snowflake user never meet the same name. A credential made before this keeps its first key under the name it has, HOSTWEBHOOK or HOSTWEBHOOK_NEXT, until its first rotation. To rotate it, click Generate new key: it makes a second key next to the first. Run its line in Snowflake and click Test connection. When the Test passes with the new key, the old one is removed here, and the panel shows the line that removes it in Snowflake.

  1. Marker 1: The line to run in a Snowflake worksheet. It holds only the public key, blurred here, and no secret.
  2. Marker 2: Copy copies the line.
  3. Marker 3: Generate new key starts a rotation.
  4. Marker 4: Keys and settings: Edit keys and settings is for a new token, or when the account, the user or the role changes (the last step). Nobody can see the keys of a Snowflake credential, so a key left empty there keeps the one it has.
The saved credential with the ALTER USER line to run in Snowflake, Copy, Generate new key and the Keys and settings card
  1. Marker 1: The line from the credential, pasted into a worksheet. Here it is an example line.
  2. Marker 2: Run it with the run button, or Ctrl+Enter.
  3. Marker 3: Run it as a role that can change the user, like an administrator. That role is yours: HostWebhook uses the one in the line.
A Snowsight worksheet with the ALTER USER ADD KEY PAIR line pasted, ready to run

With an access token. Create it in Snowflake and paste it once, because Snowflake shows its value only when it is created:

SQL
ALTER USER HOSTWEBHOOK_SVC ADD PROGRAMMATIC ACCESS TOKEN HOSTWEBHOOK
ROLE_RESTRICTION = 'HOSTWEBHOOK_ROLE' DAYS_TO_EXPIRY = 90;

A token expires (after 15 days unless you say otherwise, and up to 365), and Snowflake asks a service user for a network policy to create and use one (next paragraph). The token is encrypted and never comes back to the panel.

  1. Marker 1: Sign in with: Access token.
  2. Marker 2: Access token: paste the value Snowflake showed once. It is encrypted and never comes back to the panel.
  3. Marker 3: A token needs a network policy on the user. Allow this IP in a Snowflake network rule shows HostWebhook's IP, 18.225.52.125, with a button that copies it.
The New Credential form with Access token selected, the field for the token and the notice that shows HostWebhook's IP to allow in a network rule

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

SQL
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;

With Sign in with Snowflake. You sign in to your own Snowflake, in a window, with your own user (a person, TYPE = PERSON): there is no key and no token to copy, and HostWebhook never sees your password. You run one SQL once and paste the two values it shows. The sign-in lasts up to 90 days, then you sign in again.

  1. Give the role to the user who will sign in. Make the role from the box above and run GRANT ROLE HOSTWEBHOOK_ROLE TO USER ANA; with the name of your user. The user has to be able to sign in in a browser, so a person and not a service user. The role can never be an administrator one, and it has to be a plain name: letters, numbers, _ and $.
  2. Create 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, like ACCOUNTADMIN, only for this. It holds no secret:
SQL
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 instead of typing it, because Snowflake compares it exactly. What each line is for:

  • OAUTH_CLIENT_TYPE = 'CONFIDENTIAL': HostWebhook is a server, and it 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.
  • It never names a role, never lets a client skip your consent (PRE_AUTHORIZED_ROLES_LIST) and never uses CREATE OR REPLACE: if the integration already exists, running it again fails instead of replacing the one in use.
  1. Copy the two values. Run this and copy the OAUTH_CLIENT_ID and the OAUTH_CLIENT_SECRET it shows:
SQL
SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('HOSTWEBHOOK_OAUTH');
  1. Fill in the credential. 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.
  2. Sign in. On the page of the credential, click 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 click Test connection.

The Warehouse is required, and administrator roles are blocked.

HostWebhook checks which role your session got with one SELECT CURRENT_ROLE(), and Snowflake refuses a statement that names no warehouse. The statement reads no table, so it isn't meant to start a suspended warehouse. ACCOUNTADMIN, SECURITYADMIN, SYSADMIN, ORGADMIN and GLOBALORGADMIN are refused when you save the credential and when you sign in, and the role is checked again on every connection: if Snowflake gives the session another role, HostWebhook doesn't use it 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 (the IP above).

Not supported yet.

Private-link addresses, the China region (snowflakecomputing.cn) and a tunnel. HostWebhook connects to the public address of your account.

Test the connection

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

It also warns you if:

  • the role is an administrator role, like ACCOUNTADMIN, SECURITYADMIN or SYSADMIN, which is far more than a flow needs;
  • the warehouse is bigger than X-Small, never goes to sleep, or can't wake by itself;
  • the warehouse has no resource monitor, which is what caps what it can spend;
  • the user is a person and not a service user;
  • the user asks for secondary roles (DEFAULT_SECONDARY_ROLES) but has no other role yet, or the Test couldn't check them (the credential has no warehouse, for one): the warning says what to run.

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 in Snowflake, as an administrator: ALTER USER <user> SET DEFAULT_SECONDARY_ROLES = (); (with the name of your user). Then click Test connection again.

  1. Marker 1: Test connection: a few fixed questions that wake no warehouse.
  2. Marker 2: The answer: the account and the user (blurred here), the role, and the warehouse with its size and its auto suspend.
  3. Marker 3: A warning: here, the role sees no resource monitor on the warehouse.
Test connection on the credential: connected, with the role and the warehouse, and a warning about the resource monitor

With a key pair, if Snowflake doesn't have the public key yet, the Test says so: run the line from step 01 and click Test connection again. With Sign in with Snowflake, click Sign in with Snowflake on the credential first. The Test also asks which role the session got, and says Snowflake no longer accepts this sign-in. Press Sign in with Snowflake again. when that sign-in is over.

Read rows

Add a Snowflake node, pick the credential, choose Single operation and an operation:

OperationWhat it does
Select rowsThe rows of a table or view that match the filters, in the order you pick
Count rowsHow many rows match the filters
Insert rowsAdds one or more rows, up to 1,000 a run, and gives back what you sent
Update rowsChanges the columns you pick in every row that matches the filters
Upsert rowsAdds rows, or changes the ones that already have the same key
Delete rowsDeletes every row that matches the filters
List databases, List schemas, List tables and views, Describe table, List warehousesWhat your account has (step 05)
Run SQL, Call procedureYour own SQL, and the procedures of your account (step 06)
Run SQL in background, Get query results, Cancel queryA long query that you start, read later and can stop (step 07)
API requestA call to the REST API of Snowflake (step 08)
Create table, Add columns, Truncate table, Drop tableThe tables of a schema (step 09)
Resume warehouse, Suspend warehouse, Resize warehouse, List tasks, Run task, Suspend or resume taskWarehouses and tasks (step 10)
List stages, List stage files, Copy into table, Export query resultFiles in a stage, and a result as CSV (step 11)

Select rows is the one to start with. Pick the Database, the Schema and the Table from the lists HostWebhook reads from your account: 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 (step 04), which are off by default. Columns (optional) are the ones you want back, and empty means all.

Filters are a list, not SQL: =, !=, >, >=, <, <=, LIKE, IN, IS NULL and IS NOT NULL, and a row has to match all of them. Each value is sent as a parameter, never inside the text of the SQL. A filter on empty values uses IS NULL: a filter with no value would match nothing.

  1. Marker 1: Database, Schema and Table, picked from the lists HostWebhook reads from your account.
  2. Marker 2: Columns (optional): the ones you want back. Empty means all.
  3. Marker 3: Filters (optional): here, STATUS is paid.
  4. Marker 4: The output: rows, with AMOUNT as text so that no digit changes.
Select rows on the ZZ_ORDERS table with the columns, a filter on STATUS and the output with the rows found

A read gives back up to 1,000 rows, 100 by default. Return all reads every row up to the limit of your plan, and the answer says truncated if there were more: nothing is cut in silence.

Numbers that could lose digits come back as text, so they never change on the way: a number above 253 and every decimal, like "total": "120.50". Dates and timestamps come as ISO text in UTC, VARIANT, OBJECT and ARRAY as JSON, and binary as hexadecimal text.

Change rows

Insert rows and Upsert rows take Rows: one JSON object per row, like {"ID": 1, "STATUS": "new"}, up to 1,000 a run, all with the same columns. A {{ }} fills one value. Rows go in groups of up to 1,000, and each group is sent once: a failure never writes a group twice. Snowflake doesn't give back the values it generates (ids, defaults), so the answer has the rows you sent.

  1. Marker 1: The Table the rows go into.
  2. Marker 2: Rows: one JSON object per row. Each {{ }}, shown as a chip (Id, Status, Amount), fills one value.
  3. Marker 3: Rows: take a whole list or object from the event is Off, so only the columns written here are written.
  4. Marker 4: Warehouse: a sleeping one wakes and bills at least a minute.
Insert rows into ZZ_ORDERS_COPY with one row of three {{ }} values and the whole-value switch off

Upsert rows needs Key columns, like ID, and can limit Columns to update. Snowflake doesn't enforce keys, so two rows with the same key would stop the upsert: HostWebhook refuses them before it sends anything.

Update rows takes Set, like {"STATUS": "shipped"}, and Delete rows needs only filters. Both need at least one filter, so they never touch the whole table by accident.

Insert, Update, Upsert and Delete change your account.

Run really adds, changes or deletes the rows, and Snowflake has no recycle bin: only Time Travel brings rows back. Try the same filters with Select rows first to see which rows they match.

The brake. Update and Delete count first. If more rows match than the Limit (1,000 unless you change it), 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 change repeats the count in the same statement, so rows that arrive in between can't make it go past the limit. You can turn the brake off with Stop if more than.

  1. Marker 1: Set: the column and its new value.
  2. Marker 2: Filters: Update and Delete need at least one.
  3. Marker 3: Stop if more than and its Limit: if more rows match, nothing is changed.
Update rows with Set STATUS to shipped, a filter on STATUS and the brake on with a limit of 1,000

Letting the event bring a whole list. Under Rows, Set and Filters there is an Off switch, like Rows whole value. By default, each {{ }} fills one value, and what the flow can write is only what you typed. Turned On, whoever calls the flow's URL brings the whole list or object, and for Insert, Upsert, Update and Delete that means they decide which columns are written and which rows change: the panel marks those switches in red.

See what is in your account

The list operations answer from SHOW and DESCRIBE, which need no warehouse, so they don't wake it. Snowflake bills cloud services only above 10% of the day's warehouse credits.

  • List databases and List schemas give their names.
  • List tables and views gives each table or view with its rows, bytes and whether change tracking is on.
  • Describe table gives the columns with their types.
  • List warehouses gives each warehouse with its state, size and auto suspend.

They only show what the role can see. A list gives up to 10,000 names, and says when there may be more.

  1. Marker 1: List tables and views. It wakes no warehouse.
  2. Marker 2: Database and Schema.
  3. Marker 3: The output: each table with its rows, its bytes and whether change tracking is on.
List tables and views on the ZZ schema with the output listing each table with its rows and bytes

Run your own SQL and call procedures

Choose Run SQL when the forms of rows don't say what you need, like a join or a total.

Run SQL does 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. Give it only what the flow needs, and try a new SQL on a copy first.

Write one statement. A {{ }} where a value goes 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:

SQL
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, so 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 it alone and send the whole value: WHERE NAME LIKE {{payload.pattern}} with pattern set to %ana%.
  • 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), and it is one statement. Without a {{ }} you can write all of them.
  • What the event doesn't have is sent as NULL. The answer says which, in _unresolvedPlaceholders and _note. A comparison with NULL matches no row, so the query usually returns nothing.
  1. Marker 1: SQL: one statement. {{payload.status}} and {{payload.minimum}} show as chips and reach Snowflake as values.
  2. Marker 2: Return rows is On, for a SELECT.
  3. Marker 3: Allow multiple statements is Off: one statement.
  4. Marker 4: The input of this test: status is paid and minimum is 20, written under Run Test, Advanced.
  5. Marker 5: The output: rows, count, truncated and the queryId.
Run SQL with two {{ }} values, Return rows on, Allow multiple statements off, a custom input and the output

Your own ?. If you write ? in the SQL, leave the {{ }} out and fill Parameters with one value for each ?, like ["paid", 100]. The node refuses to mix the two, and refuses a list with the wrong count. A {{ }} in Parameters goes between quotes, like ["{{payload.status}}", 100]: the event fills the values and can't add one.

Several statements. Allow multiple statements is Off. Turn it On to send several statements in one run, like a transaction. Snowflake takes no values with several statements, so the SQL then takes no {{ }} and no Parameters: write the values into the SQL yourself.

What comes back. Return rows is On: you get rows, count and truncated, up to the Limit (1 to 1,000, 100 by default) or every row up to the limit of your plan with Return all. Turn it Off for a statement that only changes data: the answer has changed (inserted, updated or deleted, the ones Snowflake gives) or done. Every answer has the queryId Snowflake gave. With several statements, queryIds lists the ones of each statement.

Call procedure. Pick the Database and the Schema, then pick the Procedure from the list of that schema. Picking it fills its Signature, the type of each argument in order, like ["VARCHAR", "NUMBER(38,0)"], and two procedures with the same name are told apart by it. If the list doesn't load, type the name and the signature as Snowflake has them. Then give the Arguments: one value for each, like ["{{payload.id}}", 3].

HostWebhook writes the call itself, with every value as a value and never as text. The database, the schema, the procedure and its signature are never filled by the event: a {{ }} in them is refused. An argument of a type a form can't send, like a geography or a vector, is refused: use Run SQL for it. The answer has rows, count, truncated, result (the first value of the first row) and queryId.

The procedure decides what it changes.

It runs with the privileges of its owner or of the role of the credential, and the node can't tell what is inside it.

Both run in the warehouse, so a sleeping one wakes and bills at least a minute. The timeout is 30 seconds by default, from 1 to 3,600: when it passes, HostWebhook cancels the query.

Start a long query and read it later

A long load shouldn't hold the flow. Run SQL in background starts the statement and answers at once with its queryId and its state, and the query keeps running in Snowflake. It takes the same SQL, {{ }}, Parameters and Allow multiple statements as Run SQL.

Query timeout is the number of minutes after which Snowflake stops the query, from 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.

Set the query timeout to what the load needs, and stop the query with Cancel query if you no longer want it.

  • Get query results takes the id, like {{runSql.queryId}} (runSql is the name of the node that started it). It says the state, running or done. It doesn't wait: if the query is still running there are no rows, and you read it again later. When it is done you get rows, count and truncated, with Limit or Return all as in Run SQL.
  • Cancel query takes the same id, 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 and not the rows, up to 1,000 for each flow. Any other id is refused before the credential is asked for and without calling Snowflake: one typed by hand, one from another flow, one from Run SQL, or one older than a day.

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, before it asks Snowflake for anything: 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, so nothing is left running that nobody can reach.

With several 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.

Call the REST API

API request is a free call to the REST API of Snowflake, /api/v2/…, with the credential put on it. Pick the Method, write the Path, like /api/v2/databases/SHOP/schemas, and fill Query and Body when the call takes them, like a Query of {"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 holds names as they are: no ?, #, .. or //.
  • 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, step 18, covers it) and Spark Connect.
  • Allow account administration is Off. Then 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 it On: every write, every call with an action, and the reads that show how the account is set up, like users, roles, grants and policies.
  • Query takes only like, startsWith, fromName, pattern, prefix, showLimit, history, withLineage, rootOnly and recursive. With the switch On, it also takes createMode, ifExists and copyGrants. createMode can be errorIfExists, ifNotExists or orReplace, and orReplace replaces, and so drops, what was there.
  • Body is a JSON object, up to 1 MB. GET and DELETE take none: use Query. A {{ }} can only go in comment, the free text of the calls that create or change an object, and between quotes, like {"comment": "{{payload.note}}"}. The fields that hold SQL or code, like definition or condition of a task, are written by you, without {{ }}.

You get status and body, as Snowflake gave them. The call names no warehouse, so it wakes none. A call that changes something isn't repeated once it may have gone through.

  1. Marker 1: Method and Path: GET /api/v2/databases/…/schemas. No {{ }} here.
  2. Marker 2: Allow account administration is Off: only reads of the catalog.
  3. Marker 3: The output: status 200 and the body that Snowflake gave.
API request with GET and the path of the schemas of a database, Allow account administration off and the output

With Allow account administration On, the node can do what the role can through the REST API.

It can create, replace and drop objects, users and roles. Only you turn it On: the event can't, and a value that comes from somewhere else, like the text true, leaves it Off. The panel says what it lets the node do, and marks it in red.

Create and change tables

These change or delete things in your account, with the role of the credential.

HostWebhook asks for a switch before it empties a table or drops one, but it can't tell whether the change is a good idea. The role is the limit.

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

Columns
[
{"name": "ID", "type": "NUMBER(38,0)", "nullable": false},
{"name": "STATUS", "type": "VARCHAR"}
]
  • The type is one a form can write: numbers (NUMBER, INT, FLOAT…), text (VARCHAR, STRING…), BINARY, BOOLEAN, dates and times (DATE, TIME, TIMESTAMP…), VARIANT, OBJECT and ARRAY, with numbers inside the ranges of Snowflake, like VARCHAR(100). Anything else, like a geography or a vector, is for Run SQL.
  • The definition is yours. A {{ }} anywhere in the columns is refused, so the data of an event can't choose what a table holds. You can list up to 200 columns, none twice.
  • Only if it doesn't exist is On: if the table is there, nothing happens. HostWebhook never replaces a table.
  • Change tracking is Off. Turn it On to make Snowflake keep the changes of the table, which uses a little storage.
  • The node names no warehouse for it. The answer has done, table and columns.

Add columns takes the table and a list like [{"name": "NOTES", "type": "VARCHAR"}]. The new columns start empty, 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 deletes every row and keeps the table. Drop table deletes the 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.

  1. Marker 1: Truncate table, with its warning: Snowflake has no recycle bin.
  2. Marker 2: The Table.
  3. Marker 3: Allow emptying or dropping tables is Off: the node refuses until you turn it On.
Truncate table on ZZ_ORDERS_COPY with Allow emptying or dropping tables off

They touch the whole table.

There is no filter and no brake. Snowflake has no recycle bin for rows: only Time Travel brings them back. A dropped table only comes back with UNDROP, and only inside its retention time. Turn the switch On only in the flow that needs it.

Both name no warehouse. The answer has done, table and emptied or dropped.

Control warehouses and tasks

Resume warehouse, Suspend warehouse and Resize warehouse 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. These steps run on no warehouse of their own.
  • Resume turns it on. 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 from X-Small to 6X-Large. It changes the size for everything that uses the warehouse, and each size up doubles the credits an hour.
  • The node never creates or drops a warehouse. The answer has done, warehouse and resumed, suspended or size.

A task is a job that Snowflake runs on a schedule. Choose its Database and Schema, then pick the Task from the list of that schema, with its state and schedule next to it, or type it if the list doesn't load. The event never chooses them.

  • List tasks gives the tasks of a schema with their state and schedule, up to 10,000. It never gives the code of a task, so definition, condition and config are not in the answer. The next node runs 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 three task operations name no warehouse.

Load files and export results

A stage is a place in Snowflake where files wait to be loaded or are left to be read.

  • List stages gives the stages of a schema, internal and external, each with what Snowflake says of it. The next node runs once per stage.
  • List stage files gives the files of a Stage, picked from the list of the schema (or typed if the list doesn't load), with their size and date, and count and truncated. Path is a folder or a prefix inside the stage, and Pattern is a regular expression for the whole file path, like .*orders.*[.]csv.

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 pattern or a file name has no quotes, no $$, no $ at the end and no control characters, 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: pick it from the list of that schema, or type it if the list doesn't load.

  • Which files: all of them under the Path, or the Files you list (one per line, up to 1,000), or a Pattern. Files and pattern are exclusive.
  • Format is CSV (the default), JSON or Parquet. Skip header, from 0 to 10, is for CSV only. Match by column name is for JSON and Parquet only.
  • On error is Abort (the default, it stops the load), Continue (it loads the good rows) or Skip file (it 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, so 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, then loaded (the rows loaded) and failed (the files that did not load), and a message when there was nothing to load. With Continue or Skip file, some rows or files may not load: 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 is exactly Select rows: Database, Schema, Table, Columns, Filters, Order and Limit.
  • SQL is one query that you write, read as Run SQL reads it (step 06): {{ }} as values, or Parameters. 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 and a call are refused: use Run SQL for those.

The File name has letters, numbers and _ - ., and ends in .csv. It is export.csv if you leave it empty. The CSV follows RFC 4180, with the names of the columns as its first line, and it is at most 5 MiB: the rows stop at the last one that fits, nothing is cut inside a row, and truncated says so. The answer has csv, fileName, rows, bytes and truncated. It runs in the warehouse.

Protect formulas is On. A spreadsheet runs a cell that starts with =, +, - or @ 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. Only a real Off turns it Off: a missing value or a text keeps it On, and the event can't turn it Off.

Add rows without a warehouse

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 fields are those of Insert rows (step 04): 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.
  • It needs a key pair credential (step 01). With an access token the node stops before sending anything: Append rows needs a key pair credential. Snowflake doesn't take an access token for streaming.
  • The role needs INSERT on the table and USAGE on its database and schema, as for Insert rows.
  • Sent is not yet 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, requestIds, retried and a note that says so.

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. That is also why the node never runs a failed Append rows again by itself. If a duplicate matters, give each row an id of its own, like {{payload.id}}, and remove the copies when you read the table.

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

SQL
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.

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 (step 13) fires on them. Watch another table, or use filters that the appended rows don't match.

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

Start a flow from Snowflake

Snowflake can also start a flow. Add a Trigger node, choose Snowflake as its service, pick your credential and an Event. The trigger 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 USAGE on the database and the schema, SELECT on the table and USAGE on the warehouse of the credential (a trigger has no warehouse of its own). 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 each one costs is at the end of this step.

The events. Pick one:

EventIt fires onWakes the warehouse
New rowsA row with a timestamp or a number above the last one seenOnly when the table changed
New or updated rowsA row that is new, or whose update column moved past the last one seen. Each version is sent onceOnly when the table changed
Row changesA row that change tracking says was added, changed or deleted. A deleted row comes as it wasOnly when the table changed
Query resultRuns your SELECT on each check, and fires on new rows in the result or when its first column passes a numberOn every check, unless you name a table to wait for
Schema changesA table, a view or a column (or a schema or a database) that appeared or went away since the last checkNever: it only uses SHOW
Failed taskA run of a task of a schema that failed, with its errorOn every check
User changesA user of the account that was created, disabled or droppedOn every check. Snowflake shows it about 2 hours late
Role grantsA role of your list that was given or taken away, to a user or to another roleOn every check. About 2 hours late
Warehouse changesA warehouse that was created, dropped, resized, or whose auto-suspend or resource monitor changedNever: it only uses SHOW
Credit usageA day on which the credits used pass the limit you setOnce a day. About 3 hours late

The last four are the account events: they watch your account, not a table. They are explained under Account events, below.

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. Turn it on first, as the table's owner: ALTER TABLE ORDERS SET CHANGE_TRACKING = TRUE. Change tracking uses a little storage, and 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.

  1. Marker 1: Event: Row changes, the only one that sees a deleted row.
  2. Marker 2: The Table, and the line that says change tracking is on and how long the table keeps its changes.
  3. Marker 3: Only new rows (Append only) is Off: added, changed and deleted rows.
A Snowflake trigger with the Row changes event on ZZ_ORDERS, change tracking on and Only new rows off

The fields. The Database, Schema and Table are picked from your account, and 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, like CREATED_AT. The next section 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. The cursor column is optional, the one set when the row is created: a row touched within 2 seconds of its creation is sent as row.created, 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, like ID, so each version of it is sent once.
  • Append only (Row changes): On, only added rows, for a table that is never updated, which is cheaper for Snowflake to read. Off, added, changed and deleted rows. The old version of a changed row is not an event.
  • Filters (optional, up to 10): only rows that match all of them, like in Select rows.
  • 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.
  • 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 on a paid plan and 900 on Free.

Only rows that arrive after you activate the trigger fire the flow, besides the ones you ask for in Rows to send on first activation. A trigger with a whole-number cursor starts at the biggest value of the table, so activating it reads the table and wakes the warehouse once.

The cursor. New rows and New or updated rows read in order of 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. These 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.

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 it NOT NULL. 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. The update column of New or updated rows has to be a timestamp: "New or updated rows" needs a timestamp that moves on every change, usually UPDATED_AT.

A whole-number cursor can miss a row. Use a timestamp when you can.

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, and 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 use 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. A number that jumps far ahead, maybe from a row with a huge id, pauses the trigger.

The delay, and rows that share a cursor. Delay (the three events of a table) is how long a row has to be in the table before the trigger reads it, by the clock of Snowflake, not ours: 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. The trigger goes on from the last value it sent, and remembers which rows at that value it already sent, so a row at the mark is neither sent twice nor skipped. A bulk load (INSERT … SELECT, COPY INTO) gives every row the same CURRENT_TIMESTAMP: if more rows than Rows per check share one, the trigger 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 none, the trigger pauses and says so, instead of going quiet. Row changes handles a burst its own way: 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.

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 the three events of a table first asks Snowflake for the commit token of the table:

  • If the token moved, something was committed: the warehouse wakes, the rows are read and sent.
  • If it is the same, nothing was committed: nothing is read and the warehouse stays asleep. A table that doesn't change costs no credits to watch.
  • After a change, the trigger reads once more after the delay (plus 30 seconds) has passed, so a row that was still inside the delay doesn't wait for another write.
  • If the token can't be read, it reads the rows: an unreadable token never says that nothing changed.

Query result. Write a Query: one statement that starts with SELECT, or with WITH and ends in a SELECT, like 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 (with Key columns, up to 10, that identify a row of the result), or the first column above or below a Threshold, like N > 10. With Re-arm On, it fires once until the condition clears, like one alert for each outage. Check only when this table changes names a table, like ORDERS, and skips the check while that table is unchanged, so the warehouse stays asleep. The query takes no {{ }}, because a timer repeats it, and it 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. 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.

Schema changes and Failed task. Schema changes watches some of tables, views, columns, schemas and databases (Watch, tables and columns by default) in a Database and, if you want only one, a Schema. It uses only SHOW, so it wakes no warehouse. Failed task reads the task history of a Database and Schema, which needs the warehouse awake on every check, so it checks every 15 minutes unless you say otherwise.

Account events. User changes, Role grants, Warehouse changes and Credit usage are in the group Account events of the event list. They have no database, schema, table or cursor: they read who is in your 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 GLOBALORGADMIN1 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 monitor15 minutesWithin the interval
Credit usageCredits in a day, above which it fires, more than 0, up to 1,000,000. Optional: one Warehouse, the whole account if empty1 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:

SQL
-- 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 shows up in 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.

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). The detected_at of all of them is the moment of the check that saw it. 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.

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
  • 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.

What it costs. User changes and Role grants wake the warehouse on every check, and a check is never more often than once an hour, which with the numbers of the table at the end of this step is about 0.4 credits a day (24 wakes) on an X-Small warehouse. Credit usage wakes it once a day, and Warehouse changes never.

Ignore changes made by this flow. On by default for the three events of a table. Rows that this flow writes with Insert rows, Update rows 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: a fingerprint of the columns it wrote (a hash, not the values), and the trigger skips a row that is exactly that. An edit by someone else a moment later does fire. Rows added with Append rows aren't covered (step 12).

  • 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.
  • A doubt is a send. If a row doesn't match, 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, even one this flow deleted. Only the same connection counts: the credential, the account, the user and the role.

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, like to load them together. A check that finds nothing sends nothing, either way. A batch goes out all or nothing, and the mark moves only with what was really handled.

Try it. Test push shows what the trigger would pick up now, as it will arrive, up to 10 rows: the latest rows for the cursor events, the changes of the last hour for Row changes. Nothing is sent to the flow and the mark doesn't move. It reads rows, so it wakes the warehouse like any other read.

Pauses. Once a day HostWebhook checks each trigger by reading the columns of its table and, for Row changes, whether change tracking is still on. 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 cut connection or Snowflake busy is tried again by the next check: only five in a row pause the trigger. These pause it, each with its line on its card (the table name and the column are yours):

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
A column it 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 (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 valueMore 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. (and the same for grants, 5,000, and warehouses, 1,000)This trigger

A key or 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 (step 17). 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, so what changed while it was off still arrives. If what the trigger 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, and a wake bills at least a minute. The three events of a table wake the warehouse only when the table changed, Schema changes and Warehouse changes wake none, User changes, Role grants, Failed task and a Query result with no table to wait for wake it on every check, and Credit usage wakes it once a day. Test push, the first activation if you ask for rows, and activating a trigger with a whole-number cursor wake it once. 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:

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, every 15 minutes is about 16 credits a day. Keep it at 60, give the warehouse a resource monitor, and know that if it runs out of credits the checks fail and, after five in a row, the trigger pauses.

  1. Marker 1: Deliver as: one event per row, or one per check.
  2. Marker 2: Delay: 60 seconds by default.
  3. Marker 3: Ignore changes made by this flow is On.
  4. Marker 4: Check every, and under it the most the trigger can cost, in credits.
The trigger's Deliver as, Delay, Ignore changes made by this flow and Check every, with the most it can cost

Let an AI node use Snowflake (optional)

Optional

In the Snowflake node, choose AI toolkit instead of Single operation. The node becomes 11 tools that an AI node calls by name. Add them to the AI node from its Tools: Add Tool, then From Workspace. Three tools read and start open. The other eight start blocked until you unlock each one.

  1. Marker 1: AI toolkit instead of Single operation.
  2. Marker 2: The node becomes tools that an AI node calls. Here, 3 are open.
  3. Marker 3: What a call can cost.
  4. Marker 4: The two tools of SQL reach whatever the role can, and start blocked.
  5. Marker 5: Tables the AI can use: database.schema.table, one per line. Empty means none.
The Snowflake node in AI toolkit mode with its warnings and Tables the AI can use

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 aren't limited to the tables on your list. Give the AI a credential of its own, with a role that has only what its tools need (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 wakes no warehouseReadOpen
select_snowflake_rowsReads rows with structured filters and an order, up to 200ReadOpen
count_snowflake_rowsCounts the rows that match the filtersReadOpen
insert_snowflake_rowsAdds rows, up to 100 a callWriteBlocked
update_snowflake_rowsChanges the rows that match the filters. Filters are required and the brake is onDestructiveBlocked
upsert_snowflake_rowsAdds rows or overwrites the ones with the same key, up to 100 a callDestructiveBlocked
delete_snowflake_rowsDeletes the rows that match the filters. Filters are required and the brake is onDestructiveBlocked
query_snowflakeRuns a SELECT that the model writes. Meant for reading, but not read onlyDestructiveBlocked
execute_snowflake_sqlRuns one data statement that the model writes: SELECT, INSERT, UPDATE, DELETE or MERGEDestructiveBlocked
call_snowflake_procedureCalls a stored procedure from your listDestructiveBlocked
run_snowflake_taskRuns a task from your list nowDestructiveBlocked

The tools of rows, procedures and tasks never receive SQL from the model: HostWebhook writes the statement, with the names quoted and every value sent as a value. A blocked tool can't be used by any AI node. Only a tool call picks the tool: Run Test, a flow or a webhook run the operation saved on the node.

  1. Marker 1: How many are blocked: 8 of 11 at the start.
  2. Marker 2: The three tools that read start open.
  3. Marker 3: Writing, changing and deleting start blocked, and the destructive ones are marked.
Block these tool calls with 8 of 11 tools blocked: the three that read are open

What you control. Four lists, one entry per line, written as Snowflake has the names:

  • Tables the AI can use, like SHOP.PUBLIC.ORDERS, always with the database, the schema and the table. The tools of rows touch only those tables, and empty means none. 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 model never picks a database or a schema: they come from the entry of the list.
  • Columns the AI can see, like EMAIL. 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, sort, write or key, and a read that names none gets them and not *. 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, with the types of the arguments, like SHOP.PUBLIC.ADD_ORDER(VARCHAR, NUMBER(38,0)). Empty means none. The model sends the name and the values, and the signature that runs is always yours, so it never picks the overload.
  • Tasks the AI can use, like SHOP.PUBLIC.NIGHTLY_LOAD. Empty means none.

A name is plain: letters, numbers, _ and $, not starting with a number. A name with a dot, a quote or a space can't be listed, and a name is compared as it is written, so shop.public.orders is not SHOP.PUBLIC.ORDERS. Each list takes up to 100 entries, and the columns up to 200.

Fixed limits. The AI reads up to 200 rows and inserts or upserts up to 100. 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 operations, and several statements are never allowed. The node's warehouse and timeout are used: the model never picks them, nor a database or a schema. Nothing the model writes is filled in, so a {{ }} in a filter, a row or a SQL is literal text. What goes back to the model is cut to 200 rows, 100,000 characters and the cap of the node (20,000 characters by default), and the answer says what was left out. With no table named, describe_snowflake_tables describes up to 25 tables of your list.

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, but a model can still be fooled by a row: block the tools it doesn't need. What the AI reads goes to the provider of the AI node, under its terms.

The two tools that take SQL from the model. The model sends one statement with a ? for each value and the values in params, like ["paid", 100]. Both start blocked, are off while you limit the columns, and are not limited to your list of tables: 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 doesn't 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. 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: 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. 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. It says to prefer the tools of rows when one can do the job.
  • An UPDATE or a DELETE needs a WHERE of its own, and that 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. And unlocking execute_snowflake_sql unlocks writing and deleting in every table the role can write, even if delete_snowflake_rows stays blocked.
  • The walls both share: one statement; no {{ }}; up to 20,000 characters; and the doors that Run SQL shuts when it has a value are always shut: SYSTEM$ functions, IDENTIFIER(, TABLE(, TO_QUERY, EXECUTE IMMEDIATE, RESULT_SCAN and Scripting blocks. In Snowflake even a SELECT can send data out by mail or cancel other people's queries, so that is why.

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 is the limit. For reading only, the three open tools and query_snowflake:

SQL
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, but it still reads every table it has SELECT on and 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 of a tool 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. The AI decides how often, so use a small warehouse with a resource monitor. describe_snowflake_tables wakes none, and run_snowflake_task 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 and the Test need no warehouse. With Sign in with Snowflake, the check of the role names yours, but it reads no table, so it isn't meant to wake it.
  • 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.
  • Run SQL in background keeps billing until the query ends, because it runs in Snowflake after the node has answered.
  • Get query results, Cancel query and API request name no warehouse, so HostWebhook doesn't wake one for them.
  • 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, which bills while it is awake (step 18). 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) (step 18).
  • 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. A flow that sends the same rows in a loop keeps adding to it.
  • Create table, Add columns, Truncate, Drop, the three warehouse controls, the three task operations and the lists of stages and files name no warehouse. Run task bills with the warehouse of the task, and Resume warehouse bills until the warehouse suspends.
  • A trigger wakes the warehouse only when the table changed, except Failed task and a Query result with no table to wait for, which wake it on every check, and Schema changes, which wakes none. Step 13 has the numbers.
  • An AI toolkit can wake the warehouse on every call of a tool that runs a statement, and the AI decides how often. describe_snowflake_tables wakes none, and run_snowflake_task bills with the warehouse of the task (step 14).
  • A warehouse that never sleeps costs 24 credits a day if it is X-Small. Keep AUTO_SUSPEND short, 60 seconds is enough, and give it a resource monitor.
  • 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 the tag hostwebhook:<flow>:<node>, so you can find ours in your query history.

The price of a credit depends on your edition, cloud, region and contract, so this guide gives credits, not money.

Use what arrives

After Select rows, List tables and views, Describe table and the other lists, the node after it runs once per item, and that item is its payload. Column names keep the case Snowflake has, usually upper case: {{payload.STATUS}}. The same goes for Run SQL, Call procedure and Get query results, once for each row.

The other operations give one answer: count for Count rows, inserted for Insert rows, updated and matched for Update rows, deleted and matched for Delete rows, and inserted and updated for Upsert rows. Run SQL in background gives queryId and state, Cancel query gives cancelled, and API request gives status and body. The changes of tables, warehouses and tasks give done and what they were done to, Run task gives started, Copy into table gives files, loaded and failed, and Export query result gives csv, fileName, rows, bytes and truncated. List tasks, List stages and List stage files run the next node once per task, stage or file, like the other lists.

After a Snowflake trigger everything the trigger sends is in payload:

What the trigger sends
{
"event": "row.created",
"operation": "inserted",
"database": "SHOP",
"schema": "PUBLIC",
"table": "ORDERS",
"row": { "ID": 1042, "STATUS": "new", "TOTAL": "59.97" }
}

event is row.created (operation is 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), and a deleted row comes as it was. The columns Snowflake adds to describe a change, like METADATA$ACTION, are not in it. Column names keep the case Snowflake has, like {{payload.row.STATUS}}. With One event per check the flow gets one event, {"event": "batch.found", "count": 2, "items": [ … ]}, and each item is the event that a row would have had on its own; with a cursor, truncated is true when the check read as many rows as Rows per check. The three other events send query.fired, schema.changed and task.failed in event.

Reconnect after a token, key or sign-in change

If an access token expires or you remove the key in Snowflake, the nodes fail with Snowflake didn't accept the key or the token. Check the credential and press Test. and the credential is marked Needs reconnect. For a token, create a new one and paste it in Edit keys and settings (the Reconnect button of the warning opens it too), after you verify it's you, and click Save. For a key pair, run the line from step 01 again, or generate a new key. Click Test connection, and the nodes work at once.

With Sign in with Snowflake, 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 says Snowflake no longer accepts this sign-in: it expired or was revoked. Press Sign in again on the page of the credential. on its page, in the Test and in the lists of a node. In Sign in with Snowflake, on the page of the credential, click Sign in again (the page also shows Needs reconnect; the Reconnect button of its warning opens Edit keys and settings, for when the client or its secret changed): you don't run the SQL again and you don't type the client secret, because they are kept. Until you do, nothing can use the credential, and 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 in Edit keys and settings, sign in again too. The page of the credential shows the date by which you sign in again.

To end the connection with Snowflake for good, delete the credential in Settings, Credentials, and drop its user or remove its key or token in Snowflake.

With Sign in with Snowflake, deleting the credential deletes the tokens HostWebhook holds, but it doesn't revoke the refresh token in Snowflake: Snowflake keeps it until it expires, up to 90 days, unless you disable the integration, and disabling it revokes every sign-in. To end it now, run this in Snowflake:

SQL
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, click Sign in again. While the integration 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.

Ask the AI of your Snowflake (optional)

Optional

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 (see When the REST API isn't allowed to the account below). In the node, pick the group AI and the operation Ask Cortex. If you don't see Ask Cortex in the list of operations, it isn't open for your organization yet.

It spends AI credits, on your Snowflake bill.

Snowflake bills them by the tokens that go in and the tokens that come out, and HostWebhook pays nothing. Ask Cortex is off until the owner of your 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. The prices and the most one call can cost are below.

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), like Summarize this in one sentence: {{payload.text}}. It is the only field that takes a {{ }}
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 it as untrusted data, like in the AI node.

The models and what they cost. Only the models of this list are offered, and each has its own price per token. 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 guide 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

With another daily limit, multiply by it. The credits in the answer is what that call cost by this table. Snowflake's own usage records are the bill.

If the model isn't available: cross-region inference and trial accounts

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 a model isn't available in your region, the node says so (see the lines at the end of this step).

On a Snowflake trial account the AI features are off. Snowflake turns them on when an administrator adds a credit card, and that doesn't make the trial a paid account.

The limit of the day 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.

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 doesn't 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 at the end of this step). The Test of the credential warns you about it too, and still passes.
SQL
-- HOSTWEBHOOK_ROLE is the default role of the user in step 01: 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. text (the answer of the model), model, truncated (true when the answer was cut at Max tokens), promptTokens and completionTokens (as Snowflake counted them, empty if it didn't say), credits (what the call cost by the table above, a quote and not your bill), untrusted (always true) and note.

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.

Where the answer may not go.

  • Never 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.
  • Never 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 at the end of this step. 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 isn't a tool of the AI toolkit (step 14), and the AI node doesn't 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 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.
  • 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:

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 reachedCortex 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 namesql: 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). It starts with the field that has the {{ }}: sql, parameters, body, queryId…
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.

A 403 of Cortex has two causes, and only what Snowflake says tells them apart: the node 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.

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.

Troubleshooting

Snowflake didn't accept the key or the token. The key was removed or the token expired. Reconnect as in step 17.

Snowflake no longer accepts this sign-in: it expired or was revoked. Press Sign in again on the page of the credential. The 90 days passed, or the integration was disabled or dropped. In Sign in with Snowflake, on the page of the credential, click Sign in again (step 17).

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. The client id or the secret is wrong, or the integration is disabled: Snowflake says the same for both, so the line names both. Check the two values in the credential and, if they are right, run the statement in the line in Snowflake. If it was disabled and enabled again, the sign-in is over: see the line above.

Snowflake didn't accept the sign-in. Press Sign in again in the credential. The sign-in was refused while you were using the credential, for example in a list of the node. Click Sign in again on the credential (step 17). If that does not help, look at the integration in Snowflake: it may be disabled.

An administrator role cannot be used to sign in with Snowflake. Use a role made for HostWebhook, like HOSTWEBHOOK_ROLE (step 01).

This credential has no Warehouse. Sign in with Snowflake needs one to check the role. Edit the credential, pick a warehouse and click Test connection.

Your Snowflake network policy blocks HostWebhook. Allow HostWebhook's IP, 18.225.52.125, the one the form of the credential shows (step 01).

  1. Marker 1: Test connection.
  2. Marker 2: The line you see when the network policy of your account doesn't allow HostWebhook's IP. The IP is 18.225.52.125: the form of the credential shows it under Allow this IP in a Snowflake network rule.
Test connection on a credential whose IP the network policy of the Snowflake account blocks

That table doesn't exist, or the role of the credential can't see it. Check the name, and that the role has USAGE on the database and the schema and SELECT on the table.

The role of the credential has no privilege for that. Grant it in Snowflake, like SELECT on the table, or INSERT, UPDATE or DELETE for a change.

No warehouse. Pick one in the node or in the credential, like HOSTWEBHOOK_WH. A trigger has no warehouse of its own, so for a trigger pick it in the credential.

The query took longer than the timeout and was cancelled. Raise the timeout in the node, or narrow the filters.

A value doesn't fit its column. Text in a number, for example. Check the values you send.

Append rows needs a key pair credential. Snowflake documents only a key pair for streaming. Pick a credential with a key pair (step 01).

Append rows said the rows were sent, but some aren't in the table. Snowflake couldn't load them. Turn on error logging on the table and read ERROR_TABLE (step 12).

The answer is too large. An answer is limited to 5 MiB. Pick fewer columns or lower the limit.

HostWebhook couldn't reach Snowflake. Check the account, like myorg-myaccount. Private-link addresses aren't supported yet.

Don't put {{ }} inside quotes, $$ or comments. In a Run SQL, write the placeholder alone and send the whole value, like WHERE NAME LIKE {{payload.pattern}}. See step 06.

Snowflake 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 account event says the role doesn't have SNOWFLAKE.SECURITY_VIEWER or SNOWFLAKE.USAGE_VIEWER. Run the matching GRANT DATABASE ROLE of step 13 as ACCOUNTADMIN, for the role of the credential, and turn the trigger back on. If it says the role can grant privileges, use a role that can only read.

The trigger paused. Its card says why, with the lines of step 13. Fix the cause and click Activate: it continues where it stopped, so the changes made in between still arrive.

The trigger fired on rows my own flow wrote. Only Insert rows, Update rows and Upsert rows are ignored. Run SQL, Call procedure, Copy into table and Run task don't tell which rows they changed. Use filters that the rows the flow writes don't match, like STATUS = new while the flow sets STATUS to done.

The AI can't use "SHOP.PUBLIC.ORDERS". It can use: … The table isn't in Tables the AI can use. Add it there, with the database, the schema and the table, written as Snowflake has the name (step 14).

The owner limited the columns the AI can see, and this tool can name any column, so it is off. query_snowflake and execute_snowflake_sql are off while Columns the AI can see has columns. Use select_snowflake_rows, or empty that list.

This tool takes ONE statement that starts with SELECT, INSERT, UPDATE, DELETE or MERGE. execute_snowflake_sql only runs data statements. To run a procedure use call_snowflake_procedure. To create, empty or drop a table, use the nodes of step 09 in a flow: they are never tools of the AI.

An UPDATE or a DELETE needs a WHERE. execute_snowflake_sql asks the model for a WHERE of its own (step 14).

This SQL has {{ }} and also uses … A SQL with a {{ }} can't use IDENTIFIER(, TABLE(, EXECUTE IMMEDIATE, RESULT_SCAN, a SYSTEM$ function or a Scripting block. Write it without them, or remove the {{ }}.

That query id was not started by Run SQL in background in this flow in the last 24 hours. Use the id that Run SQL in background gave in this flow, like {{runSql.queryId}} (step 07).

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. HostWebhook keeps up to 1,000 ids for each flow for 24 hours; a new one fits when the oldest are a day old. The node asked Snowflake for nothing.

The id of the query could not be saved, so the query was stopped. Try again. The id could not be written at that moment, so HostWebhook stopped the query it had just started. Run it again.

Some rows may already have been changed: check before you run it again. A statement failed by a timeout or an error of Snowflake after it may have started. Look at your data before you run it again.

The call may already have been made: check before you run it again. An API request that changes something failed in the same way.

This call changes the account or shows how it is set. Turn on Allow account administration in the node to send it (step 08).

Emptying or dropping a table is off. Truncate table and Drop table need the switch Allow emptying or dropping tables On in the node (step 09). Turn it On only if the flow really has to.

Controlling a warehouse is off. Resume, Suspend and Resize warehouse need Allow warehouse control On in the node (step 10).

Export query result takes a query. The SQL of an export is one statement that starts with SELECT, or with WITH and ends in a SELECT. To change data use Run SQL (step 11).

Export query result takes one statement. Remove the ; and what follows, or put the second one in its own Run SQL.

Ask Cortex says Snowflake didn't let this user call Cortex. Snowflake named the role: the default role of the user needs SNOWFLAKE.CORTEX_REST_API_USER (or SNOWFLAKE.CORTEX_USER). Grant it to that role in Snowflake (step 18). The role of the credential is not the one Cortex uses.

Ask Cortex says the Cortex REST API isn't turned on for this account. Snowflake said so. Ask Snowflake to turn it on for the account. The AI functions in SQL, like AI_COMPLETE, can work while the REST API doesn't, so a test in Snowsight doesn't prove it is on.

Ask Cortex says Snowflake refused the call (403) and didn't say why. It is one of two things: the default role of the user lacks the Cortex database role (check it first, step 18), or the account doesn't have the REST API turned on (ask Snowflake). The answer of the run shows the owner what Snowflake said: its code and a short extract of its message. The log keeps only the code.

Ask Cortex is off. The node says Ask Cortex is off. Turn on «Allow Cortex (AI credits)» in the node to ask a model: every call spends AI credits. Only the owner of the organization turns on Allow Cortex (AI credits) in the node. It spends AI credits, so it is off until then.

A Snowflake node that comes after an Ask Cortex in the same run is refused when it has a {{ }} in SQL or in a name. The answer is text from a model, and it never goes to what Snowflake runs or to the name of anything, and HostWebhook doesn't try to tell which {{ }} carries it: write the value itself, put the node before the Ask Cortex, or use the answer only as a value, like a row, a filter or a message (step 18).

Not here yet.

A list of procedures to pick from; 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 (today its 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.

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.