View as Markdown
Snowflake icon

Snowflake ACTION

Execute SQL Query In Session

Execute a Snowflake query inside a session started by the Start SQL Session action, so it shares that session's state — temporary tables, USE context, and session parameters — with the other queries in the same session. Pass the serialized session from Start SQL Session to the Session prop. Note: to preserve the session this query runs on a direct connection and therefore does NOT egress from the shared static IP (use_pd_sql_proxy); if your Snowflake network policy allowlists only the static IP, use Execute SQL Query instead. See our docs to learn more about working with SQL in Pipedream.
  • Action
  • Writes data
  • API key
  • SDK
  • MCP

IMPLEMENTATION

Call this tool

Connect a user's Snowflake account once, then configure and run Execute SQL Query In Session from your backend or agent.

import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "snowflake-execute-sql-query-in-session",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    snowflake: { authProvisionId: "apn_xxxxxxx" },
    session: "Session",
    sql: "SQL Query",
  },
})

console.log(result)

SCHEMA

Inputs

Pipedream supplies the connected account. Your application provides the operation-specific values below. Dynamic inputs are resolved against that user's account.

Execute SQL Query In Session inputs
Property Type Description
session Session string
A serialized session created by the Start SQL Session action, e.g. {{steps.start_sql_session.$return_value.session}}. When provided, this action runs in that session, preserving session state such as temporary tables, USE context, and session parameters. Sessions expire server-side after ~4 hours or your account's idle timeout.
Required
sql SQL Query sql
Required

REFERENCE

Tool details

Behavior hints are published with the component in the Pipedream registry and surface as MCP tool annotations, so an agent can reason about a tool before it calls it.

Registry key
snowflake-execute-sql-query-in-session
Version
0.0.2
App
Snowflake
Authentication
API key
Read-only
No
Destructive
No
Open world
Yes