# XML Patterns — Flow Approval Process Complete XML reference for all components of a Flow Approval Process. --- ## Orchestration — Required Input Variables ```xml recordId String true submitter String true submissionComments String true firstApprover String true ``` --- ## WebLink — Only Valid Trigger ```xml LaunchApproval online button url replace false /flow/MyOrchestration?recordId={!Object__c.Id}&submitter={!$User.Id}&retURL=/{!Object__c.Id} ``` Add to the page layout as `actionType: CustomButton`. **Do not include** `hasMenubar`, `hasScrollbars`, `height`, `position`, `isResizable` — these are forbidden with `openType: replace` and cause deployment failures. --- ## Background Step Calls an AutoLaunched flow. Use for calculations, evaluations, and status updates. ```xml CalcLevel MyAutoLaunchedFlow stepBackground BackgroundStep recordId recordId approvalLevel false false false ``` **Input constraints:** only variable references (``) or string literals (`1`) are valid. Expressions and merge fields are not supported. --- ## Approval Step Calls a Screen Flow for the approver UI. ```xml Approval_N1 Review_Approval_Screen_Flow stepApproval ApprovalStep MyQueueDeveloperName Queue approvalDecision true true true ``` --- ## Decision Element — Routing After Background Step Reference Background Step outputs using the `Outputs.` prefix: ```xml RouteByLevel Level1 and CalcLevel.Outputs.approvalLevel EqualTo 1 Stage_N1 ``` Decision after an Approval Step — check the `approvalDecision` output: ```xml Approval_N1.Outputs.approvalDecision ``` --- ## Screen Flow — Required Variables The approver Screen Flow must expose these variables with the exact names shown. ```xml approvalInformation String true recordId String true approvalDecision String true ApprovalRadioButtons approvalComments String true ``` Add a `faultConnector` on every `recordLookups` element leading to a screen that displays `{!$Flow.FaultMessage}`. --- ## Orchestrated Stage — Full Structure ```xml Stage_N1 and Approval_N1 Review_Approval_Screen_Flow stepApproval ApprovalStep MyQueue Queue approvalDecision true true true UpdateStatus_N1 UpdateApprovalStatusFlow stepBackground BackgroundStep recordId recordId status PendingN2 false false false RouteAfterN1 ```