Sync Salesforce data to Snowflake via dbt Cloud daily

Recipe ToolsMarketingDeveloper ToolData ParserUtilitiesDatabaseCRM

What it does

When the scheduled time arrives each day at 9 AM, this automation downloads a file from Amazon S3 and parses it. It upserts the data to Snowflake, triggers a dbt Cloud job to transform it, and syncs results back to Salesforce.

Who it's for

Data and analytics teams who need to keep Salesforce customer data current in Snowflake through automated daily ELT pipelines.

How teams use this

Automate daily customer data refresh

Run the full ELT pipeline every morning so Snowflake always has the latest Salesforce customer records without manual intervention. The team opens Snowflake each day to fresh, transformed data.

Sync to a different Salesforce object

Point the bulk query to accounts or opportunities instead of customers, and the same pipeline structure loads and transforms that object type into Snowflake. Only the SOQL query changes.

Add data quality checks before load

Insert a condition after parsing to check that email fields are not empty, so only valid customer records reach Snowflake. Invalid rows are logged separately for review.

Extend pipeline to multiple S3 files

Set up the automation to download and parse multiple CSV files from different S3 folders, then load all batches into separate Snowflake tables. One dbt Cloud job run transforms all datasets.

How it works

  1. Start the daily pipeline. At 9 AM each day, this automation begins to pull the latest customer data from Amazon S3 and prepare it for Snowflake.
  2. Download the file from S3. Retrieve the customer file contents from Amazon S3 so the data is ready to parse and load into Snowflake.
  3. Parse the CSV batch. The Csv Parser converts the raw file into structured rows so Snowflake can ingest the customer records in the correct format.
  4. Upsert data and check load status. Upsert the parsed rows into Snowflake. If the load succeeds, trigger a dbt Cloud job to transform the data and sync results back to Salesforce.
  5. Log outcomes and notify. Record the pipeline status to the job report and send an email summary so the team knows whether the daily sync completed or encountered an error.