Skip to main content

Audit Log

Stateway maintains a unified audit log that records both API-level and engine-level events in a single sequence. Every action — from creating a process instance to the engine resolving a gateway — appears in this log.

Entry structure

Each audit log entry contains:

FieldTypeDescription
idUUIDUnique entry identifier
actorTypestringWho performed the action (see below)
actionstringThe action that occurred
payloadobjectAction-specific details
createdAtISO 8601When the action occurred

Actor types

actorTypeDescription
api_keyAn action triggered by an API call from your application
systemAn internal system action (e.g., webhook dispatch)
timerA timer job that fired and advanced a process
engineAn internal engine action (element transitions, gateway decisions, etc.)

Engine events

When the engine executes a process, it emits events with actorType: "engine". These events provide granular traceability of the execution path.

actionWhen emitted
element.enteredA token arrives at any BPMN element
element.completedA token leaves any BPMN element
gateway.resolvedAn Exclusive or Inclusive Gateway resolves and a path is taken
parallel.joinedA Parallel Gateway receives all expected tokens
timer.firedA timer job fires and advances the process
boundary.triggeredA Boundary Event activates (interrupting or non-interrupting)
instance.engine_completedAll End Events have been reached
business_rule.evaluatedA BusinessRuleTask completes a DMN evaluation

Gateway decisions

The gateway.resolved event contains the path taken and a snapshot of the process variables at the moment of the decision:

{
"id": "log_01j...",
"actorType": "engine",
"action": "gateway.resolved",
"payload": {
"element_id": "gw_credit_check",
"taken_flows": ["flow_approved"],
"variables_snapshot": {
"credit_score": 720,
"amount_requested": 50000,
"applicant_id": "cust_abc"
}
},
"createdAt": "2026-05-19T10:05:02Z"
}

variables_snapshot is captured at the instant the decision is made. It is capped at 64 KB; if the process variables exceed this limit, the snapshot stores only the variable names (values are replaced with "<truncated>"). Fields ending in _binary, _blob, or _base64 are always excluded.

Retrieving instance history

GET /v1/instances/:id/history returns the full audit trail for a specific process instance, ordered by createdAt ascending.

curl "https://api.stateway.io/v1/instances/inst_01j.../history" \
-H "X-API-Key: sw_live_your_key"
{
"data": [
{
"id": "log_01j...",
"actorType": "api_key",
"action": "instance.created",
"payload": { "correlationId": "order-789" },
"createdAt": "2026-05-19T10:05:00Z"
},
{
"id": "log_02j...",
"actorType": "engine",
"action": "element.entered",
"payload": { "element_id": "start_event", "element_type": "startEvent" },
"createdAt": "2026-05-19T10:05:00Z"
},
{
"id": "log_03j...",
"actorType": "engine",
"action": "gateway.resolved",
"payload": {
"element_id": "gw_credit_check",
"taken_flows": ["flow_approved"],
"variables_snapshot": { "credit_score": 720 }
},
"createdAt": "2026-05-19T10:05:02Z"
}
]
}

Filter parameters

ParameterTypeDescription
actor_typestringFilter by actor: api_key, system, timer, engine
actionstringFilter by action name, e.g. gateway.resolved
fromISO 8601Return entries at or after this time
toISO 8601Return entries before this time
pageintegerPage number (default: 1)
page_sizeintegerEntries per page (default: 50, max: 200)

Filter example: gateway decisions only

curl "https://api.stateway.io/v1/instances/inst_01j.../history?actor_type=engine&action=gateway.resolved" \
-H "X-API-Key: sw_live_your_key"

This returns only the gateway resolution events for the instance, each with its variables_snapshot.