Skip to main content

llm.generation_completed

A generation run reaches a terminal outcome. Inspect status and correlate run_id.

Owner: Conversations. Direction: Travila → your endpoint (outgoing).

The receiver gets an HTTP POST webhook request whose body is the event payload itself. JSON uses protobuf field names (snake_case). See delivery headers and signature verification before accepting it.

Operations that can produce this event​

These operations can start the generation workflow that emits this event. Receiving a successful API response does not establish that every event will be produced or delivered.

Payload fields​

FieldTypePresenceMeaning
event_contextEventContextOptionalEvent provenance and routing metadata associated with the emitted event.
run_idstringOptionalUnique identifier for the workflow run
statusstring (WORKFLOW_STATUS_RUNNING, WORKFLOW_STATUS_COMPLETED, WORKFLOW_STATUS_FAILED, WORKFLOW_STATUS_TIMED_OUT, WORKFLOW_STATUS_CANCELED) or integer (int32)OptionalTerminal status of the run
loop_countinteger (int32)OptionalNumber of agent loops/steps executed Minimum: -2147483648. Maximum: 2147483647.
duration_msstring (int64)OptionalEnd-to-end run duration in milliseconds Pattern: ^-?\d+$.
usageUsageOptionalOptional usage accounting for the run
errorRpcErrorOptionalStructured error for FAILED/TIMED_OUT/CANCELED runs.
usage_by_modelArray of UsageByModelOptionalPer-model breakdown of the same usage usage aggregates. Additive: usage stays the run-level total so existing consumers are unaffected, while billing keys its charges on model. Empty when the producer predates it.
turn_keystringOptionalIdentifies the conversation turn this run served: the message_id of the opening user message, resolved once at run start and stamped on every message the run emits as Message.source_user_message_id. Empty when the producer predates this field, or when the turn is unresolvable — never guess one, an empty key means "no turn attribution".

Values of status​

Lifecycle state of a workflow execution, distinct from the reason a terminal execution ended.

ValueNo.FormMeaning
WORKFLOW_STATUS_RUNNING1CanonicalThe workflow has started and has not reached a terminal outcome.
WORKFLOW_STATUS_COMPLETED2CanonicalThe workflow finished successfully.
WORKFLOW_STATUS_FAILED3CanonicalThe workflow ended because execution failed; inspect its error or end reason.
WORKFLOW_STATUS_TIMED_OUT4CanonicalThe workflow ended because its execution time limit elapsed.
WORKFLOW_STATUS_CANCELED5CanonicalThe workflow was cancelled before normal completion. This enum retains its existing CANCELED wire spelling.

Full payload model: LLMGenerationCompletedEvent.

Example​

Illustrative payload, not a captured delivery. Identifiers, tool names and outcomes are examples; omitted fields depend on the event.

{
"event_context": {
"event_name": "llm.generation_completed",
"version": "1.0",
"event_id": "d3b842c8-b19a-4205-a06f-c57cbf313582",
"correlation_id": "9d4c2e1f-27b1-4304-ae54-af7fe876df31",
"emitted_at": "2026-09-16T12:00:00Z",
"caller_key": "tenant-demo:b81d5345-c1f9-4fb9-b558-a6327c75b842",
"tenant_id": "tenant-demo",
"project_id": "default"
},
"run_id": "9d4c2e1f-27b1-4304-ae54-af7fe876df31",
"status": "WORKFLOW_STATUS_COMPLETED",
"loop_count": 1,
"duration_ms": "1250",
"usage": {
"prompt_tokens": 412,
"completion_tokens": 88,
"total_tokens": 500
}
}

Download the public reference contract for this event schema and its named example.

Document: DOC-API-EVENT-llm-generation-completed.