Evaluate Workflows
Manually trigger workflow evaluation for testing before going live.
Use the evaluate endpoint to test your workflows by simulating an event. This runs the full trigger-matching and action-execution pipeline without requiring a real event to fire.
Endpoint
POST /api/v1/workflows/evaluate
Scope: workflows:write
Request body
| Field | Type | Required | Description |
|---|---|---|---|
eventType | string | Yes | A workflow event type, such as BOOKING_CREATED: one of the values in Workflow Event Types |
entityType | string | No | One of PlatformXe's entity types, such as BOOKING; empty means none. A trigger with an entity type runs only for an event of that type or one with none, exactly as for POST /api/v1/events (a dry run selects the same triggers) |
entityId | string | No | The entity the event is about |
entityData | object or null | No | Your own parameters for the event: what the triggers' conditions and {{field}} templates read. For a business event type PlatformXe defines no fields: they are yours. May be {} or null (none) |
sourceApp | string | No | Only triggers with this source app (or none) are evaluated |
metadata | object | No | Recorded with the execution |
dryRun | boolean | No | true: report which triggers would run and their actions, and run nothing |
Which triggers run
The event is your key's organisation's and caller service's, whatever entityData holds. Only your organisation's triggers run (your caller service's, or with no sourceApp). A trigger with no organisation never runs for your organisation's event, even your own caller service's: a trigger created before PlatformXe recorded organisations is silent for organisation events until Caldera assigns it to your organisation. Another organisation's trigger never runs on your event. A platform key's event (no organisation) runs only its own caller service's triggers with no organisation.
A trigger with cooldownMinutes does not run again for the same entityId (of the same entityType, or with none: a run with no entityType holds the cooldown for every type, and an event with none is held by a run of any type) while an earlier execution inside the cooldown holds it (a completed, running or partial run; a failed run does not hold it): the result is matched: true with reason: "Cooldown active" and no execution. A trigger with maxExecutionsDay stops for the day (WAT) at its cap: reason: "Max daily executions reached". Both apply exactly as for event and scheduled runs, and are checked together with the execution record, so concurrent events never pass the cap together; a dry run is never held. If that check cannot start within a few seconds because other runs of the trigger are being admitted, the result is matched: true with reason: "Busy: another run of this trigger is being admitted" and no execution: send the event again. PlatformXe's own events try such a run up to three times in all: each busy trigger waits up to 3 seconds on its first try, and the retries of all the event's triggers together wait at most about 10 seconds (so k busy triggers can hold the event for about 3k + 10 seconds); a retry is skipped once that is spent, and never runs a trigger switched off meanwhile, and a scheduled trigger with a daily cap stops that tick and runs the rest on its next one. A failed run counts toward the trigger being switched off: your organisation's events reach only your organisation's triggers.
Response
{
"success": true,
"data": {
"matched": 1,
"total": 2,
"results": [
{
"triggerId": "trg_abc123",
"triggerCode": "BOOKING_CONFIRMATION",
"triggerName": "Booking confirmation",
"matched": true,
"executionId": "exe_def456",
"durationMs": 245,
"actionsExecuted": [
{ "type": "SEND_EMAIL", "config": { "recipient": "{{guestEmail}}" }, "status": "SUCCESS" },
{ "type": "WEBHOOK", "config": { "url": "https://yourapp.com/hook" }, "status": "FAILED", "error": "URL returned 503" }
]
},
{
"triggerId": "trg_ghi789",
"triggerCode": "VIP_ONLY",
"triggerName": "VIP bookings",
"matched": false,
"reason": "Conditions not met"
}
]
}
}
| Field | Type | Description |
|---|---|---|
matched | number | Triggers whose conditions matched |
total | number | Active triggers for the event |
results[].executionId | string | The execution recorded for a matched trigger. Absent when no execution could be recorded; error then says why |
results[].actionsExecuted[].status | string | SUCCESS (sent, or queued for retry), FAILED, SKIPPED (not run: an unknown action type, or no recipient resolved; an evaluation has no time limit) or DEFERRED (an email declined for capacity: see Triggers & Creation; not retried, never counted toward the trigger being disabled) |
results[].actionsExecuted[].error | string | Why the step failed or was deferred (a fixed text for DEFERRED) |
results[].dryRun, results[].actionsWouldExecute | Set instead of an execution when dryRun is true |
A recorded execution (the trigger's recentExecutions) stores its steps in the spelling of the engine that ran it: a run started by this endpoint stores the upper-case steps shown above (SUCCESS, FAILED, SKIPPED, DEFERRED, with the stored action's config); an event or scheduled run stores lower case (success, failed, skipped, deferred, with resultId and details). Read a recorded step's status case-insensitively. Only an event or scheduled run has a time limit (30 seconds): an action it did not reach is recorded skipped.
A recorded execution's contextSnapshot is what the run saw. A run recorded from 2026-11-12 on (either engine) stores { "_snapshot": "workflow-run", "entityData": { … }, "metadata": { … }, "actions": "<sha256>" }: the event data and metadata as JSON (a BigInt as a number, a decimal as its string; entityData is null when the data could not be copied), entityData and metadata absent when the event had none, and actions the fingerprint of the trigger's action list at the time of the run (it tells a resume whether the actions changed since). Older rows hold either the event data itself (event and scheduled runs) or { "_snapshot": "evaluate-engine", "entityData", "metadata" } (this endpoint). Treat the field as a record of the run, not as an input.
Examples
curl
curl -X POST https://api.platformxe.com/api/v1/workflows/evaluate \
-H "Content-Type: application/json" \
-H "x-api-key: pxk_live_your_api_key_here" \
-d '{
"eventType": "BOOKING_CREATED",
"entityType": "BOOKING",
"entityId": "bk_123",
"entityData": { "guestEmail": "jane@example.com", "bookingRef": "BK-001" },
"dryRun": true
}'
BOOKING_CREATED is a business event type: guestEmail and bookingRef are this example's own fields in entityData; PlatformXe defines none.
SDK
The SDK methods are on Workflows.
Evaluation runs real actions (webhooks are fired, APIs are called). Use a test endpoint URL in your workflow actions during development to avoid side effects.
Run evaluation after creating or updating a workflow to verify trigger matching and action execution before relying on it in production.
Error responses
| Code | Description |
|---|---|
INVALID_BODY | The body is not JSON |
VALIDATION_ERROR | eventType is not a workflow event type (the message links Workflow Event Types, which lists the accepted values), or entityType is not one of PlatformXe's entity types (for example BOOKING, DOCUMENT; the message, entityType is not a known entity type, lists none). An empty entityType means none. Both are checked on a dry run too. Nothing is evaluated and no trigger's failure count changes |
FORBIDDEN | API key does not have the workflows:write scope |
RATE_LIMITED | Rate limit exceeded for this API key |