Skip to content

Integrations

Snowflake

Query data, ask Cortex Analyst, and manage warehouses and tasks in Snowflake

Snowflake stores data in databases and schemas and uses virtual warehouses to run queries. Sim connects over the SQL API with a programmatic access token.

Use the block to execute SQL, synchronize rows, move staged data, manage warehouses and tasks, and inspect history. To unload a query result, first materialize it as a view or with CREATE TABLE AS SELECT.

Cortex Analyst. Ask Cortex Analyst turns a plain-English question into SQL against a semantic view or semantic model, and can run that SQL to return rows. Pass the returned conversation back as history to ask follow-up questions, and start a new conversation after a handful of turns, since Snowflake reprocesses the whole history on every question. Before you use it:

  • The access token's role needs the SNOWFLAKE.CORTEX_USER or SNOWFLAKE.CORTEX_ANALYST_USER database role, SELECT on the tables behind the semantic view, and read access to the stage when the model is a staged YAML file.
  • Cortex Analyst always answers under the access token's role. The block's execution role, warehouse, and row limit apply only when it runs the generated SQL.
  • Cortex Analyst runs natively in a limited set of cloud regions. Other accounts need cross-region inference turned on.
  • Snowflake bills each successful answer, and running the SQL uses warehouse credits on top.
  • Snowflake now recommends Cortex Agents for new builds; Cortex Analyst remains available.

Connection guides: Programmatic access tokens.

Use the block

Connect with a Snowflake programmatic access token to execute SQL, synchronize structured rows, load and unload staged data, browse databases and schemas, size and control warehouses, run and schedule tasks, review query and load history, inspect schemas, and call stored procedures. Ask Cortex Analyst questions in natural language against a semantic view or model to get generated SQL and, optionally, its results, with multi-turn follow-ups.

Actions

Snowflake Execute SQL

Execute one parameterized SQL statement through the Snowflake SQL API.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringNoDatabase context for this statement
schemastringNoSchema context for this statement
statementstringYesOne Snowflake SQL statement to execute
bindingsjsonNoSnowflake bindings keyed by 1-based position, each with type and string value
asyncbooleanNoReturn immediately with a statement handle

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Statement

Check a running or completed statement and retrieve exactly one result partition. Canceled or failed statements are returned as errors.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
statementHandlestringYesStatement handle returned by Snowflake
partitionnumberNoZero-based result partition to retrieve; defaults to 0
partitionCountnumberNoTotal number of result partitions, taken from the partitionCount of the first partition. Snowflake omits metadata from every later partition response, so supply this when fetching partition 1 or higher to keep truncated and nextPartition accurate

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Cancel Statement

Cancel a running Snowflake SQL API statement.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
statementHandlestringYesStatement handle returned by Snowflake

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Insert Rows

Insert structured JSON rows using bound values.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
rowsjsonYesNon-empty JSON array of row objects with matching keys. For bulk loads, stage the files and use Load Data instead.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Update Rows

Update matching rows with a bound MERGE statement without inserting new rows.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
rowsjsonYesNon-empty JSON array of row objects with matching keys. For bulk loads, stage the files and use Load Data instead.
matchColumnsarrayYesColumns used to match target rows. Match values must be non-null and unique across the submitted rows.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Upsert Rows

Update matching rows and insert unmatched rows with a bound MERGE statement.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
rowsjsonYesNon-empty JSON array of row objects with matching keys. For bulk loads, stage the files and use Load Data instead.
matchColumnsarrayYesColumns used to match target rows. Match values must be non-null and unique across the submitted rows.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Delete Rows

Delete rows matching a required set of bound column filters.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTarget Snowflake table name within the selected database and schema context
filtersjsonYesNon-empty JSON object of column filters combined with AND. A null value matches rows where that column IS NULL; every other value is compared for equality against a bound parameter.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Load Data

Load files from an existing Snowflake stage with COPY INTO.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesTarget database name
schemastringYesTarget schema name
tablestringYesTarget table name
stagePathstringYesExisting stage path, for example @my_stage/path
fileFormatstringNoOptional named file format
patternstringNoOptional regular expression used to select staged files
onErrorstringNoCOPY error handling: ABORT_STATEMENT, CONTINUE, SKIP_FILE, SKIP_FILE_<count>, or SKIP_FILE_<percent>%
purgebooleanNoRemove successfully loaded files from the stage
forcebooleanNoReload files even when Snowflake has loaded them before
matchByColumnNamestringNoCASE_SENSITIVE, CASE_INSENSITIVE, or NONE

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Unload Data

