Stevora

Events

Query workflow execution events

Events

Every significant action during a workflow run is recorded as an event. Events provide a complete audit trail of execution -- step starts, completions, failures, retries, and more.

List Events for a Workflow Run

GET /v1/workflow-runs/:id/events

Returns a paginated list of events for a specific workflow run, ordered chronologically (oldest first).

Path Parameters

ParameterTypeDescription
idstringThe workflow run ID

Query Parameters

ParameterTypeDefaultDescription
pageinteger1Page number (min 1)
pageSizeinteger20Results per page (1-100)

Example Request

curl "https://api.stevora.dev/v1/workflow-runs/wfrun_def456/events?page=1&pageSize=50" \
  -H "x-api-key: stv_your_api_key"

Response 200 OK

{
  "success": true,
  "data": [
    {
      "id": "evt_001",
      "workflowRunId": "wfrun_def456",
      "stepRunId": null,
      "eventType": "WORKFLOW_STARTED",
      "payload": {},
      "createdAt": "2026-04-02T12:00:00.000Z"
    },
    {
      "id": "evt_002",
      "workflowRunId": "wfrun_def456",
      "stepRunId": "srun_aaa111",
      "eventType": "STEP_STARTED",
      "payload": {
        "stepName": "enrich-company",
        "stepType": "task"
      },
      "createdAt": "2026-04-02T12:00:01.000Z"
    },
    {
      "id": "evt_003",
      "workflowRunId": "wfrun_def456",
      "stepRunId": "srun_aaa111",
      "eventType": "STEP_COMPLETED",
      "payload": {
        "stepName": "enrich-company",
        "durationMs": 1523
      },
      "createdAt": "2026-04-02T12:00:02.523Z"
    },
    {
      "id": "evt_004",
      "workflowRunId": "wfrun_def456",
      "stepRunId": "srun_bbb222",
      "eventType": "STEP_STARTED",
      "payload": {
        "stepName": "generate-welcome-email",
        "stepType": "llm"
      },
      "createdAt": "2026-04-02T12:00:03.000Z"
    },
    {
      "id": "evt_005",
      "workflowRunId": "wfrun_def456",
      "stepRunId": "srun_bbb222",
      "eventType": "LLM_CALL_COMPLETED",
      "payload": {
        "model": "gpt-4o",
        "inputTokens": 245,
        "outputTokens": 312,
        "costUsd": 0.0087
      },
      "createdAt": "2026-04-02T12:00:05.100Z"
    }
  ],
  "meta": {
    "page": 1,
    "pageSize": 50,
    "total": 5,
    "totalPages": 1
  }
}

Error Responses

StatusCodeCause
400VALIDATION_ERRORInvalid query parameters
401AUTH_ERRORMissing or invalid API key
404NOT_FOUNDWorkflow run not found or belongs to another workspace

Event Types

Events use the following eventType values:

Workflow-level Events

Event TypeDescription
WORKFLOW_STARTEDThe workflow run began execution
WORKFLOW_COMPLETEDAll steps completed successfully
WORKFLOW_FAILEDThe workflow terminated due to a step failure
WORKFLOW_CANCELLEDThe workflow was cancelled via the API

Step-level Events

Event TypeDescription
STEP_STARTEDA step began execution
STEP_COMPLETEDA step finished successfully
STEP_FAILEDA step failed (may trigger retry)
STEP_RETRYINGA failed step is being retried

LLM Events

Event TypeDescription
LLM_CALL_STARTEDAn LLM API call was initiated
LLM_CALL_COMPLETEDAn LLM API call completed with token/cost data
LLM_CALL_FAILEDAn LLM API call failed
LLM_FALLBACK_TRIGGEREDPrimary model failed; falling back to next model
GUARDRAIL_TRIGGEREDA guardrail check failed on the LLM response
TOOL_CALL_EXECUTEDAn LLM tool call was executed

Approval Events

Event TypeDescription
APPROVAL_REQUESTEDAn approval step is waiting for a decision
APPROVAL_DECIDEDAn approval decision was submitted

Signal Events

Event TypeDescription
SIGNAL_RECEIVEDAn external signal was delivered to a waiting run

Event Payload

The payload object varies by event type. Common fields include:

FieldPresent InDescription
stepNameStep eventsName of the step
stepTypeSTEP_STARTEDType of the step (task, llm, approval, etc.)
durationMsSTEP_COMPLETEDStep execution time in milliseconds
errorSTEP_FAILED, LLM_CALL_FAILEDError message
modelLLM eventsModel name used for the call
inputTokensLLM_CALL_COMPLETEDNumber of input tokens
outputTokensLLM_CALL_COMPLETEDNumber of output tokens
costUsdLLM_CALL_COMPLETEDCost of the LLM call in USD
decisionAPPROVAL_DECIDEDThe approval decision (approved, rejected, edited)
signalTypeSIGNAL_RECEIVEDThe type of signal received