Claude
Skills
Sign in
โ† Back

flow-orchestrator-2025

Included with Lifetime
$97 forever

Salesforce Flow Orchestrator for multi-user, multi-step business processes (2025). PROACTIVELY activate for: (1) building Flow Orchestrations (autolaunched and screen flows), (2) work assignment to users, queues, or roles, (3) interactive vs background steps, (4) approval-style workflows in Flow, (5) parallel and sequential stages, (6) Flow Orchestrator events (StageCompleted, OrchestrationCanceled), (7) error handling and resume patterns, (8) testing orchestrations, (9) migrating from legacy Process Builder/Workflow Rules, (10) Flow Orchestrator vs Approval Process tradeoffs. Provides: orchestration design patterns, stage/step templates, error-handling recipes, and migration guidance.

Design

What this skill does


## ๐Ÿšจ CRITICAL GUIDELINES

### Windows File Path Requirements

**MANDATORY: Always Use Backslashes on Windows for File Paths**

When using Edit or Write tools on Windows, you MUST use backslashes (`\`) in file paths, NOT forward slashes (`/`).

**Examples:**
- โŒ WRONG: `D:/repos/project/file.tsx`
- โœ… CORRECT: `D:\repos\project\file.tsx`

This applies to:
- Edit tool file_path parameter
- Write tool file_path parameter
- All file operations on Windows systems


### Documentation Guidelines

**NEVER create new documentation files unless explicitly requested by the user.**

- **Priority**: Update existing README.md files rather than creating new documentation
- **Repository cleanliness**: Keep repository root clean - only README.md unless user requests otherwise
- **Style**: Documentation should be concise, direct, and professional - avoid AI-generated tone
- **User preference**: Only create additional .md files when user specifically asks for documentation


---

# Salesforce Flow Orchestrator (2025)

## What is Flow Orchestrator?

Flow Orchestrator coordinates multi-user, multi-step, multi-stage business processes without code. Different users complete sequential tasks in one workflow with built-in approvals, conditional logic, and error handling.

**Key Capabilities**:
- **Multi-User Workflows**: Assign tasks to different users/teams across stages
- **Stage-Based Execution**: Organize work into logical stages
- **Background Automation**: Combine user tasks with automated steps
- **Visual Progress Tracking**: Users see their position in the workflow
- **Fault Paths**: Handle errors gracefully (Summer '25)
- **No-Code**: Build complex processes without Apex

## When to Use Flow Orchestrator

| Use Case | Flow Orchestrator? | Why |
|----------|-------------------|-----|
| Employee Onboarding (HR โ†’ IT โ†’ Manager) | โœ… Yes | Multi-user, sequential stages |
| Quote-to-Cash (Sales โ†’ Finance โ†’ Operations) | โœ… Yes | Cross-functional approval process |
| Case Escalation (L1 โ†’ L2 โ†’ L3 Support) | โœ… Yes | Tiered assignment with SLAs |
| Simple record automation (create/update) | โŒ No | Use Record-Triggered Flow |
| Single-user process | โŒ No | Use Screen Flow |
| Batch data processing | โŒ No | Use Scheduled Flow or Apex Batch |

## Orchestration Architecture

```text
Orchestration = Stages โ†’ Steps โ†’ Background Automations

Stage 1: "HR Review"
โ”œโ”€ Step 1.1: Interactive Step (HR Manager reviews)
โ”œโ”€ Step 1.2: Background Automation (create records)
โ””โ”€ Decision: Approved? โ†’ Next Stage : End

Stage 2: "IT Provisioning"
โ”œโ”€ Step 2.1: Interactive Step (IT assigns equipment)
โ”œโ”€ Step 2.2: Background Automation (provision accounts)
โ””โ”€ Step 2.3: Interactive Step (IT confirms completion)

Stage 3: "Manager Onboarding"
โ”œโ”€ Step 3.1: Interactive Step (Manager schedules 1:1)
โ””โ”€ Step 3.2: Background Automation (send welcome email)
```

## Building an Orchestration (Step-by-Step)

### Example: Employee Onboarding Process

**Requirements**:
- HR reviews new hire documents โ†’ Approved/Rejected
- If approved, IT provisions accounts and equipment
- Manager schedules first day and assigns mentor
- System sends notifications at each stage

### Step 1: Create Orchestration

```yaml
Setup โ†’ Flows โ†’ New Flow โ†’ Orchestration
Name: Employee_Onboarding
Object: Employee__c (custom object)
Trigger: Record Created, Status = 'Pending Onboarding'
```

### Step 2: Design Stages

**Stage 1: HR Document Review**
```text
Stage Name: HR_Document_Review
Stage Description: HR verifies employee documentation
Run Mode: One at a Time (sequential)

Step 1.1 (Interactive):
- Name: Review_Documents
- Assigned To: Queue "HR_Onboarding_Queue"
- Due Date: 2 days from start
- Screen Flow: HR_Document_Review_Screen
- Inputs: Employee__c.Id

Step 1.2 (Background - Decision):
- If HR_Approved = true โ†’ Next Stage
- If HR_Approved = false โ†’ End + Send Rejection Email
```

**Stage 2: IT Provisioning**
```text
Stage Name: IT_Provisioning
Condition: Runs only if Stage 1 approved

Step 2.1 (Interactive):
- Name: Assign_Equipment
- Assigned To: Queue "IT_Provisioning_Queue"
- Due Date: 3 days from stage start
- Screen Flow: IT_Equipment_Assignment
- Inputs: Employee__c.Id

Step 2.2 (Background):
- Name: Create_AD_Account
- Autolaunched Flow: Create_Active_Directory_Account
- Inputs: Employee__c.Email, Employee__c.FirstName

Step 2.3 (Background):
- Name: Send_IT_Confirmation
- Action: Send Email Template
- Recipient: Employee__c.Email
- Template: Welcome_Email
```

**Stage 3: Manager Setup**
```text
Stage Name: Manager_Setup
Depends On: Stage 2 complete

Step 3.1 (Interactive):
- Name: Schedule_First_Day
- Assigned To: Employee__c.Manager__c
- Due Date: 1 day from stage start
- Screen Flow: Manager_Onboarding_Tasks

Step 3.2 (Background):
- Name: Update_Status
- Record Update: Employee__c.Status = 'Onboarding Complete'
```

### Step 3: Implement Fault Paths (Summer '25)

**Fault Path on IT Provisioning Failure**:
```text
If Step 2.2 (Create_AD_Account) fails:
โ”œโ”€ Retry Step (1 attempt after 10 minutes)
โ”œโ”€ If still fails:
โ”‚  โ”œโ”€ Send email to IT Manager with error details
โ”‚  โ”œโ”€ Create Task for manual provisioning
โ”‚  โ””โ”€ Assign Interactive Step to IT Manager for resolution
โ””โ”€ Continue to Stage 3 (don't block entire process)
```

**Configuration**:
```text
Step 2.2: Create_AD_Account
โ”œโ”€ Fault Path Enabled: true
โ”œโ”€ Retry Attempts: 1
โ”œโ”€ Retry Delay: 10 minutes
โ””โ”€ On Final Failure:
   โ”œโ”€ Create Task
   โ”‚  โ”œโ”€ Subject: "Manual AD Account Creation Needed"
   โ”‚  โ”œโ”€ Assigned To: IT_Manager_Queue
   โ”‚  โ””โ”€ Priority: High
   โ””โ”€ Send Email Notification
      โ”œโ”€ Template: IT_Provisioning_Failure
      โ””โ”€ Recipients: IT Managers
```

## Interactive Steps vs Background Steps

### Interactive Steps

**Use for**: Actions requiring human judgment or input

```text
Interactive Step Configuration:
โ”œโ”€ Screen Flow: Define UI for user input
โ”œโ”€ Assigned To: User, Queue, or Role
โ”œโ”€ Due Date: Formula (TODAY() + 2 for 2 days)
โ”œโ”€ Instructions: What user should do
โ”œโ”€ Input Variables: Data passed to screen flow
โ””โ”€ Output Variables: Data returned from user
```

**Example Screen Flow** (HR Review):
```text
Screen: Review Documents
โ”œโ”€ Display: Employee Name, Position, Documents Uploaded
โ”œโ”€ Input: Radio Button (Approve / Reject)
โ”œโ”€ Input: Text Area (Comments - required if reject)
โ””โ”€ Action: Save & Submit

Output Variables:
- HR_Approved (Boolean)
- HR_Comments (Text)
```

### Background Steps

**Use for**: Automated actions without user interaction

```text
Background Step Types:
โ”œโ”€ Autolaunched Flow: Call another flow
โ”œโ”€ Apex Action: Invoke Apex method
โ”œโ”€ Send Email: Email template or custom
โ”œโ”€ Post to Chatter: Notify users
โ”œโ”€ Create Records: DML operations
โ”œโ”€ Update Records: Field updates
โ”œโ”€ External Service: REST callout
โ””โ”€ Wait: Pause for duration or until condition
```

## Advanced Patterns and Monitoring

Advanced Flow Orchestrator designs (parallel approvals, conditional branches, retry / escalation, record-triggered orchestration, external integration handoffs) plus monitoring, reporting, and operational dashboards live in `references/advanced-patterns-monitoring.md`. Load that reference for complex multi-stage implementations and production observability.

## Integration with Other Features

### Pattern: Orchestration + Approval Process

```text
Stage 2: Manager Approval
โ”œโ”€ Step 2.1 (Interactive): Manager reviews
โ”‚  โ””โ”€ Screen Flow with Approve/Reject buttons
โ”œโ”€ Background Automation: Update approval status
โ””โ”€ If Approved: Proceed to Stage 3
   If Rejected: Send rejection email, End orchestration
```

### Pattern: Orchestration + Platform Events

**Publish events at stage transitions**:
```apex
trigger OrchestrationStageTrigger on FlowOrchestrationStageInstance (after insert, after update) {
    List<OrchestrationStageEvent__e> events = new List<OrchestrationStageEvent__e>();

    for (FlowOrchestrationStageInstance stage : Trigger.new) {
        if (stage.Status == 'Completed') {
            events.add(new OrchestrationStageEvent__e(
                Orches

Related in Design