Export a Snowflake table to files in a stage with COPY INTO.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesDatabase name
schemastringYesSchema name
stagePathstringYesDestination stage reference, for example @EXPORTS/daily
tablestringYesSource table to unload. To export a query result, materialize it first as a view or with CREATE TABLE AS SELECT, then unload that
fileFormatstringNoNamed file format applied to the unloaded files
headerbooleanNoWhether to write column headings into the unloaded files; supported for CSV and Parquet only
overwritebooleanNoWhether to replace existing files with matching names in the stage
singleFilebooleanNoWhether to write one file instead of splitting the output across files
maxFileSizeBytesnumberNoUpper size limit per unloaded file in bytes; Snowflake defaults to 16777216 (16 MB) and allows up to 5368709120 (5 GB)

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Databases

List the databases the credential can access.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
nameLikestringNoOptional SQL LIKE pattern for object names
limitnumberNoMaximum rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Schemas

List the schemas in a Snowflake database.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
nameLikestringNoOptional SQL LIKE pattern for object names
limitnumberNoMaximum rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Tables

List the tables in a Snowflake schema.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
nameLikestringNoOptional SQL LIKE pattern for object names
limitnumberNoMaximum rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Warehouses

List warehouses visible to the active Snowflake role.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
nameLikestringNoOptional SQL LIKE pattern for warehouse names

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Warehouse

Get the full details for a Snowflake virtual warehouse.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Resume Warehouse

Resume a Snowflake virtual warehouse if it is suspended.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Suspend Warehouse

Suspend a Snowflake virtual warehouse.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Alter Warehouse

Resize a Snowflake warehouse or change its auto-suspend and auto-resume settings.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehouseNamestringYesWarehouse name
warehouseSizestringNoNew warehouse size, one of XSMALL, SMALL, MEDIUM, LARGE, XLARGE, XXLARGE, XXXLARGE, X4LARGE, X5LARGE, X6LARGE
autoSuspendSecondsnumberNoSeconds of inactivity before the warehouse suspends. Snowflake polls every 30 seconds, so values under 30 or not a multiple of 30 may not behave as expected. 0 means the warehouse never suspends and keeps consuming credits
autoResumebooleanNoWhether the warehouse resumes automatically when a statement is submitted

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Tasks

List tasks in a Snowflake schema.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
nameLikestringNoOptional SQL LIKE pattern for task names
limitnumberNoMaximum task rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Task

Describe a Snowflake task.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Run Task

Run a Snowflake task immediately, optionally retrying its last failed graph.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name
retryLastbooleanNoRetry the last failed task graph run

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Resume Task

Resume a suspended Snowflake task so its schedule runs again.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name without a database or schema prefix

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Suspend Task

Suspend a Snowflake task so its schedule stops triggering runs.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
databasestringYesDatabase name
schemastringYesSchema name
taskNamestringYesTask name without a database or schema prefix

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Task Runs

Query up to seven days of Snowflake task history, capped at 10000 rows.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
taskNamestringNoOptional task name filter. TASK_HISTORY supports only non-qualified task names, so pass DAILY_LOAD rather than DB.SCHEMA.DAILY_LOAD
startTimestringNoOptional scheduled-time range start as an ISO timestamp within the last seven days
endTimestringNoOptional scheduled-time range end as an ISO timestamp within the last seven days
errorOnlybooleanNoReturn only task runs that failed or were cancelled
limitnumberNoMaximum task runs, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Task Run

Find one task history record by query ID within Snowflake’s seven-day window and 10000 most recent records after optional filters.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
queryIdstringYesTask run query ID from TASK_HISTORY
taskNamestringNoOptional task name used to narrow the 10000-record history window. TASK_HISTORY supports only non-qualified task names, so pass DAILY_LOAD rather than DB.SCHEMA.DAILY_LOAD
startTimestringNoOptional scheduled-time range start as an ISO timestamp within the last seven days
endTimestringNoOptional scheduled-time range end as an ISO timestamp within the last seven days

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Cancel Task Query

