Setu Recipes: reusable digital workers across every app.Browse templates

Integrations / Snowflake

Snowflake

Run SQL against your Snowflake warehouse through the SQL API and check or cancel statements.

3 actions API key 1 read1 write1 destructive Calls snowflakecomputing.com

Connect

TypeScript
const conn = await setu.connections.initiate({ userId: "user_1", toolkit: "snowflake" });
console.log(conn.connectUrl); // show this to your user
await conn.waitUntilActive();

Permissions requested

This toolkit uses a single credential and requests no scopes.

Actions

Cancel statementwritesnowflake.cancel_statementCancel a Snowflake statement that is still running, by its statement handle.
InputTypeDescription
statement_handlestringRequiredStatement handle from execute_sql
TypeScript
await setu.execute({
  userId: "user_1",
  action: "snowflake.cancel_statement",
  input: {
    "statement_handle": "<statement_handle>"
  },
});
Run SQL statementdestructivesnowflake.execute_sqlRun one SQL statement in Snowflake and return its first result partition. The statement may change or delete data, so confirm before running anything but a SELECT. Large queries return a statement handle: poll with get_statement.
InputTypeDescription
statementstringRequiredThe SQL statement to run
warehousestringOptionalWarehouse to use (case-sensitive; default is the user's)
databasestringOptionalDatabase to use (case-sensitive)
schemastringOptionalSchema to use (case-sensitive)
rolestringOptionalRole to use (case-sensitive)
timeoutintegerOptionalSeconds to wait before cancelling the statement
bindingsobjectOptionalBind variables keyed by position, for example {"1":{"type":"FIXED","value":"123"}}
TypeScript
await setu.execute({
  userId: "user_1",
  action: "snowflake.execute_sql",
  input: {
    "statement": "<statement>"
  },
  confirm: true,
});
Get statement resultreadsnowflake.get_statementCheck a Snowflake statement by its handle: returns the result (or a partition of it) when finished, or the in-progress status.
InputTypeDescription
statement_handlestringRequiredStatement handle from execute_sql
partitionintegerOptionalResult partition number to fetch (0 is the first)
TypeScript
await setu.execute({
  userId: "user_1",
  action: "snowflake.get_statement",
  input: {
    "statement_handle": "<statement_handle>"
  },
});