Snowflake · Arazzo Workflow

Snowflake Cancel a Running SQL Statement

Version 1.0.0

Submit a SQL statement asynchronously, then cancel its execution by handle.

1 workflow 1 source API 1 provider
View Spec View on GitHub SnowflakeDataData WarehouseData LakehouseCloud Data PlatformAnalyticsArtificial IntelligenceData EngineeringData GovernanceSQLApache IcebergMCPT1ArazzoWorkflows

Provider

snowflake

Workflows

cancel-running-statement
Launch a SQL statement asynchronously and cancel it by its statement handle.
Submits a SQL statement with async execution to obtain a statement handle, then calls cancelStatement against that handle to stop the execution.
2 steps inputs: authToken, database, schema, statement, tokenType, warehouse outputs: cancelMessage, statementHandle
1
submitAsync
Submit the statement asynchronously so the API returns a 202 with the statement handle to cancel.
2
cancelStatement
Cancel the execution of the statement identified by the handle. A 200 indicates the execution was successfully canceled.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: Snowflake Cancel a Running SQL Statement
  summary: Submit a SQL statement asynchronously, then cancel its execution by handle.
  description: >-
    Submit-then-abort pattern for the Snowflake SQL API. A statement is launched
    asynchronously so the API returns a statement handle without waiting for the
    query to finish, and the workflow then cancels the execution of that
    statement using its handle. This is the flow used to stop a long-running or
    runaway query. Each step inlines its Authorization bearer token and the
    X-Snowflake-Authorization-Token-Type header so the request can be read and
    executed without opening the OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: statementsApi
  url: ../openapi/snowflake-statements-api-openapi.yml
  type: openapi
workflows:
- workflowId: cancel-running-statement
  summary: Launch a SQL statement asynchronously and cancel it by its statement handle.
  description: >-
    Submits a SQL statement with async execution to obtain a statement handle,
    then calls cancelStatement against that handle to stop the execution.
  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 submit asynchronously.
      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.
  steps:
  - stepId: submitAsync
    description: >-
      Submit the statement asynchronously so the API returns a 202 with the
      statement handle to cancel.
    operationId: submitStatement
    parameters:
    - name: async
      in: query
      value: true
    - 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
        warehouse: $inputs.warehouse
        database: $inputs.database
        schema: $inputs.schema
    successCriteria:
    - condition: $statusCode == 202
    outputs:
      statementHandle: $response.body#/statementHandle
  - stepId: cancelStatement
    description: >-
      Cancel the execution of the statement identified by the handle. A 200
      indicates the execution was successfully canceled.
    operationId: cancelStatement
    parameters:
    - name: statementHandle
      in: path
      value: $steps.submitAsync.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
    outputs:
      message: $response.body#/message
      canceledHandle: $response.body#/statementHandle
  outputs:
    statementHandle: $steps.submitAsync.outputs.statementHandle
    cancelMessage: $steps.cancelStatement.outputs.message

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-cancel-running-statement-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.