Cancel one running task query by query ID with SYSTEM$CANCEL_QUERY. Task runs already in flight are unaffected and must be cancelled individually; a cancelled child marks the task graph run failed, so downstream tasks are skipped.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
queryIdstringYesQuery ID of the single running task query to cancel, taken from TASK_HISTORY. Cancels only that query.

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Get Task Run Output

Read a task query result with RESULT_SCAN during Snowflake’s 24-hour retention window using the task owner role.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
queryIdstringYesCompleted task query ID; task results require the task owner role, while manual query results require the same user

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Query History

List queries that completed in the last seven days, optionally filtered.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
userNamestringNoOnly queries run by this user; cannot be combined with warehouseName
warehouseNamestringNoOnly queries run on this warehouse; cannot be combined with userName
startTimestringNoISO-8601 start of the query completion window, within the last seven days
endTimestringNoISO-8601 end of the query completion window, within the last seven days
errorOnlybooleanNoWhether to return only queries that failed (execution status FAILED_WITH_ERROR or FAILED_WITH_INCIDENT). Snowflake applies the limit before this filter, so it selects the failures among the most recent queries rather than the most recent failures
limitnumberNoMaximum query rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake List Copy History

List staged-file load results for a table over the last fourteen days.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
databasestringYesDatabase name
schemastringYesSchema name
tablestringYesTable whose load history to return
startTimestringYesISO-8601 start of the load window, within the last fourteen days
endTimestringNoISO-8601 end of the load window, within the last fourteen days; defaults to now
limitnumberNoMaximum load rows, from 1 to 10000

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Introspect Schema

Inspect table and column metadata through Snowflake INFORMATION_SCHEMA views.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesDatabase containing the INFORMATION_SCHEMA views
schemastringNoOptional exact schema name filter
tablestringNoOptional exact table name filter
includeViewsbooleanNoInclude views and materialized views alongside tables

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Call Procedure

Call a stored procedure with explicitly typed Snowflake bindings.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
rolestringNoSnowflake role to use for this statement
statementTimeoutSecondsnumberNoStatement timeout in seconds; 0 uses Snowflake maximum of 604800 seconds
warehousestringNoWarehouse to use for this statement; defaults to the PAT user setting
maxRowsnumberNoMaximum result rows; defaults to 1000 with a Sim safety limit of 10000
databasestringYesDatabase name
schemastringYesSchema name
procedureNamestringYesStored procedure name
procedureArgumentsarrayNoOrdered argument bindings with a Snowflake type and string value

Output

ParameterTypeDescription
statementHandlestringSnowflake statement handle
statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
messagestringSnowflake response message
resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Cortex Analyst Ask

Ask Snowflake Cortex Analyst a question in natural language against a semantic view or semantic model. Returns its interpretation and the generated SQL, or suggested questions when the question is ambiguous, and can run the SQL to return rows. Pass the returned conversation as history to ask a follow-up.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
questionstringYesThe question to ask about your data
semanticViewstringNoFully qualified semantic view name (for example MY_DB.MY_SCHEMA.MY_VIEW). Provide exactly one semantic source.
semanticModelFilestringNoStage path to a semantic model YAML file (for example @MY_DB.MY_SCHEMA.MY_STAGE/model.yaml). Provide exactly one semantic source.
semanticModelstringNoFull semantic model YAML. Provide exactly one semantic source.
semanticModelsjsonNoSeveral semantic sources for Cortex Analyst to choose between, as a JSON array of {"semantic_view": "..."} or {"semantic_model_file": "@..."} objects. Provide exactly one semantic source.
historyjsonNoEarlier conversation messages in order, as returned in the conversation output of a previous ask
executeSqlbooleanNoRun the generated SQL with the same credential and return the result rows
warehousestringNoWarehouse for running the generated SQL; defaults to the PAT user setting
rolestringNoSnowflake role for running the generated SQL. Cortex Analyst itself always answers under the access token role
maxRowsnumberNoMaximum result rows when running the SQL; defaults to 1000 (Sim limit 10000)
statementTimeoutSecondsnumberNoTimeout in seconds for running the SQL; 0 uses the Snowflake maximum

