Send daily email with Snowflake SQL results to Salesforce

Recipe ToolsMarketingWorkatoDatabaseData ParserUtilitiesCRM

What it does

When a scheduled time arrives, this automation runs custom SQL in Snowflake to fetch data and formats it as a CSV. If the data meets a condition, someone creates a Salesforce task for each row and emails the results.

Who it's for

Data and analytics teams who need to distribute Snowflake query results by email and sync outcomes to Salesforce.

How teams use this

Email daily sales metrics to leadership

Run a SQL query each morning to pull yesterday's sales, format it as a CSV, and email the report to executives. The query and schedule stay the same every day.

Distribute customer churn data to support

Change the recipient email address and SQL query to send churn risk data to the customer support team instead of sales. The automation structure does not change.

Email only when data exists

Set a condition so the email is sent only when the Snowflake query returns rows. If no data is found, the automation stops and no email is sent.

Create tasks for high-priority records

Add a filter so Salesforce tasks are created only for rows where a column meets a threshold, such as deal size over 50000. Other rows are included in the email but skip the task step.

How it works

  1. Run on a custom schedule. The automation starts at a time you set, such as every morning at 8 AM or every Friday at noon.
  2. Fetch data with custom SQL. Run your custom SQL query in Snowflake to retrieve the dataset you need, such as daily sales or customer activity.
  3. Format results as CSV. Convert the Snowflake query results into a CSV file so the email recipient can open it in a spreadsheet application.
  4. Check if data meets condition. Evaluate whether the Snowflake query results satisfy your criteria before proceeding to email and task creation steps.
  5. Create task for each row. When the condition is met, create a Salesforce task for each row in the results so the team has work items to track.