Snowflake
Run SQL queries against Snowflake data warehouses.
On this page
Connect
Auth type: Credentials form (custom_auth). Fill in the fields the provider needs (listed below). They are stored encrypted in the vault.
| Field | Type | Description |
|---|---|---|
accountrequired | text | Snowflake account identifier (e.g. xy12345.us-east-1) |
usernamerequired | text | Snowflake login username |
passwordrequired | secret | Snowflake login password |
databaserequired | text | Default database to use |
warehouserequired | text | Compute warehouse to use |
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("snowflake", "runQuery", {
"sqlText": "<sql query>"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("Snowflake answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "snowflake-runquery",
name: "Snowflake: Run Query",
description: "Calls Snowflake when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("snowflake", {
"action": "runQuery",
"sqlText": "<sql query>"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/snowflake/runQuery" \
-H "Authorization: Bearer $APP_KEY" \
-H "content-type: application/json" \
-d '{"props":{"sqlText":"<sql query>"}}'Actions
runQueryin catalog
Run Query. Execute a SQL query against your Snowflake database and return the results as rows.
Also accepted as run_query.
| Input | Type | Description |
|---|---|---|
sqlTextrequired | long text | The SQL statement to execute. Use `:1`, `:2`… or `?` as placeholders for the **Parameters** values below to safely pass dynamic values without SQL injection risk. |
bindsoptional | array | Values to bind to the placeholders (`:1`, `:2`…, or `?`) in the SQL query. Provide them in the same order they appear in the query. Using parameters is the safe way to pass dynamic values — never con… |
timeoutoptional | number | Maximum time in milliseconds to wait for the query to complete before cancelling it. Defaults to 30 000 ms (30 seconds). |
applicationoptional | text | An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**. Useful for auditing which automation triggered a query. |
create_dynamic_table
Create / Refresh Dynamic Table. Create or replace a Snowflake Dynamic Table that automatically refreshes based on a query. Dynamic Tables are a declarative way to define a table whose content is derived from a query, updated on a schedule.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
table_namerequired | text | The name for the new dynamic table (e.g. `DAILY_SALES_SUMMARY`). Only letters, digits, underscores, and `$` are allowed. |
target_lagrequired | text | How up-to-date the dynamic table data should be (called **Target Lag** in Snowflake). Examples: `1 minute`, `5 minutes`, `1 hour`. Use `DOWNSTREAM` to only refresh when a downstream object explicitly… |
warehouseoptional | id (picked from your account) | Select the virtual warehouse to use for this operation. Warehouses are listed under **Admin → Warehouses** in the Snowflake console. Leave empty to use the warehouse set in your connection. |
queryrequired | long text | The SELECT statement that defines the content of the dynamic table. Example: `SELECT user_id, SUM(amount) AS total FROM orders GROUP BY user_id` |
delete_row
Delete Row. Delete one or more rows from a Snowflake table that match a WHERE condition.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
where_clauserequired | text | A SQL condition to filter which rows to delete (e.g. `id = 42` or `status = 'archived'`). This field is required to prevent accidental deletion of all rows. **Security note:** this value is embedded … |
execute_stored_procedure
Execute Stored Procedure. Call a stored procedure in Snowflake and return its result.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
procedure_namerequired | id (picked from your account) | Select the stored procedure to call. |
argumentsoptional | array | Positional arguments to pass to the stored procedure in order. Leave empty if the procedure takes no arguments. |
get_row_by_id
Get Row by ID. Retrieve a single row from a Snowflake table by matching a column value.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
id_columnrequired | id (picked from your account) | The column to search in (e.g. the primary key or unique identifier column). |
id_valuerequired | text | The value to look up in the ID column. |
get_table_schema
Get Table Schema. Retrieve the column definitions (name, data type, nullability, default) for a Snowflake table.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
insert_multiple_rows
Insert Multiple Rows. Insert multiple rows into a Snowflake table in a single operation.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
rowsrequired | array | One item per row. Each item must be a JSON object with column names as keys. Example: `{"name": "Alice", "age": 30}`. When mapping from a previous step, pass the entire array directly. |
insert-row
Insert Row. Insert a row into a table.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
table_column_valuesrequired | object (depends on other props) | Enter the value for each column in the new row. |
list_tables
List Tables. List all tables in a Snowflake schema.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
load_data_from_stage
Load Data from Stage. Load data into a Snowflake table from a named internal or external stage using COPY INTO.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
stage_pathrequired | text | Path to the Snowflake stage (a staging area that holds files before loading). For **internal stages**: use `@stage_name` or `@schema.stage_name/folder/`. For **external stages** (S3, GCS, Azure): use… |
file_format_typerequired | one of "CSV" | "JSON" | "PARQUET" | "AVRO" | "ORC" | "XML" | The file format of the data files in the stage. |
file_patternoptional | text | Optional regular expression to load only files whose names match the pattern (e.g. `.*\.csv` loads only `.csv` files, `sales_2024.*` loads files that start with `sales_2024`). Leave empty to load all… |
skip_headeroptional | number | Number of rows to skip at the top of each CSV file (e.g. `1` to skip a column-header row). Only applies to CSV files. Defaults to 0. |
error_on_column_count_mismatchoptional | boolean | When enabled, the load fails if the number of columns in a file does not match the number of columns in the target table. Disable to allow files with fewer columns. |
on_erroroptional | one of "ABORT_STATEMENT" | "CONTINUE" | "SKIP_FILE" | What to do when a row fails validation during loading. |
runMultipleQueries
Run Multiple Queries. Execute multiple SQL statements in sequence against your Snowflake database. Optionally wrap them in a transaction so all changes are rolled back if any statement fails.
| Input | Type | Description |
|---|---|---|
sqlTextsrequired | array | List of SQL statements to run in order. Use `:1`, `:2`… placeholders to reference shared **Parameters** values. Avoid `?` placeholders when running multiple queries — use numbered placeholders instea… |
bindsoptional | array | Values shared across all queries for the numbered placeholders (`:1`, `:2`…). Provide them in order. Unused parameters are allowed. |
useTransactionoptional | boolean | When enabled, all queries run inside a single transaction. If any query fails, every preceding change in this batch is rolled back automatically. |
timeoutoptional | number | Maximum time in milliseconds to wait for each query to complete before cancelling it. Defaults to 30 000 ms (30 seconds). |
applicationoptional | text | An optional label sent to Snowflake to identify this client. Visible in query history under **Monitoring → Query History → Client Application**. |
search_rows
Search Rows. Search for rows in a Snowflake table using an optional WHERE condition, ordering, and row limit.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
where_clauseoptional | text | Optional SQL WHERE condition to narrow down results (e.g. `status = 'active' AND age > 18`). Leave empty to return all rows (subject to the row limit). **Security note:** this value is embedded direc… |
order_byoptional | text | Optional column(s) to sort results by (SQL ORDER BY clause). Examples: `created_at DESC` sorts newest first; `name ASC, age DESC` sorts by name then age. **Security note:** this value is embedded dir… |
limitoptional | number | Maximum number of rows to return. Defaults to 100. |
update_row
Update Row. Update one or more rows in a Snowflake table that match a WHERE condition.
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
table_update_valuesrequired | object (depends on other props) | Only filled columns will be updated. Leave a column empty to keep its existing value. |
where_clauseoptional | text | A SQL condition to filter which rows to update (e.g. `id = 42` or `status = 'active'`). Leave empty to update ALL rows in the table (use with caution). **Security note:** this value is embedded direc… |
upsert_row
Upsert Row. Insert a new row or update an existing one if a row with the same match column value already exists (MERGE INTO).
| Input | Type | Description |
|---|---|---|
databaserequired | id (picked from your account) | Select the Snowflake database to use. Databases are listed under **Data → Databases** in the Snowflake console. |
schemarequired | id (picked from your account) | Select the schema within the chosen database. Schemas are listed under **Data → Databases → [your database]** in the Snowflake console. |
tablerequired | id (picked from your account) | Select the table to work with. |
match_columnrequired | id (picked from your account) | The column used to identify whether a row already exists (e.g. the primary key or a unique identifier column). |
table_column_valuesrequired | object (depends on other props) | Enter the value for each column in the new row. |
Details
- Id
snowflake- Category
- Data and storage
- Tags
- data-warehouse, sql, analytics, cloud
- Package
@activepieces/piece-snowflake@0.3.1- Tier
- Community