Automation Patterns with Flows
17 min
approvals pro is most powerful when you pair manual approvals with automation this page is a catalog of record triggered flow patterns for the scenarios customers build most often each pattern gives you when to use it, the flow recipe, and the pitfalls for the underlying action reference, see invocable actions docid\ n1ojhuatlkkeigbtbigxu for apex driven automation, see global methods docid 8c8dwhn2temdwypdq bj2 pattern 1 auto submit when a checkbox is ticked scenario reps can build a quote, toggle launch pricing approval to true , and save the system automatically submits the quote for approval why flow over custom button? survives changes made via api, data loader, or mobile gives reps one less click flow recipe start record triggered flow on the target object (e g , quote) trigger a record is updated condition launch pricing approval c = true and "only when a record is updated to meet the condition requirements" optimize actions and related records action submit for approval (api name appro invocablesubmitforapproval ) record id {!$record id} approval process name pin to a specific process if multiple are active on the object fault path log {!outputs error message} to a custom approval log c object activate pitfalls no process matches if the record doesn't meet the process's entry criteria, success = true but no approval is created to enforce submission, follow up with a decision element checking that a new approval request was actually created running user permissions the flow runs as the user whose save triggered it that user needs submitrecordforapproval for system driven scenarios (e g , api initiated saves), grant the permission to the automated process user infinite loops do not gate resubmission on a field the approval process itself updates (e g , the approval status) use a dedicated "request" flag that reps explicitly set pattern 2 auto approve quick approvals scenario some approval steps exist purely for audit (e g , "rubber stamp by compliance when discount < 5%") auto approving these removes human bottlenecks without dropping the audit record flow recipe start record triggered flow on appro approval c trigger a record is created or updated condition appro approval step r appro approval step name c = "compliance check" and appro status c = "assigned" and (some business signal, e g , appro approval request r rid c 's parent quote discount < 5% — expose via a formula field on the approval if needed) variables create a text collection approvalidstoapprove and append {!$record id} action approve approvals (api name appro invocableapproveapproval ) approval ids {!approvalidstoapprove} approver user {!$user id} (the running user — or a designated system approver's id) message "auto approved per compliance policy (discount < 5%)" fault path handle the rare failure case (e g , required message missing) activate pitfalls the running user matters whoever the auto approval is recorded against is what shows in the audit trail using $user id records the user who triggered the flow for cleaner audits, designate a service account and hardcode its user id (or pull from a custom setting) messages required if the step has make approval message required set, the message input is mandatory the action throws otherwise pattern 3 auto reassign after n days of inaction scenario if an approver hasn't acted after 5 business days, reassign to their manager or to a backup queue flow recipe start record triggered flow on appro approval c trigger a record is created, filtering where appro status c = "assigned" scheduled path 5 days after appro date time assigned c decision is the approval still assigned (not yet resolved)? get records look up the approver's manager ( user record, traverse managerid ) action reassign approvals (api name appro invocablereassignapproval ) approval ids collection containing {!$record id} new approver user or group id {!manageruser id} message "auto reassigned after 5 days of inactivity" activate pitfalls scheduled paths fire even if the record was deleted add a decision to confirm the approval still exists and is assigned business day counting salesforce flows count calendar days for "5 business days", use a formula field that calculates the target date cascading reassignments guard against the manager being inactive or also a direct report of the original assignee — walk the chain with a loop pattern 4 auto recall when the record materially changes scenario a rep edits a quote's amount while it's pending approval the in flight approvals are stale — recall and let the rep resubmit flow recipe start record triggered flow on the target object trigger a record is updated condition appro approval status c = "pending" and any pricing sensitive field changed (e g , ischanged(amount) || ischanged(discount) || ischanged(term months c) ) action recall approvals (api name appro invocablerecallapproval ) record id {!$record id} notification post to slack / email the rep "your quote was recalled due to a change please review and resubmit " activate pitfalls don't auto resubmit let the rep review what changed and decide auto resubmit creates infinite loops if the resubmission also updates the record (common with downstream recalculation flows) ischanged on the wrong fields be specific about which fields warrant a recall ischanged(lastmodifieddate) is never right locked records if lock record after submit is on, the recalling change may be blocked solve by using a validation rule pattern (see best practices → selective field locking docid\ h8xc9gykfudb7auncqlpu ) that permits specific fields to change without full unlock pattern 5 sync approval status to a parent object scenario your quote object needs its own status field kept in sync with the appro approval status c on the approval request downstream billing and cpq automation watch the quote status , not the approvals pro field flow recipe start record triggered flow on appro approval request c trigger a record is updated condition ischanged(appro status c) get records get the parent quote using rid c (or via the custom lookup docid\ mvebvizbuokkqryr0cjui if you set one up) update records map quote status ← appro status c activate consider also adding a validation rule to block manual overrides of quote status when appro approval status c is populated see best practices → syncing quote status docid\ h8xc9gykfudb7auncqlpu pattern 6 populate the custom approval request → quote lookup scenario you've added a custom quote c lookup field on appro approval request c (following object model → extending docid\ mvebvizbuokkqryr0cjui ) populate it automatically on creation flow recipe start record triggered flow on appro approval request c trigger a record is created optimize fast field updates assignment $record quote c = $record appro rid c activate for orgs with multiple objects going through approval, branch on appro record object label c if record object label = 'quote' → set quote c if record object label = 'opportunity' → set opportunity c if record object label = 'case' → set case c pattern 7 notify per path completion scenario you have a deal desk path and a legal path running in parallel deal desk wants an email when its path resolves, without waiting for legal flow recipe start record triggered flow on appro approval c trigger a record is updated condition ischanged(appro path status c) and appro path status c = "approved" get records deduplicate so you only fire once per path per request (use a recipe like fire only when the first approval in a path transitions; or store a flag on the approval request) send email use a visualforce email template related to the approval request activate note out of the box, approvals pro sends the approved / rejected email templates on request level resolution, not path level this pattern fills that gap governor limit considerations bulk submissions if a trigger causes many records to be submitted in one transaction (e g , a data loader insert that flips 200 launch approval c checkboxes), the submit invocable action bulkifies internally — but each submission creates appro approval request c and appro approval c records and fires downstream flows monitor for dml limit breaches on large batches consider asynchronous processing via queueable apex for > 100 records email limits each approval step sends emails salesforce enforces daily email limits (5,000/day for most production orgs) for automation that could trigger thousands of approvals, disable per step request emails and rely on a digest pattern instead cpu limits matrix evaluations are in memory and fast, but variable calculation conditions with many aggregations can be cpu heavy if you hit system limitexception on submit, simplify the entry criteria or push some logic into a pre computed formula field on the submitted record anti patterns don't update status fields directly in a flow see best practices → never directly update status fields docid\ h8xc9gykfudb7auncqlpu don't call the standard salesforce "submit for approval" action when you meant the approvals pro one confirm the api name starts with appro or sfappspro don't chain auto approve → auto resubmit → auto approve always leave a human checkpoint or a deliberate pause don't use formula fields referencing now() or today() in entry criteria they re evaluate on every page load and destabilize smart approvals use a stamped date field instead related invocable actions docid\ n1ojhuatlkkeigbtbigxu — action by action input/output reference global methods docid 8c8dwhn2temdwypdq bj2 — apex equivalents for custom triggers best practices → automation with flows & apex docid\ h8xc9gykfudb7auncqlpu — the high level rules