Sync Snowflake table every 5 minutes
Recipe ToolsMarketingDatabaseData ParserUtilities
What it does
When the clock triggers every 5 minutes, this automation deletes rows from the table in Snowflake, parses incoming data, and upserts the batch back. The table stays current with fresh data on a fixed interval.
Who it's for
Data and analytics teams who need to refresh a Snowflake table with parsed data on a recurring schedule.
How teams use this
Keep a Snowflake table current
Delete stale rows and upsert fresh data every 5 minutes so the table always reflects the latest state without manual intervention.
Adjust the refresh interval
Change the clock from every 5 minutes to hourly or daily based on how often the source data updates. The rest of the flow stays the same.
Filter rows before upsert
Add a condition to the Json Parser so only records that meet certain criteria are upserted into Snowflake. This keeps the table focused on relevant data.
How it works
- Start on a 5 minute schedule. The clock fires every 5 minutes to begin this automation and refresh the table in Snowflake with the latest data.
- Delete rows from the table. Delete all rows in the AUTO_TESTING table in Snowflake to clear old data before the refresh begins.
- Parse data and loop through items. Parse the data document with Json Parser and repeat the next steps for each item in the array to process all records.
- Upsert batch of rows. Upsert the batch of parsed rows into the AUTO_TESTING table in Snowflake so new and updated records are stored.
- Select rows to verify. Select rows from the AUTO_TESTING table in Snowflake to confirm the refresh completed and data is current.