Sub topic 17
Deploying and switching over safely
This chapter assumes you have built and tested your migrated flows in a sandbox, as covered in the previous chapter. It also assumes you know how to move metadata with change sets or a deployment tool such as Salesforce CLI. The risk at cutover is not the flow itself. It is the window where the old automation and the new flow are both active, or both inactive.
Plan the switch per object
Cut over one object at a time, not the whole org. Each object has its own set of Workflow Rules, processes, and flows, so a per-object cutover limits the impact of a mistake. Start with a low-risk object and use the lessons on the busier ones.
For each object, the switch has two halves:
- Activate the new record-triggered flow.
- Deactivate the Workflow Rules and Process Builder processes it replaces.
Doing only the first half causes duplicate firing, such as two emails or two tasks. Doing only the second half silently drops behavior.
Choose how to deploy
Flows travel as metadata. Whether a flow arrives active depends on your org's Process Automation Settings, specifically the option to deploy processes and flows as active. Production orgs may also enforce test coverage requirements for flows deployed as active, so check this early.
A safer pattern uses two deployments:
- Deploy the new flow as inactive, along with any supporting metadata such as custom fields and email templates.
- Check in production that the flow is present and its entry conditions look right.
- During a quiet window, activate the flow and deactivate the old rules and processes.
Deactivation is also metadata. You can deploy the old automation's inactive state through a change set or a deployment tool. In a change set, make sure the components you deploy include the old automation, or the old rules stay active.
Prepare a rollback
Do not delete the old Workflow Rules or processes at cutover. Leave them inactive. If the flow misbehaves, reactivate the old automation and deactivate the flow, which takes minutes. Delete the old automation only after the flow has run cleanly for a period you agree on, such as one full business cycle.
Before you start, record the following:
- The names and versions of what you will activate and deactivate.
- Who runs the switch and who approves a rollback.
- A short list of checks to run immediately afterward.
Monitor after cutover
Check these in the first hours and days:
- Flow errors. Fault emails go to the user who last modified the flow, so confirm that person is someone who will read them. Setup also has a place to review failed flow interviews.
- Duplicates. Look for double tasks, double emails, or repeated field changes on records created after cutover.
- Missing behavior. Compare a few records against the results your sandbox tests expected.
- Pending scheduled actions. Time-dependent actions already queued by a Workflow Rule are cancelled when you deactivate it. Records that were waiting will not fire on the new scheduled path unless they are edited again. Identify those records before cutover and decide how to handle them.
Exercise
You deploy a new record-triggered flow as active, but you forget to deactivate the Workflow Rule it replaces. What happens, and how should the deployment have been structured to avoid it?
Show answer
Both fire for the same record change, so users see duplicate emails, tasks, or updates. Deploy the flow inactive first, then in one planned window activate the flow and deactivate the Workflow Rule together, keeping the old rule inactive (not deleted) for rollback.