SfSkills Domains Docs GitHub

Home / devops / flow-deployment-activation-ordering

flow-deployment-activation-ordering

Deploying Flow metadata across environments when activation order matters: which flow version becomes active, how paused interviews survive deploys, avoiding the 'two active versions for a moment' race, SFDX / Metadata API deploy flags, 'Deploy as Active', rollback. NOT for Change Set vs SFDX vs package choice for a flow — use flow/flow-deployment-and-packaging. NOT for whether a change needs a new version or a new flow — use flow/flow-versioning-strategy.

Open the skill folder on GitHub


Flow Deployment & Activation Ordering

Purpose

Flow deployments are deceptively tricky. Unlike Apex, Flow preserves previous versions in the org; the "active" version is a pointer. A deploy can inadvertently deactivate the currently-running flow, leave two flows active in sequence, or break paused interviews that refer to the old version. The team hits production incidents: "the approval flow stopped triggering," "paused interviews threw after deploy," "rollback just deactivated everything." This skill codifies the sequence, guards, and verification to make Flow deploys boring.

  1. Inventory changes. Which flows changed? Which have paused

    interviews or scheduled runs currently in progress?

  2. Check active versions in target org. sf data query against

    FlowDefinition and Flow to confirm what is active today.

  3. Pick activation mode. Deploy as active (default) vs deploy as

    inactive then activate via FlowDefinition update. Inactive-first is safer for risky flows.

  4. Plan the order. If Flow A calls Subflow B, deploy B first (active

    before A switches).

  5. Communicate pause windows. If paused interviews exist on the

    changing flow, delay deploy or accept that paused interviews may fail on resume.

  6. Deploy, verify, and plan rollback. Use --test-level RunSpecifiedTests --tests <ClassName> [...] when Apex callers exist (Flow itself has no test framework parity). --tests is what names the classes to run — RunSpecifiedTests on its own specifies nothing — and this level changes the coverage rule: "Each class and trigger in the deployment package must be covered by the executed tests for a minimum of 75% code coverage." Re-query active versions post-deploy; run a smoke Flow interview; check for spikes in Flow error emails. Keep the prior active version id captured before deploy — rollback = flip the pointer on FlowDefinition, not redeploy.

The Asymmetry Everything Turns On

Deploying a flow always creates a new version. It never restores an old one. Activation, by contrast, is a pointer into versions that already exist in the org. Deploy and activate are different operations with different rollback properties, and conflating them causes most incidents in this domain.

Active vs Draft Deploy

Paused Interview Risk

Paused interviews resume on the version they started on. The deploy is safe — the old version stays in the org. The cleanup is what breaks them, usually weeks later in an unrelated change, which is why nobody connects the failure back.

Subflow / Activation-Order Rules

Subflow resolution is late: the parent runs whatever version of the child is active at interview time, and the latest version if the child has none active.

Rollback Pattern

CI/CD

Anti-Patterns (see references/llm-anti-patterns.md)

Official Sources Used

The full annotated list is in references/well-architected.md.

Package files