Snowflake · Arazzo Workflow

Snowflake Submit SQL Statement and Poll for Results

Version 1.0.0

Submit a SQL statement for execution, poll its status, then fetch the result set.

1 workflow 1 source API 1 provider
View Spec View on GitHub DataData WarehouseData LakehouseCloud Data PlatformAnalyticsArtificial IntelligenceData EngineeringData GovernanceSQLApache IcebergModel Context ProtocolT1ArazzoWorkflows

Provider

snowflake

Workflows

submit-sql-statement-and-poll
Submit a SQL statement, poll its execution status, and retrieve the results.
Submits a single SQL statement bound to a warehouse/database/schema/role, then branches on the response: a 200 returns the result set directly while a 202 hands back a statement handle that is polled via getStatementStatus until the statement finishes.
2 steps inputs: authToken, database, role, schema, statement, timeout, tokenType, warehouse outputs: resultData, resultMetaData, statementHandle
1
submitStatement
Submit the SQL statement synchronously. If execution completes quickly the result set is returned with a 200; otherwise a 202 is returned with a statement handle to poll.
2
pollStatus
Check the status of the statement execution by its handle. A 202 means the statement is still in progress; a 200 means it finished and the requested partition of the result set is returned.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Snowflake Submit SQL Statement and Poll for Results
  summary: Submit a SQL statement for execution, poll its status, then fetch the result set.
  description: >-
    The canonical Snowflake SQL API pattern. A SQL statement is submitted for
    execution against a warehouse, database, and schema. When the submission
    returns immediately the result set is already present, but when execution is
    still in progress the workflow polls the statement status by handle until it
    completes and the requested partition of the result set is returned. Every
    step spells out its request inline, including the inline Authorization bearer
    token and the X-Snowflake-Authorization-Token-Type header the SQL API
    requires, so the flow can be read and executed without opening the
    underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: statementsApi
  url: ../openapi/snowflake-statements-api-openapi.yml
  type: openapi
workflows:
- workflowId: submit-sql-statement-and-poll
  summary: Submit a SQL statement, poll its execution status, and retrieve the results.
  description: >-
    Submits a single SQL statement bound to a warehouse/database/schema/role,
    then branches on the response: a 200 returns the result set directly while a
    202 hands back a statement handle that is polled via getStatementStatus
    until the statement finishes.
  inputs:
    type: object
    required:
    - authToken
    - statement
    - warehouse
    - database
    - schema
    properties:
      authToken:
        type: string
        description: Bearer token (KEYPAIR_JWT, OAUTH, or programmatic access token).
      tokenType:
        type: string
        description: Value for the X-Snowflake-Authorization-Token-Type header.
        default: OAUTH
      statement:
        type: string
        description: The SQL statement to execute.
      warehouse:
        type: string
        description: Warehouse to use when executing the statement.
      database:
        type: string
        description: Database in which the statement should be executed.
      schema:
        type: string
        description: Schema in which the statement should be executed.
      role:
        type: string
        description: Role to use when executing the statement.
      timeout:
        type: integer
        description: Timeout in seconds for statement execution.
        default: 60
  steps:
  - stepId: submitStatement
    description: >-
      Submit the SQL statement synchronously. If execution completes quickly the
      result set is returned with a 200; otherwise a 202 is returned with a
      statement handle to poll.
    operationId: submitStatement
    parameters:
    - name: Authorization
      in: header
      value: Bearer $inputs.authToken
    - name: X-Snowflake-Authorization-Token-Type
      in: header
      value: $inputs.tokenType
    requestBody:
      contentType: application/json
      payload:
        statement: $inputs.statement
        timeout: $inputs.timeout
        warehouse: $inputs.warehouse
        database: $inputs.database
        schema: $inputs.schema
        role: $inputs.role
    successCriteria:
    - condition: $statusCode == 200 || $statusCode == 202
    outputs:
      statementHandle: $response.body#/statementHandle
      submittedStatusCode: $statusCode
    onSuccess:
    - name: completedImmediately
      type: end
      criteria:
      - condition: $statusCode == 200
    - name: stillRunning
      type: goto
      stepId: pollStatus
      criteria:
      - condition: $statusCode == 202
  - stepId: pollStatus
    description: >-
      Check the status of the statement execution by its handle. A 202 means the
      statement is still in progress; a 200 means it finished and the requested
      partition of the result set is returned.
    operationId: getStatementStatus
    parameters:
    - name: statementHandle
      in: path
      value: $steps.submitStatement.outputs.statementHandle
    - name: Authorization
      in: header
      value: Bearer $inputs.authToken
    - name: X-Snowflake-Authorization-Token-Type
      in: header
      value: $inputs.tokenType
    successCriteria:
    - condition: $statusCode == 200 || $statusCode == 202
    outputs:
      statusCode: $statusCode
      resultData: $response.body#/data
      resultMetaData: $response.body#/resultSetMetaData
    onSuccess:
    - name: stillPolling
      type: goto
      stepId: pollStatus
      criteria:
      - condition: $statusCode == 202
    - name: finished
      type: end
      criteria:
      - condition: $statusCode == 200
  outputs:
    statementHandle: $steps.submitStatement.outputs.statementHandle
    resultData: $steps.pollStatus.outputs.resultData
    resultMetaData: $steps.pollStatus.outputs.resultMetaData

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/snowflake-submit-sql-statement-and-poll-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.