Skip to main content

Workflows

Common workflow patterns and how to implement them.

Standard Workflow

  1. Trigger — Event or scheduled job
  2. Validate — Input validation
  3. Process — Business logic execution
  4. Persist — Save results
  5. Notify — Optional callbacks

Error Handling

Failed steps can retry with exponential backoff. Configure max retries per workflow type.

Async Processing

Long-running catalog, audit, and AI agent tasks are dispatched to RabbitMQ and processed by Celery workers (bhcatalogworker, bhauditworker, bhaiagentworker). Celery Beat publishes scheduled tasks.

  • APIs enqueue work and return immediately
  • Workers persist results to PostgreSQL and object storage
  • Poll status endpoints or use Admin notifications for completion

See RabbitMQ & Celery Workers and Cloud Architecture.