Shared Context (event.data)
All steps in one execution share a single context object. The engine merges:
- Nested objects aligned with DB rows:
entity,transaction,investigation,kyc,alert(and sometimesalerts[]). - Flat IDs for compatibility:
entityId,investigationId,alertId,kycValidationId, etc. - Rule metadata when
triggerTypeisrule_triggered:rule.id,rule.name,rule.score, etc. - Enrichment and risk:
enrichment,riskMatrix, updated scores onentityand flat fields likenewScore/riskScore. - Standby: when an execution pauses,
executionIdandcallbackTokenare available for continue/cancel links.
Refresh When Resuming Standby
When an execution resumes after standby, the engine merges the stored snapshot with an optional payload, runsrefreshContextForResume (reloads entity, transaction, investigation, KYC from the database), and preserves important paths written by previous actions (scores, IDs, etc.).
So if the user completed KYC at the provider while the flow was waiting, the next steps can see up-to-date KYC without a new automation runβit is still the same execution.
KYC: Two Patterns
You can combine both: a standby flow for sending the session link, and separate policies triggered on final KYC outcome.
When Standby Actually Pauses
Standby requires:waitAfterStep(or graph equivalent) configured, and- The run goes through
runAutomationByIdso anautomation_executionsrow exists (executionId,callbackToken).
POST /automations/:id/run (with manual_execution), rules invoking the automation, scheduler (scheduled), create entity flow, etc.
Reactive-only paths (e.g. alert_created, investigation_*, many KYC events) use processEvent without a durable execution row: wait does not pause the flowβit runs to completion in one shot.
Continue, Cancel, and Template URLs
WhenexecutionId and callbackToken are present, notification templates can expose:
continueUrlβ continue the execution (GET with token or POST with auth).cancelUrlβ cancel the waiting execution.
Scheduled Runs
Scheduled automations receive a narrow entity context by default. A process restart can skip a windowβtreat as an operational limitation unless your deployment documents recovery.Maintenance: Standby behavior is implemented in
automation-engine and related routes; keep this page aligned when execution semantics change.