Build a Salesforce to Snowflake ELT Pipeline with Bruin

Set up Bruin Cloud connections, connect a project repo, configure Slack and a Bruin agent, then build a Salesforce to Snowflake ELT pipeline with Bruin CLI, Bruin MCP, and agent skills.

Overview

Goal - Build a Salesforce to Snowflake ELT pipeline with Bruin CLI, Bruin Cloud, Bruin MCP, Slack, and a Bruin agent.

Audience - Data engineers and analytics engineers who want Salesforce ingestion, Snowflake models, lineage, checks, Cloud scheduling, and agent-assisted maintenance in one repo.

What the demo shows

  • A single prompt creates a full Salesforce -> Snowflake pipeline.
  • The agent maps Salesforce objects and creates Bruin ingestr assets for the bronze layer.
  • The agent builds silver and gold Snowflake models for reporting.
  • Bruin Cloud runs the pipeline, shows lineage, and sends failed-run Slack notifications.
  • Two skills are added after the pipeline exists: Salesforce activation and self-healing pipeline work.

Prerequisites

The demo repo uses synthetic credit union records because it needed realistic Salesforce data for the video. The same setup works for any Salesforce data: RevOps, sales, support, customer success, marketing operations, finance, or custom Salesforce objects.


Steps

1) Create the Bruin Cloud connections

If you have not added Cloud connections before, follow Manage Connections first. The names below are examples, not requirements. Use whatever naming convention your team prefers, but keep the names consistent across Bruin Cloud, .bruin.yml, pipeline.yml, asset YAML files, and AGENTS.md.

  • Create a Salesforce connection, for example salesforce.
  • Create a Snowflake connection, for example snowflake-default.
  • Use an integration user for Salesforce, not a personal admin account.
  • Give Snowflake write access to the target bronze, silver, and gold schemas.
  • Keep analysis-agent access read-heavy by default. Pipeline execution needs writes, but most agents only need reads.

2) Initialize the repo

If this is your first Bruin project, skim Projects and Initialize from a Template before creating the repo. The structure is the same even though this guide uses an empty project.

  • Start from a Git repo and run bruin init empty salesforce_dwh.
  • Keep .bruin.yml at the repo root.
  • Use a pipeline folder like pipelines/salesforce_dwh.
  • Add pipeline.yml with a daily schedule and failed-run Slack notifications.

Minimal pipeline shape:

name: salesforce_dwh
schedule: daily
start_date: "2024-01-01"

default_connections:
  snowflake: "snowflake-default"

notifications:
  slack:
    - channel: "#data-alerts"
      success: false
      failure: true

3) Connect the repo to Bruin Cloud

For the full Cloud UI walkthrough, use Create a Project. After the project syncs, use Enable a Pipeline to turn on scheduled runs.

  • Push the repo to GitHub.
  • Create a Bruin Cloud project from the repo.
  • Confirm the Cloud project can resolve the Salesforce and Snowflake connection names used in the repo. For example, if the assets use source_connection: salesforce and connection: snowflake-default, Bruin Cloud needs connections with those exact names. If your team uses different names, update the repo and agent instructions to match.
  • Enable the pipeline.
  • Trigger a first validation or test run from Bruin Cloud.

4) Add agent instructions

  • Create AGENTS.md at the repo root.
  • Tell the agent the actual connection names, pipeline path, schema layout, and safety rules.
  • Require bruin validate --fast before changes are considered ready.
  • Require approval for Salesforce writes, full refreshes, broad backfills, and credential changes.

Use this as the starting prompt for the file, replacing the sample connection names if your Bruin Cloud connections use different names:

You are a data engineering agent for this Salesforce to Snowflake Bruin project.

- Salesforce connection: `salesforce`
- Snowflake connection: `snowflake-default`
- Bronze uses Bruin `ingestr` assets.
- Silver cleans and joins Salesforce entities.
- Gold publishes reporting-ready and activation-ready tables.
- Do not print secrets.
- Do not mutate Salesforce without a dry-run summary and approval.
- Validate with `bruin validate --fast pipelines/salesforce_dwh`.

5) Build the bronze layer

  • Start with standard Salesforce objects: Account, Contact, Lead, Opportunity, OpportunityLineItem, OpportunityContactRole, User, Task, Event, and Campaign.
  • Add custom objects only when a gold use case needs them.
  • Create one Bruin ingestr asset per Salesforce object.
  • Use SystemModstamp as the incremental key when available.
  • Use schema_contract: evolve so additive Salesforce fields can land in bronze.

Example bronze asset shape:

name: bronze.salesforce_opportunities
type: ingestr
connection: snowflake-default

