Graphrt

Snowflake

Statement dengan binding, polling async dan batal, baris bertipe di semua partisi hasil. Tool agent hanya membaca (cek statement, role khusus) kecuali diizinkan

Beta v0.1.0 Node.js 4 aksi
Pakai di Graphrt Desktop

Tentang

Plugin Graphrt untuk Snowflake lewat SQL API v2, diautentikasi dengan JWT key pair (RS256 yang ditandatangani dengan node:crypto, lihat lib/key-pair-jwt.mjs). Tanpa driver Snowflake dan tanpa dependensi npm.

Yang bisa dilakukan

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

Aksi

Setiap aksi adalah langkah yang bisa ditambahkan ke workflow. Agent juga bisa memakai sebagian besar aksi sebagai tool.

  • Execute statement snowflake.execute
  • Statement status snowflake.get_statement_status
  • Statement results page snowflake.get_statement_results
  • Cancel statement snowflake.cancel_statement

Pengaturan

Graphrt menyalakan plugin dengan environment yang bersih. Hanya nilai ini yang sampai ke plugin, dan secret tidak masuk log.

  • 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_HOST From the account
    Another Snowflake host, e.g. a PrivateLink xy12345.us-east-2.privatelink.snowflakecomputing.com (must end in .snowflakecomputing.com or .cn)
  • SNOWFLAKE_WAREHOUSE User defaults
    Session 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_SECONDS 60
    Statement timeout, nodes may pass up to 3600, tool calls are capped at this value
  • SNOWFLAKE_WAIT_MS 45000
    How long a call waits for a result before returning the handle (1000 to 90000)
  • SNOWFLAKE_MAX_RESULT_BYTES 2000000
    Most 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

Cara memakainya

Di Graphrt Desktop

  1. Buka Plugins dan cari Snowflake.
  2. Klik Install lalu setujui.
  3. Ikuti langkah setup di halaman plugin, lalu tempel pengaturan yang dibutuhkan.
  4. Jelaskan pekerjaan yang membutuhkannya, dan builder menambahkan langkahnya.
Plugin di Graphrt Desktop

Dengan 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#}}"
Plugin di docs