Laravel Queue Dependency
Durable Workflow is built on top of Laravel’s queue infrastructure, which is included in the Laravel framework:Queue Connection
Configure your queue connection inconfig/queue.php. Durable Workflow supports any Laravel queue driver:
- Database - Simple, no additional infrastructure
- Redis - High performance, recommended for production
- Amazon SQS - Managed queue service
- Beanstalkd - Specialized queue server
Database Driver Example
Redis Driver Example
Per-Workflow Queue Configuration
You can specify different queue connections and queues for individual workflows usingWorkflowOptions:
Using the set() Method
Queue Workers
Run queue workers to process workflow jobs:Single Worker
Specific Connection
Specific Queue
Multiple Queues with Priority
Production Considerations
Supervisor Configuration
Use Supervisor to keep queue workers running in production:Horizon (Redis Only)
For Redis-based queues, consider using Laravel Horizon for advanced queue monitoring:Queue Configuration Best Practices
Use Redis for Production
Use Redis for Production
Redis provides better performance and reliability than the database driver for production workloads.
Separate Workflow Queues
Separate Workflow Queues
Use dedicated queues for workflows to isolate them from other application jobs:
Configure Retry Logic
Configure Retry Logic
Set appropriate
retry_after values based on your workflow execution times:Monitor Queue Health
Monitor Queue Health
Use Laravel Horizon or custom monitoring to track queue depth and failed jobs.
Failed Jobs
Configure failed job handling inconfig/queue.php:
WorkflowOptions Reference
The queue connection to use for this workflow. If null, uses the default connection.
The queue name to use for this workflow. If null, uses the default queue.