Workflow System & Execution Engine

Understand how Orenyx AI processes automated workflows from trigger events to multi-bot executions, queue dispatches, and failure retries.

Simple Explanation: A Workflow is a blueprint (like a recipe). An Execution is a single run of that blueprint (like cooking a meal once). Work is dispatched to isolated specialized bot teams so one heavy job never slows down the rest of your system.

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 NameTemplate KeySteps ExecutedBest Used For
Lead to Meetinglead-to-meetingCapture lead → Qualify (BANT) → Book meetingInbound sales leads from web forms or landing pages
Checkout to Confirmationcheckout-to-confirmationStripe checkout completed → Send confirmation follow-upSaaS subscription purchases and instant customer onboarding
Support Escalationsupport-escalationTriage ticket → Escalate to outreach if unresolvedVIP 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 QueueQueue NameResponsibility
Lead Intake Queuebot-intakeCaptures leads, validates contact info, and filters spam
Lead Dispatch Queuebot-dispatchRoutes qualification/re-qualification jobs to the Qualification Bot
Lead Scheduling Queuebot-schedulingHandles booking calendar checks and meeting slot invitations
Payment Queuebot-paymentStripe checkout reconciliation and ledger entries
Support Queuebot-supportTicket triage and priority routing
Outreach Queuebot-outreachDispatches follow-up emails and re-engagement campaigns
Follow-up Queuebot-followupExecutes scheduled follow-up SLA reminders
Dead Letter Queuedead-letterWhere 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?