Snowflake Overview
TheSNOWFLAKE connector stores MQTT messages in Snowflake, a cloud-native data warehouse. It supports high-volume data ingestion with automatic scaling and powerful SQL analytics.
Snowflake is ideal for large-scale analytics, data lakes, and enterprise reporting. Use it when you need to analyze IoT data alongside other business data in the cloud.
Basic Syntax
Connection Configuration
SNOWFLAKE_CONFIG Parameters
Connection Options
Connection Options
Authentication
Authentication
Performance
Performance
How long a
STORE IN row is retried when the connection to Snowflake drops. Default: 300. 0 turns the retry off. See When a row or query fails.WAREHOUSE, DATABASE, SCHEMA, ROLE, and POOL_SIZE take effect: the broker adds them to the connection it opens, so you can keep them apart from CONNECTION_STRING.
- The connection string wins. If
CONNECTION_STRINGalready sets the same key (warehouse,db,schema,role, ormaxPoolSize, in any letter case), that value is used and the broker logs a warning at route start that names the ignored setting.database=in the connection string counts asdb=. - No semicolons. A
WAREHOUSE,DATABASE,SCHEMA, orROLEvalue that contains;makes adding the route fail with an error that names the setting. A route loaded from a file with such a value doesn’t start.
password, token, private_key_file, and private_key_pwd values inside a quoted CONNECTION_STRING as ***. The rest of the string, such as the account and user, stays readable.
How placeholders are quoted
The broker places each placeholder in an eventQUERY by the quotes around it. A publisher on the source topic can no longer change the SQL by putting SQL in the payload.
{env.NAME} and {secret.NAME} are placed as written. A value that itself contains {topic} is stored as text and is not expanded again. The same rules on the other SQL engines are in How placeholders are quoted. MongoDB and OpenSearch JSON queries place each value as one JSON value instead (see OpenSearch placeholders).
Snowpipe Streaming
By default,STORE IN runs one SQL INSERT per message, so a warehouse must be running while data flows. Add an optional SNOWPIPE_CONFIG block and STORE IN sends its rows through Snowpipe Streaming instead. The broker batches rows per table, compresses them, and appends them over Snowflake’s REST API. Storing needs no running warehouse.
Use it for a steady flow of rows from models. Events (ADD EVENT) still use the SQL connection and the warehouse, and a route without SNOWPIPE_CONFIG behaves as before.
SNOWPIPE_CONFIG parameters
A batch is also cut before it reaches 4 MB.
WITH TABLE can be TABLE, SCHEMA.TABLE, or DB.SCHEMA.TABLE; a name given there wins over DATABASE and SCHEMA.
Requirements
- Key-pair authentication only.
CONNECTION_STRINGneedsaccount=,user=, andprivate_key_file=(orprivate_key=, withprivate_key_pwd=for an encrypted key). Password sign-in isn’t used for Snowpipe Streaming. - Database and schema. They must come from one of the places listed above.
- Privileges. The role needs
INSERTon the table. A namedPIPEneeds the privileges Snowflake lists for streaming pipes. - Columns. Every model field needs a column of the same name. The broker adds a
timestampfield when the model has none, as described in Values from STORE IN, and that added field needs no column. Atimestampfield the model defines does need one.
SNOWPIPE_CONFIG is refused when you add it, with the reason. A route loaded from a file with one doesn’t start.
Delivery
- At least once. A retried batch is sent again, so a row can arrive twice, for example after a timeout. Give the table a key if duplicates matter.
- Rows are checked before they are sent. Snowflake accepts an append before it reads the rows, then ignores a field with no column and drops a value that doesn’t fit. So the broker reads the table’s columns and checks each row first. A row with a field that has no column, or with text that isn’t a number in a
NUMBERorFLOATcolumn, isn’t sent. It counts as failed, and the log and the route status name the column. Numeric text such as"12"is sent. A column added withALTER TABLE ... ADD COLUMNis picked up without a restart, at most 30 seconds after a row names it. If the columns can’t be read, for example because the role can’t describe the table, rows are sent unchecked and the broker logs one warning. - Rejected rows are reported. After sending, the broker reads the channel status and logs the rows Snowflake rejected while loading them, such as text in a
BOOLEANcolumn. The route status shows them too. - Retries. Network errors, HTTP 408, 429, and 5xx are retried with a growing delay up to
MAX_RETRY_SECONDS. An expired token is renewed and the batch retried. Any other 4xx counts the batch as failed and logs Snowflake’s error. While a batch is retrying, the route status shows the last error. - A full queue drops rows. When
QUEUE_CAPACITYrows are waiting, newSTORE INrows are dropped and counted instead of held in memory. The broker logs a warning with the running total, at most once a minute. - Rows that can’t be sent, such as a payload that isn’t a JSON object, an invalid table name, or a row over 4 MB, aren’t queued. They’re counted and logged.
- Stopping. Stopping or removing the route sends queued rows for up to 8 seconds. Rows not acknowledged by then count as failed and are logged with their number.
Writing Data
- Basic Storage
- With Connection Pool
- Multiple Tables
- UPSERT
- UPDATE
- DELETE
Store sensor data in Snowflake:
Alternative: STORE IN with Models — Instead of writing EVENT queries, you can bind a model directly to this connector. Every See Data Storage Overview for the full STORE IN workflow.
PUBLISH MODEL call automatically inserts a row — no query needed:Values from STORE IN
STORE IN sends each value to Snowflake as a bound parameter, never as part of the SQL text. The row is stored exactly as published: backslashes (C:\dados\, a\nb), single and double quotes, $$, accents, and emoji arrive unchanged.
- Text stays text. A string such as
2026-11-18T10:00:00+01:00is stored as published and is not reformatted. - Numbers and booleans keep their published digits.
- If the payload has no
timestampfield, the broker adds one in ISO-8601 UTC. Atimestampyou publish is kept.
{"path": "C:\\dados\\"} stores C:\dados\ in the PATH column.
The bound values apply to
STORE IN. Values in an event QUERY follow How placeholders are quoted.When a row or query fails
These rules apply to a connector withoutSNOWPIPE_CONFIG. Snowpipe Streaming has its own Delivery rules.
- A row with no data isn’t stored. If every value of a row is empty or
null, or the payload is{}, empty, or not JSON, no row is written. The failure is logged with the table name and counted in the route status. The addedtimestampdoesn’t count as data. A row with at least one value is stored, empty fields included. nullis stored as SQLNULL. An empty string""stays an empty string. A field the model doesn’t have is left out of theINSERTand takes the column default.GET JSON ... AS STRINGturns a missing key into"", so leave out the type when the column must beNULL.- A row in flight when the connection drops is retried with a growing delay for up to
MAX_RETRY_SECONDS(300 by default). While it retries, the route status shows the error. If time runs out or the connector stops, the row is logged as lost and the model’sON ERRORruns. A statement Snowflake refused, such as an unknown column or aQUERY_TIMEOUT, isn’t retried. - A failed event query publishes nothing. When a
SELECTfails or exceedsQUERY_TIMEOUT, nothing goes toDESTINATION_TOPICand the error is logged.[]always means the query ran and returned no rows. Only a lost connection marks the connector Disconnected.
Reading Data
EVENTs also support SELECT queries to read data back from the database. Publish a message to the event’sSOURCE_TOPIC, and the query result is published to DESTINATION_TOPIC:
db/result/latest, where your actions or external clients can consume it.
Timed Polling
EVENTs can also run SELECT queries on a fixed schedule usingWITH EVERY:
Table Schema Examples
Connection String Format
Troubleshooting
Connection Failed
Connection Failed
- Verify account identifier is correct
- Check username and password
- Ensure warehouse exists and is running
- Verify network allows Snowflake connections
Permission Errors
Permission Errors
- Verify ROLE has INSERT permissions
- Check user has access to WAREHOUSE
- Ensure user can access DATABASE and SCHEMA
Query Timeout
Query Timeout
- Increase QUERY_TIMEOUT value
- Check warehouse size is adequate
- Verify warehouse is not suspended
Next Steps
Data Storage Connectors Overview
Compare all storage options.
File Storage Connector
Configure local file storage.

