Snowflake
Statements with bindings, async polling and cancel, typed rows across result partitions, agent tools read-only (statement check, dedicated role) unless opted in
Beta v0.1.0 Node.js 4 actions
About
A Graphrt plugin for Snowflake over the SQL API v2, authenticated with a key-pair JWT (RS256 signed with node:crypto, see lib/key-pair-jwt.mjs). No Snowflake driver, no npm dependencies.
What it can do
- execute: one SQL statement with ? bindings. It is submitted asynchronously and polled for up to SNOWFLAKE_WAIT_MS. Returns typed rows (objects), columns, total_rows, stats for DML, and next_cursor when more rows (or more result partitions) remain. A statement still running after the wait comes back as {status: "running", statement_handle}, wait: false returns that at once.
- get_statement_status: waits for a running statement and returns its first page.
- get_statement_results: the next page from a next_cursor, across result partitions.
- cancel_statement: cancels a running statement. Aborting a call while it waits cancels the statement too.
- Values: NUMBER with scale 0 is a number when exact, else a string, decimals are exact strings, FLOAT is a number, BOOLEAN a boolean, DATE YYYY-MM-DD, TIME HH:MM:SS.fffffffff, TIMESTAMP_NTZ ISO without offset, TIMESTAMP_LTZ ISO in UTC, TIMESTAMP_TZ ISO in its own offset, VARIANT/OBJECT/ARRAY parsed JSON, BINARY hex. Bindings infer TEXT, FIXED, REAL and BOOLEAN, pass {"type": "DATE", "value": "2026-11-19"} (or TIME, TIMESTAMP_NTZ/LTZ/TZ, BINARY, ...) for the rest.
- Full reference: OPERATIONS.md.
Actions
Each action is a step you can add to a workflow. Agents can also use most of them as tools.
- Execute statement
snowflake.execute - Statement status
snowflake.get_statement_status - Statement results page
snowflake.get_statement_results - Cancel statement
snowflake.cancel_statement
Settings
Graphrt starts plugins with a clean environment. Only these values reach the plugin, and secrets stay out of logs.
-
SNOWFLAKE_ACCOUNT(required)Account identifier: myorg-myaccount (preferred) or the locator form xy12345.us-east-2.aws. The JWT uses it uppercase without region (MYORG-MYACCOUNT, XY12345), the host keeps the full identifier with _ turned into -. -
SNOWFLAKE_USER(required)Login name (uppercased in the JWT) -
SNOWFLAKE_PRIVATE_KEY_PATH(none)PEM private key file (PKCS#8, encrypted or not) -
SNOWFLAKE_PRIVATE_KEY(none)The PEM text instead of a file (\n escapes allowed) -
SNOWFLAKE_PRIVATE_KEY_PASSPHRASE(none)Passphrase of an encrypted key -
SNOWFLAKE_HOSTFrom the accountAnother Snowflake host, e.g. a PrivateLink xy12345.us-east-2.privatelink.snowflakecomputing.com (must end in .snowflakecomputing.com or .cn) -
SNOWFLAKE_WAREHOUSEUser defaultsSession defaults, nodes may override each per call -
SNOWFLAKE_TOOL_ROLE(none: agent tools refused)Role every agent tool call uses (tools cannot choose a role or warehouse). Agent tools are refused until it is set, unless SNOWFLAKE_TOOL_ALLOW_WRITES=1. -
SNOWFLAKE_STATEMENT_TIMEOUT_SECONDS60Statement timeout, nodes may pass up to 3600, tool calls are capped at this value -
SNOWFLAKE_WAIT_MS45000How long a call waits for a result before returning the handle (1000 to 90000) -
SNOWFLAKE_MAX_RESULT_BYTES2000000Most JSON bytes of rows per call, the rest comes with next_cursor -
SNOWFLAKE_TOOL_ALLOW_WRITES(off)1 lets agent tools run statements the read-only check refuses -
SNOWFLAKE_DATABASE -
SNOWFLAKE_SCHEMA -
SNOWFLAKE_ROLE -
GRAPHRT_POLL_INTERVAL_MS
How to use it
In Graphrt Desktop
- Open Plugins and search for Snowflake.
- Click Install and approve it.
- Follow the setup steps on the plugin's page, then paste the settings it needs.
- Describe a job that needs it, and the builder adds the steps.
With the CLI
terminal
$ graphrt plugin install snowflake workflow.yaml
- id: revenue
type: snowflake.execute
statement: "SELECT order_date, SUM(total) AS revenue FROM shop.orders WHERE order_date >= ? GROUP BY 1 ORDER BY 1"
bindings: [{ type: DATE, value: "2026-11-01" }]
- id: next_page
type: snowflake.get_statement_results
cursor: "{{#revenue.next_cursor#}}"