Workflow System & Execution Engine
Understand how Orenyx AI processes automated workflows from trigger events to multi-bot executions, queue dispatches, and failure retries.
1. Built-in Workflow Templates
Orenyx AI ships with three production-ready starter templates that can be cloned into your account with 1 click:
| Template Name | Template Key | Steps Executed | Best Used For |
|---|---|---|---|
| Lead to Meeting | lead-to-meeting | Capture lead → Qualify (BANT) → Book meeting | Inbound sales leads from web forms or landing pages |
| Checkout to Confirmation | checkout-to-confirmation | Stripe checkout completed → Send confirmation follow-up | SaaS subscription purchases and instant customer onboarding |
| Support Escalation | support-escalation | Triage ticket → Escalate to outreach if unresolved | VIP support tickets requiring automated follow-up SLA guarantees |
2. The Execution Lifecycle & State Machine
Every execution progresses through a deterministic state machine:
[ Trigger Fired ] ──> QUEUED ──> RUNNING ──┬──> SUCCEEDED (Completed)
└──> FAILED (Sent to Dead Letter Queue after retries)- QUEUED: Trigger received; job waiting in a BullMQ worker queue.
- RUNNING: Active bot worker is executing the current workflow step.
- SUCCEEDED: All steps finished clean; results saved to database and audit logs.
- FAILED: Max retry attempts exhausted; stored in Dead Letter Queue (DLQ) for review.
3. Execution Payload JSON Example
Below is an example of an actual workflow execution response payload:
{
"executionId": "exec_8f9a2b1c4d",
"workflowKey": "lead-to-meeting",
"status": "SUCCEEDED",
"triggerSource": "webhook.inbound_lead",
"tenantId": "tenant_acme_corp",
"steps": [
{
"stepId": "intake",
"bot": "IntakeBot",
"status": "SUCCEEDED",
"startedAt": "2026-07-23T00:10:00.000Z",
"completedAt": "2026-07-23T00:10:01.200Z",
"output": { "leadId": "lead_123", "email": "buyer@enterprise.com" }
},
{
"stepId": "qualify",
"bot": "QualificationBot",
"status": "SUCCEEDED",
"startedAt": "2026-07-23T00:10:01.250Z",
"completedAt": "2026-07-23T00:10:03.100Z",
"output": { "bantScore": 85, "qualified": true, "budget": "$50k-$100k" }
},
{
"stepId": "schedule",
"bot": "SchedulingBot",
"status": "SUCCEEDED",
"startedAt": "2026-07-23T00:10:03.150Z",
"completedAt": "2026-07-23T00:10:04.050Z",
"output": { "calendarEventId": "evt_9918", "meetingTime": "2026-07-24T15:00:00Z" }
}
]
}4. Queue Dispatch & Isolated Bot Workers
Orenyx AI uses dedicated BullMQ worker queues (backed by Redis) to dispatch jobs to isolated bot workers, so a slow or crashing bot never blocks any other queue:
| Bot Worker Queue | Queue Name | Responsibility |
|---|---|---|
| Lead Intake Queue | bot-intake | Captures leads, validates contact info, and filters spam |
| Lead Dispatch Queue | bot-dispatch | Routes qualification/re-qualification jobs to the Qualification Bot |
| Lead Scheduling Queue | bot-scheduling | Handles booking calendar checks and meeting slot invitations |
| Payment Queue | bot-payment | Stripe checkout reconciliation and ledger entries |
| Support Queue | bot-support | Ticket triage and priority routing |
| Outreach Queue | bot-outreach | Dispatches follow-up emails and re-engagement campaigns |
| Follow-up Queue | bot-followup | Executes scheduled follow-up SLA reminders |
| Dead Letter Queue | dead-letter | Where jobs land after exhausting retries, for manual inspection |
Every queue uses the same retry policy: 4 attempts with exponential backoff (2s → 8s → 32s...), configurable via QUEUE_DEFAULT_ATTEMPTS/QUEUE_BACKOFF_MS. There's no per-queue customization today, despite what an earlier version of this page said.
Dead Letter Queue (DLQ) Guarantee
If a bot step fails all retry attempts (e.g. an external calendar API is temporarily down), the execution is moved to the Dead Letter Queue (DLQ). It is never lost. You can inspect the failure reason in `/logs` and trigger a 1-click retry directly from the dashboard.
Was this page helpful?