Output

ParameterTypeDescription
requestIdstringCortex Analyst request ID, used to send feedback on this answer
textstringHow Cortex Analyst interpreted the question, or why it could not answer it (text content joined in order)
sqlstringSQL Cortex Analyst generated, or null when the question was ambiguous
verifiedQueryobjectVerified Query Repository entry used to generate the SQL, or null when none was used
↳ namestringVerified query name
↳ questionstringQuestion the verified query answers
↳ sqlstringSQL of the verified query
↳ verifiedAtnumberWhen the query was last verified (Unix epoch seconds, UTC)
↳ verifiedBystringWho verified the query
suggestionsarrayQuestions the semantic model can answer, returned instead of SQL when the question was ambiguous
warningsarrayWarnings Cortex Analyst raised about the request
questionCategorystringHow Cortex Analyst categorized the question (for example CLEAR_SQL)
modelNamesarrayModels used to generate the response
semanticModelSelectionobjectWhich semantic source Cortex Analyst chose when several were given, or null for a single source
↳ indexnumberZero-based position of the chosen source in Semantic Sources
↳ semanticViewstringChosen semantic view
↳ semanticModelFilestringChosen staged semantic model file
↳ inlineSemanticModelstringChosen inline semantic model YAML
cortexSearchRetrievaljsonEntities Cortex Analyst resolved with Cortex Search ([{service, query, response_body}]), passed through as returned
conversationarrayFull conversation including this question and answer (analyst turns keep their text and SQL); pass it as History to ask a follow-up. Snowflake recommends starting a new conversation after many turns
↳ rolestringuser or analyst
↳ contentarrayMessage content blocks (text, sql, suggestions)
executionobjectResult of running the generated SQL when Run Generated SQL is on, otherwise null. A query still running after 45 seconds returns status RUNNING with a statementHandle; fetch its rows with Get Statement
↳ statementHandlestringSnowflake statement handle
↳ statusstringStatement status: SUCCEEDED, RUNNING, or CANCELED
↳ messagestringSnowflake response message
↳ resultobjectCompleted result partition, or null while running or when no result is available
↳ columnsarrayDocumented Snowflake result column metadata, or null when Snowflake returned a metadata-less partition response
↳ namestringColumn name
↳ typestringSnowflake data type
↳ lengthnumberColumn length
↳ precisionnumberNumeric precision
↳ scalenumberNumeric scale
↳ nullablebooleanWhether the column is nullable
↳ rowsarrayOne complete Snowflake result partition as string or null arrays
↳ totalRowsnumberTotal result rows
↳ currentPartitionnumberZero-based partition returned
↳ partitionCountnumberTotal partitions in the result set. Snowflake reports this only on the first partition, so pass it back to Get Statement when fetching later partitions
↳ nextPartitionnumberNext partition to request with Get Statement, if one exists
↳ truncatedbooleanWhether more result partitions remain to fetch with Get Statement, or null when Snowflake returned a metadata-less partition response and partitionCount was not supplied. Snowflake does not report when the requested row limit capped the result set, so that cap is never reflected here
↳ dmlobjectCompleted DML statistics, or null when the statement has no DML statistics
↳ rowsInsertednumberRows inserted by the statement
↳ rowsUpdatednumberRows updated by the statement
↳ rowsDeletednumberRows deleted by the statement
↳ duplicateRowsUpdatednumberDuplicate rows updated by the statement
↳ rowsAffectednumberTotal inserted, updated, and deleted rows

Snowflake Cortex Analyst Feedback

Rate a Cortex Analyst answer thumbs up or down, with an optional comment. Feedback appears in the Snowsight Cortex Analyst monitoring tab.

Inputs and outputs

Input

ParameterTypeRequiredDescription
oauthCredentialstringYesSnowflake credential (account host and programmatic access token)
requestIdstringYesRequest ID returned by Cortex Analyst Ask
positivebooleanYestrue for positive (thumbs up) feedback, false for negative (thumbs down)
feedbackMessagestringNoOptional feedback comment

Output

ParameterTypeDescription
successbooleanWhether the feedback was recorded
Was this helpful?
Suggest an edit