Skip to main content
Publish recipe jobs to a queue and scale workers for async, high-volume workloads.
The user enqueues work; workers pull messages, run recipes, and ack or retry on failure.
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

  • 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

Check worker status and logs:
Enable detailed logging:
Check failed job queue:
Store large data externally and pass references:
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