Workflow Definitions API
POST/api/workflow-definitions/simulate
Product availabilityAlgaPSA

Simulate a workflow definition draft

Executes an inline draft definition in a zero-side-effect simulator: expressions and transforms run for real, action.call steps are stubbed (fixture > schema-shaped placeholder > empty object) with their evaluated inputs recorded, and waits pause the run unless a fixture resumes them. For event-triggered workflows, pass useLatestEvent: true (or eventId) to replay a stored workflow runtime event through the trigger payload mapping; the simulation fails with "Production would skip this event" when production would not launch the workflow for it. Omit payload and replay to have one synthesized from the trigger event schema or the workflow payload schema (the trigger contract is then not checked). Returns status, a per-step trace, final vars/payload, the stubbed action invocations, and any errors or warnings.

RBAC · workflow

Request body

Content type: application/json · schema WorkflowDefinitionSimulateBody

definitionobjectRequired
Workflow definition DSL document (nodes, edges, triggers, payload schema, etc.).
payloadobject
Workflow payload used as-is (wins over eventPayload and synthesis).
eventIdstring <uuid>
Replay this stored workflow runtime event (must match the trigger event type). Cannot be combined with payload.
useLatestEventboolean
Replay the latest stored event of the trigger event type for this tenant. Cannot be combined with payload.
eventPayloadobject
Source event payload, run through the trigger payloadMapping.
eventTypestring
Event to synthesize a payload for when payload/eventPayload are omitted.
fixturesobject
Stub outputs keyed by step id or actionId. { "$error": { message } } makes a stubbed action fail; wait steps resume from their fixture.
optionsobject
maxStepsinteger
maxForEachIterationsinteger
maxDurationMsinteger

Response body

Success response 200 · schema UnversionedV1Success

dataanyOfRequired
anyOf (option 1)object
anyOf (option 2)array of object
itemsobject
metaobject

Response codes

200
Simulation completed (see status: completed | paused-at-wait | failed).
400
Invalid request.
401
API key missing/invalid.
403
Caller lacks the required permission.
429
Simulation rate limit exceeded.
500
Unexpected error.