parameters:
  destination: snowflake
  source_connection: salesforce
  source_table: opportunity
  incremental_key: SystemModstamp
  incremental_strategy: merge
  schema_contract: evolve
  schema_naming: snake_case

6) Run the backfill, then switch to daily incremental loads

For the underlying run behavior, read Incremental vs Full Refresh Runs. For Cloud backfills, manual runs, lineage, and run history, use Pipelines Overview.

  • Run one full refresh to load historical Salesforce data.
  • After the backfill, use the daily scheduled pipeline for incremental changes.
  • Keep full refreshes explicit and approval-gated in production.

Useful commands:

bruin validate --fast pipelines/salesforce_dwh
bruin run --full-refresh pipelines/salesforce_dwh
bruin run pipelines/salesforce_dwh

7) Build silver and gold models

  • Silver models should clean Salesforce data and define reusable business entities.
  • Gold models should match reporting, Slack, dashboard, and activation workflows.
  • Put descriptions, primary keys, and checks close to the asset definitions.

Common silver models:

  • silver.salesforce_accounts
  • silver.salesforce_opportunity_pipeline
  • silver.salesforce_activity_timeline
  • silver.salesforce_product_pipeline
  • silver.salesforce_marketing_funnel

Common gold models:

  • gold.pipeline_kpis
  • gold.pipeline_by_stage
  • gold.pipeline_by_channel_daily
  • gold.activity_coverage
  • gold.account_risk
  • gold.forecast_movement

8) Create the Slack agent

For the step-by-step UI setup, use Configure AI Agents. For the Slack workflow, use Deploy an AI Analyst to Bruin Cloud & Slack.

  • Connect Slack in Bruin Cloud.
  • Create a Bruin Cloud agent scoped to the project.
  • Give it repo access, Bruin Cloud run access, Snowflake query access, and Bruin MCP context.
  • Put the agent in a focused channel such as #salesforce-pipeline, #revops-data, or #data-alerts.
  • Keep pipeline notifications and Salesforce write approvals in channels with a clear audit trail.

9) Use the one-shot prompt when the setup is ready

If the agent needs to inspect Cloud projects and runs from your coding tool, add Bruin Cloud MCP as well as the local Bruin MCP.

Use this prompt when the connections, repo, Cloud project, Slack, and agent instructions are in place:

Use the connections to Salesforce and Snowflake.
Create the bronze layer ingestion assets to ingest all objects from Salesforce to Snowflake.
The pipeline should run daily and ingest new data only.
A one-time backfill should be completed for each asset to load historical data.
Once the bronze layer is completed, build the silver layer data models.
Once the silver layer is completed, build the gold layer business reports.
Send pipeline notifications to Slack channel "#data-alerts" but only failed runs.

In the demo, this produced 14 bronze assets, 5 silver models, 9 gold assets, README updates, and lineage in Bruin Cloud.


Agent skills

Data activation Salesforce admin

Create this skill at:

.agents/data-activation-salesforce-admin/SKILL.md

Use it when the agent needs to safely write back to Salesforce.

What it should enforce:

  • Scope the Salesforce org, object, field names, operation, match key, and expected record count.
  • Preview candidate records before writes.
  • Run dry-run mode first.
  • Ask for approval before live writes.
  • Report created, updated, skipped, failed, and unmatched records.

Good use cases:

  • Create follow-up tasks for stale high-value opportunities.
  • Update an approved account-risk field from a Snowflake gold table.
  • Add a Salesforce custom field and verify it appears in bronze after ingestion.
  • Prepare a Salesforce update set for human review.

Self-healing Salesforce pipeline

Create this skill at:

.agents/self-healing/SKILL.md

Use it when the agent needs to investigate or repair pipeline failures.

What it should enforce:

  • Inspect Bruin Cloud run history, failed logs, asset files, and lineage.
  • Classify the failure: Salesforce auth, schema drift, Snowflake SQL, failed check, metric definition, transient failure, or unknown.
  • Propose the smallest safe fix.
  • Run bruin validate --fast.
  • Open a PR or ask for approval before risky changes.
  • Trigger only the narrowest rerun needed after the fix is available.

Self-healing should follow this flow:

detect -> diagnose -> propose -> validate -> PR or approval -> scoped rerun -> verify

What to build first

If you want the smallest useful production version, build this first:

  1. Bronze ingestion for Account, User, Opportunity, Contact, Lead, and Task.
  2. silver.salesforce_opportunity_pipeline.
  3. gold.pipeline_kpis.
  4. Daily incremental schedule.
  5. Failed-run Slack notifications.
  6. Slack agent for questions over silver and gold.
  7. Self-healing skill.
  8. Salesforce activation skill only after the reporting layer is trusted.