When to Use: High-volume batch processing, decoupled architectures, or when you need async recipe execution with guaranteed delivery and retry semantics.
How It Works
The Event-Driven model decouples recipe invocation from execution. Producers publish recipe requests to a queue, and workers consume and process them asynchronously.Note: PraisonAI does not include built-in queue support. This model documents an integration pattern using external message queues. You implement the producer/consumer logic in your application.
Pros & Cons
- Pros
- Cons
- Async at scale - Process thousands of recipes concurrently
- Decoupled - Producers don’t wait for results
- Guaranteed delivery - Queue handles retries
- Horizontal scaling - Add workers as needed
- Fault tolerant - Failed jobs can be retried
- Backpressure handling - Queue buffers during spikes
Step-by-Step Tutorial
1
Choose a Message Queue
2
Install Dependencies
3
Define Worker Task
4
Create Producer
5
Start Workers
Production-Ready Example
AWS SQS Integration
Troubleshooting
Jobs stuck in queue
Jobs stuck in queue
Check worker status and logs:
Jobs failing silently
Jobs failing silently
Enable detailed logging:Check failed job queue:
Memory issues with large payloads
Memory issues with large payloads
Store large data externally and pass references:
Callback failures
Callback failures
Implement retry logic for callbacks:
Security & Ops Notes
Security Considerations
- Message encryption - Encrypt sensitive data in messages
- Queue authentication - Secure queue access with credentials
- Callback validation - Validate callback URLs before sending
- Dead letter queues - Handle failed jobs properly
- Rate limiting - Prevent queue flooding
Monitoring
Key metrics to track:- Queue depth - Number of pending jobs
- Processing time - Job execution duration
- Failure rate - Percentage of failed jobs
- Worker utilization - Active vs idle workers
Next Steps
- Plugin Mode - For IDE/CMS integration
- Platform/DevOps Persona - Infrastructure patterns
- Use Cases - Real-world implementations

