Orchestrators: Declarative Workflow Automation
Learn how to build predefined and dynamic workflows using Orchestrator
Creating Your First Orchestrator
Step 1: Define the Workflow
class ImageProcessingOrchestrator
{
#[Orchestrator(inputChannelName: "process.image")]
public function processImage(): array
{
return [
"resize.image",
"add.watermark",
"optimize.image",
"upload.image"
];
}
}Step 2: Implement the Steps
Data Enrichment with Headers
Enriching with Additional Data
Executing Orchestrators
Method 1: Command Handler with Output Channel
Method 2: From Event Handlers (Business Workflows)
Method 3: Business Interface Triggering Business Workflow
Method 4: Custom Orchestrator Gateway
Asynchronous Orchestration
Asynchronous Orchestrator
Mixed Synchronous/Asynchronous Steps
Advanced Features
Dynamic Workflow Building
Conditional Step Execution
Nested Orchestrators
Testing Orchestrators
Testing Individual Steps
Testing Data Enrichment
Testing Asynchronous Orchestrators
Testing Orchestrator Gateways
Key Benefits of Orchestrator
π― Separation of Concerns
π Reusability
β‘ Dynamic Workflows
π§ͺ Testability
π Scalability
π Observability
Summary
Last updated
Was this helpful?