plugins/salesforce-master/skills/flow-orchestrator-2025/SKILL.md
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.
npx skillsauth add JosiahSiegel/claude-plugin-marketplace flow-orchestrator-2025Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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:
D:/repos/project/file.tsxD:\repos\project\file.tsxThis applies to:
NEVER create new documentation files unless explicitly requested by the user.
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:
| 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 = 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)
Requirements:
Setup → Flows → New Flow → Orchestration
Name: Employee_Onboarding
Object: Employee__c (custom object)
Trigger: Record Created, Status = 'Pending Onboarding'
Stage 1: HR Document Review
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
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
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'
Fault Path on IT Provisioning Failure:
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:
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
Use for: Actions requiring human judgment or input
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):
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)
Use for: Automated actions without user interaction
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 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.
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
Publish events at stage transitions:
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(
OrchestrationId__c = stage.OrchestrationInstanceId,
StageName__c = stage.StepDefinitionName,
CompletedDate__c = System.now()
));
}
}
if (!events.isEmpty()) {
EventBus.publish(events);
}
}
Subscribe externally:
// External system tracks orchestration progress
client.subscribe('/event/OrchestrationStageEvent__e', (message) => {
const { OrchestrationId__c, StageName__c } = message.data.payload;
console.log(`Stage ${StageName__c} completed for ${OrchestrationId__c}`);
// Update external dashboard
updateOrchestrationStatus(OrchestrationId__c, StageName__c);
});
AI agent handles certain steps:
Stage 2: Document Verification
├─ Step 2.1 (Background): AI agent verifies documents
│ └─ Agentforce Action: Verify_Document_Compliance
│ - Uses Einstein OCR to extract text
│ - Uses LLM to validate against compliance rules
│ - Returns: Compliant (true/false) + Confidence score
├─ Decision: If confidence < 90% → Human review
└─ Step 2.2 (Interactive - Conditional): Human verifies (if AI uncertain)
Issue 1: Work items not appearing for users
Causes:
- User not in assigned queue
- User lacks permission to object
- Filter criteria on view excludes item
Solution:
1. Check queue membership: Setup → Queues
2. Verify object permissions: User profile/permission set
3. Review work item list view filters
Issue 2: Background step failing silently
Causes:
- Apex error in called flow/action
- Required field missing
- Governor limit exceeded
Solution:
1. Enable debug logs: Setup → Debug Logs
2. Check Flow error emails: Setup → Process Automation Settings
3. Implement fault path to catch and handle errors
Issue 3: Orchestration not triggering
Causes:
- Trigger criteria not met
- Record not updated properly
- Orchestration inactive
Solution:
1. Verify record meets entry criteria
2. Check orchestration activation status
3. Review audit trail for record updates
// Query orchestration details for debugging
public class OrchestrationDebugger {
public static void debugOrchestration(Id recordId) {
// Find orchestration instances for record
List<FlowOrchestrationInstance> instances = [
SELECT Id, Label, Status, CreatedDate
FROM FlowOrchestrationInstance
WHERE RelatedRecordId = :recordId
ORDER BY CreatedDate DESC
];
for (FlowOrchestrationInstance instance : instances) {
System.debug('Orchestration: ' + instance.Label);
System.debug('Status: ' + instance.Status);
// Get work items
List<FlowOrchestrationWorkItem> items = [
SELECT Id, Label, Status, AssignedToId, DueDate
FROM FlowOrchestrationWorkItem
WHERE OrchestrationInstanceId = :instance.Id
ORDER BY CreatedDate
];
for (FlowOrchestrationWorkItem item : items) {
System.debug(' Step: ' + item.Label + ', Status: ' + item.Status);
}
}
}
}
Process Builder → Flow Orchestrator:
Process Builder supports only simple automation
Flow Orchestrator adds:
- Multi-user coordination
- Interactive steps
- Stage-based organization
- Visual progress tracking
- Fault handling
When to migrate:
- Process involves multiple users
- Need stage-based workflow
- Want user interface for steps
- Require better error handling
Flow Orchestrator transforms complex, cross-functional business processes into visual, manageable workflows that scale across your organization.
development
This skill should be used when the user asks to train, debug, scale, or improve ML models. PROACTIVELY activate for: (1) PyTorch, TensorFlow/Keras, JAX, Flax, Hugging Face Trainer/Accelerate training loops, (2) distributed training, DDP/FSDP/DeepSpeed, TPU/GPU setup, (3) mixed precision AMP/bf16, gradient accumulation, checkpointing, seeding, (4) overfitting, imbalance, loss functions, regularization, LR schedules, warmup, (5) memory optimization, gradient checkpointing, offloading, quantization-aware training. Provides: reproducible training best practices across deep learning and classical ML.
development
This skill should be used when the user asks to productionize, track, version, govern, monitor, or automate ML systems. PROACTIVELY activate for: (1) MLflow, Weights & Biases, Neptune, Comet, ClearML experiment tracking, (2) model registry, model versioning, artifact lineage, reproducibility, (3) Kubeflow, SageMaker Pipelines, Vertex AI Pipelines, Azure ML pipelines, Databricks workflows, (4) CI/CD, continuous training/evaluation, A/B tests, canary/shadow deployments, (5) drift detection, model monitoring, data validation, responsible AI governance. Provides: end-to-end MLOps architecture and operational safeguards.
development
This skill should be used when the user asks to optimize, export, serve, compress, or accelerate ML inference. PROACTIVELY activate for: (1) latency, throughput, p95/p99, batching, concurrency, KV cache, memory, or cost issues, (2) quantization INT8/INT4, GPTQ, AWQ, bitsandbytes, pruning, sparsity, distillation, (3) ONNX export, ONNX Runtime, TensorRT, TorchScript, torch.compile, XLA, OpenVINO, Core ML, TFLite, (4) Triton, TorchServe, TF Serving, BentoML, Seldon, KServe configuration, (5) edge deployment, CPU/GPU/TPU/Inferentia serving. Provides: hardware-aware inference optimization and safe benchmarking.
testing
This skill should be used when the user asks to tune hyperparameters, run sweeps, optimize search spaces, or use AutoML. PROACTIVELY activate for: (1) Optuna, Ray Tune, FLAML, AutoGluon, Hyperopt, Nevergrad, KerasTuner, W&B sweeps, (2) grid search, random search, Bayesian optimization, TPE, Gaussian processes, evolutionary search, (3) ASHA, Hyperband, successive halving, multi-fidelity optimization, population-based training, (4) learning-rate finder, batch-size search, early stopping, pruning, (5) reproducible sweep design and experiment analysis. Provides: budget-aware hyperparameter search strategy.