Pipeline
A pipeline you can inspect at every stage
Workflows execute as a graph of typed stages. Each stage can be audited, retried after a failure, resumed from a checkpoint, and switched on or off where the stage is optional. The chat agent is an entry point to this pipeline, not a bypass around it.
The discount workflow
-
Prepare
The workflow is created or resumed, the configuration snapshot is read and disabled stages are recorded as skipped rather than silently absent.
-
Analyse demand
Inventory and sales history become slow-mover and dead-stock findings with rationale and confidence.
-
Load and retrieve policy
Deterministic policy rules are loaded and, when retrieval is enabled, the relevant policy passages are retrieved from the vector index.
-
Rule pre-check
Candidates that cannot be permitted are dropped before the language model is asked for a proposal.
-
Propose discounts
The configured model proposes from your allowed set and returns structured output, a rationale and supporting citations.
-
Verify and validate
Policy verification and post-decision guardrails check the proposal against rules, margin and prohibited discounts.
-
Persist and request approval
The recommendation is saved as a version. An approval request is queued through the notification outbox and the workflow pauses.
-
Await the human decision
Approve, edit, reject, or regenerate when regeneration is enabled. Rejections carry feedback back into the loop.
-
Finalize
The workflow closes with an approved outcome, a rejection record or a timeout, and the audit trail stays queryable.
The campaign workflow, when a chat turn starts one
-
Chat turn
A dashboard or WhatsApp message is stored and queued. The HTTP call returns immediately with the turn identifier.
-
Leased worker
A worker claims the turn, resolves the tenant's campaign_agent model and streams progress back to the open stream.
-
Tool call into the workflow
The agent starts a campaign workflow for the approved recommendation or asks to regenerate content or an asset. The tool is the API, so authorization is identical to a dashboard action.
-
Content and media stages
Content generation, content guardrails, snapshotting and asset generation run as stages. Image and video calls use the model configured for that purpose and record their own telemetry.
-
Approval and delivery
The version waits for a human. On approval, the publishing service selects an adapter, leases the job and records the external reference.
The graph changes with your configuration
A topology service resolves stage definitions against the live configuration. Stages marked mandatory — prepare, analyse, propose, validate, persist, request approval, await decision and finalize — are never removed. Optional stages carry their own toggles.
When a stage is disabled, the edges are rewired to bypass it, the compiled graph is cached per topology hash, and the new workflow records that hash. The dashboard renders the same wiring as an SVG diagram, so what you see is what runs.
Stage availability
| Workflow | Mandatory | Optional |
|---|---|---|
| Discount analysis | Prepare, analyse, propose, validate, persist, approval, await, finalize | Load policy rules, retrieve policy, rule pre-check, verify policy, regenerate |
| Campaign creation | Prepare, load approved recommendation, snapshot items, generate content, content guardrails, persist version, approval, await, finalize | Verify content, generate assets, regenerate |
Publishing is an adapter, not a branch in the workflow
Approved campaigns reach the outside world through a dry-run adapter, a fake adapter for tests, a webhook adapter that posts a signed delivery payload to your integration, or native social adapters for LinkedIn, X, Facebook Pages and Instagram. Each adapter reads the tenant's encrypted credential at delivery time and reports an external reference back to the job.
Delivery is leased and reconciled: a job that times out is retried under the same lease rules, and the reconciliation path checks the platform before re-posting, so an uncertain response does not create a duplicate publish.
Failures and resumes are part of the model
Every stage transition is checkpointed. A failed provider call can be retried without repeating earlier stages, and a paused run can resume from the approval boundary. Runs that started under an older wiring resume on a full-superset graph so their checkpoint remains valid.
Runs and chat turns are tenant-safe at the API layer: a user sees the workflows they are allowed to see, evaluation endpoints identify the reviewer behind every verdict, and each run carries the trace ID that ties its model calls together.
Review the controls behind the pipeline
Security covers tenant isolation, encrypted credentials, webhook verification and the audit trail.