TL;DR
A Salesforce CI/CD pipeline that holds up in production has five components: version-controlled metadata, automated validation against a production-like sandbox, conflict detection across parallel work streams, a deployment gate with rollback, and an audit trail. Most pipelines break because teams treat Salesforce like a generic web app. They use Git, then get blindsided by profile drift, sandbox parity issues, and a rollback strategy that boils down to “redeploy and hope.” A working pipeline accepts that Salesforce is its own platform and designs around the metadata model instead of against it.
Key takeaways:
- Version control is the easy part. Keeping declarative admin changes in sync with developer commits is where most pipelines fall apart.
- Sandbox parity is the silent killer. Deployments that pass in staging fail in production because the orgs are not actually the same.
- Profile and permission set deployments cause more pipeline failures than anything else, including Apex.
- If your rollback plan is “we’ll deploy the previous version again,” it is not actually a plan. Deployments do not always go cleanly in reverse.
- A pipeline built specifically for Salesforce metadata avoids the awkward Git-but-not-really patterns that generic tools force on you.
You’ve decided to do Salesforce CI/CD properly. You’ve watched the videos, downloaded the CLI, set up a Git repo, and wired together a deployment workflow. The first few deployments work. You feel good. Then a profile change collides with another developer’s commit, the QA sandbox refresh wipes out your reference data, and the production deployment fails on a validation rule that doesn’t exist in source control. You start wondering whether anyone has actually made this work in real life.
People have. But the path looks different from what your engineering team would build for a typical web service. Salesforce is metadata-driven, and the CI/CD patterns that work beautifully for stateless apps do not survive contact with profiles, flows, and the shared org model. Here is what an actually functional pipeline looks like, what tends to break, and how to keep your deployments boring (which is the goal).
What does a Salesforce CI/CD pipeline actually look like?
A working pipeline has five stages. You should be able to point to each one in whatever you have today.
- Source control with metadata in DX source format. Profiles, flows, validation rules, page layouts, permission sets, and Apex. Every change, declarative or programmatic, lands in a branch before it touches a higher environment. The DX source format matters because the older metadata API format doesn’t split components well for diffing, which makes code reviews painful.
- Automated validation against a production-like sandbox. Apex tests run, but so do dependency checks. Does the field this flow references actually exist in the target? Are the layouts assigned to the right record types? Static analysis catches what unit tests miss.
- Conflict detection before merge. Two admins editing the same page layout in different sandboxes is the most common production-breaking event in Salesforce DevOps. The pipeline has to catch it at PR time, not at deploy time.
- A deployment gate with deploy-validate-only. Explicit approval for production releases, plus a validation-only deploy against the target org first. If validate-only fails, you stop. If it passes, you ship.
- Rollback that does not depend on redeploying. Salesforce does not version-control your org for you. If a deployment corrupts production, you need a backup snapshot to restore from. Redeploying a previous commit only reverts metadata, not the data that referenced the new schema.
Why most Salesforce CI/CD pipelines fail in production
A few recurring patterns.
- Sandbox drift. Your QA sandbox was refreshed three months ago. Production has had 47 declarative changes since then. Deployments pass in QA because they’re going into an org that no longer matches reality. The fix is regular sandbox refreshes plus pre-deployment diff reports.
- Profile deployment failures. Profiles deploy with field-level security settings for every field in the target. If your source has a profile referencing a field that no longer exists in production, the whole deployment fails. Profiles are the single largest cause of “but it worked in staging” incidents in Salesforce DevOps.
- No conflict detection. Salesforce will happily let two developers commit overlapping changes to the same flow or layout. Without a tool that surfaces the conflict at PR time, you find out at merge, or worse, at deploy.
- Rollback by redeployment. “We’ll redeploy the previous version” assumes the previous version still deploys cleanly into the current production org. It also assumes nothing data-related has changed since the deployment. Reverting metadata while preserving data is a recovery problem, not a CI/CD problem, and it needs a backup to solve.
Does Git work for Salesforce CI/CD?
Yes. Many enterprise Salesforce teams use Git, whether by preference or by requirement. Git is a strong foundation. It just benefits from a metadata-aware layer on top when working with Salesforce specifically.
Salesforce metadata is XML, where order often doesn’t matter and structure does. Git’s diff is line-by-line by design, which works beautifully for source code but can produce false positives on Salesforce XML files like profiles, layouts, and flows. Two admins add different fields in different positions, and a line-by-line diff flags the region for review even when nothing actually conflicts. A Salesforce-aware merge layer on top of Git resolves those false positives automatically, so the merge experience stays predictable.
The second consideration is access. Many Salesforce contributors are admins and citizen developers who work through clicks rather than commits, and Git assumes command-line fluency. A Salesforce-aware interface on top of Git lets declarative contributors participate in the same pipeline through tools they already know, without changing how the underlying repository works.
Both points lead to the same conclusion. Git is a fine source of truth for Salesforce CI/CD. The decision isn’t Git or no Git. It’s whether your toolchain understands Salesforce metadata on top of whichever source control you choose.
What about admin declarative changes?
This is the question that breaks most pipelines designed by engineers who haven’t worked with Salesforce admins. The answer: admin changes belong in source control too, captured before they propagate downstream.
The pattern that works: admins make changes in a development sandbox, the change is committed to a branch (manually or via a tool that handles it for them), and it moves through the same validation, conflict detection, and approval as any other commit. Practically, that means giving admins either a tool that auto-commits their work or a lightweight change-request workflow they can complete without needing to know Git. Either way, the pipeline doesn’t have two doors. Everyone comes in the same way.
How Flosum approaches Salesforce CI/CD
Flosum DevOps gives you three deployment options for your CI/CD pipeline. You pick the model that fits how your team works. A few practical implications.
- Three deployment options, one platform. Salesforce-native runs in the org and uses native version control with flexible branching. Cloud uses Flosum’s proprietary, metadata-aware version control, built specifically for Salesforce metadata and not built on Git. Customer-hosted gives you the same capabilities in your own infrastructure for regulated or sovereignty-sensitive environments.
- Git when you want it, not when you don’t. Flosum DevOps doesn’t require Git. If your team uses Git, or your engineering organization mandates it, Flosum integrates with Git cleanly and enhances how it handles Salesforce metadata.
- Metadata-aware conflict detection. Flosum knows what a profile is and what a page layout is, so two parallel changes to the same component get flagged at the branch level, before they reach a merge.
- Backup integrated with deployment. Pre-deployment snapshots from Flosum Backup & Archive (a separate cloud product) are part of the release flow, so rollback is “restore from snapshot,” not “hope the redeploy works.”
Audit trail built into the pipeline. Every deployment, approval, and conflict resolution is logged and queryable. SOX, HIPAA, and GDPR auditors get clean reports instead of parsed CI logs.
Frequently asked questions
Related reading
- A Complete Guide to Salesforce DevOps
- Run Salesforce Risk Assessments to Find Hidden Deployment Issues
- 7 Version Control Best Practices for Salesforce DevOps
- What is a Salesforce Sandbox? Types of Environments Explained
- Salesforce Metadata Backup: Protect Configuration Data
Conclusion
The shortest path to a working Salesforce CI/CD pipeline is to stop fighting the platform. Salesforce is not a generic web app, and the patterns that work for stateless services do not survive contact with profiles, sandboxes, and shared orgs. Build around the metadata quirks rather than against them.
Profiles will still be painful sometimes. Sandboxes will drift. Conflicts will happen. A pipeline that takes those facts seriously is the one that holds up in production. One that pretends those things won’t apply to your org is the one you’ll be rebuilding in six months.
See what an end-to-end Salesforce DevOps platform looks like with native version control, automatic conflict detection, and integrated backup. Request a Flosum demo.
Thank you for subscribing



