Skip to content
Proud to collaborate with Microsoft for Startups

data.chat.engine.runs.summarize-failure ​

Structured failure summary for a workflow engine run, used by the chat layer to narrate failures without re-querying the engine.

Summarize a failed workflow engine run for chat-layer narration.

Inputs (ADR-015):

  • organization_id: Organization UUID (required, string).
  • user_id: User UUID (required, string). Must be a member of the organization or the call is rejected as unauthorized.
  • workflow_uuid: Workflow run identifier (required, string UUID). The engine stores this as the per-run id assigned at engine.start() time.

Outputs (ADR-015 — terminal state_data on success):

  • workflow_uuid: Echoed workflow UUID (str).
  • workflow_type: Registered workflow name (str, e.g. "user.onboarding").
  • status: One of "pending" | "running" | "completed" | "failed". Only "failed" produces meaningful summary fields; for other statuses summary fields are null.
  • failed_at: ISO-8601 timestamp of the failure (str | null).
  • failed_state: Name of the state that captured the failure (str | null).
  • failure_reason: Controlled-vocabulary reason from the engine (str | null).
  • error_group_ref: Lumen-correlated group id, if any (str | null). Note: Lumen ids are usually integer hashes server-side; we surface them as strings for shape stability.
  • error_group_count: How many times the same error pattern has occurred org-wide (int). 0 when unknown / Lumen unavailable.
  • related_runs: List of recent other runs hitting the same error_group_ref, capped at 5. Each entry: {workflow_uuid, workflow_type, failed_at (iso)}.
  • last_state_data: state_data at the moment of failure (dict | null). Truncated to <= 4096 bytes total JSON; when truncated, __truncated=True is set.
  • transition_chain: Ordered list of state names traversed before the failure (most recent last). Empty when the run is not in a failed status.

Failure vocabulary (raised as WorkflowBusinessError with stable codes):

  • organization_not_found_or_unauthorized
  • workflow_run_not_found
  • validation_failed

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-chat
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
organization_uuiduuidYes—Organization UUID (string form)
user_uuiduuidYes—User UUID (string form) — must be a member of the org
workflow_uuiduuidYes—Workflow run identifier (string UUID)

Output Schema ​

FieldTypeRequiredDefaultDescription
workflow_uuiduuidYes—Echoed workflow id
workflow_typestringYes—Registered workflow name
statusstringYes—One of "pending"
failed_atstringNo—ISO-8601 timestamp of the failure (null when not failed)
failed_statestringNo—Name of the state that captured the failure
failure_reasonstringNo—Controlled-vocabulary reason from the engine
error_group_refstringNo—Lumen-correlated group id (string form), or null
error_group_countintegerYes—Org-wide occurrence count of the same error pattern
related_runslistYes—Other recent runs hitting the same error_group_ref (capped at 5)
last_state_datadictNo—state_data at failure (truncated to <= 4096 bytes; sets __truncated=True when truncated)
transition_chainlistYes—Ordered state names traversed before failure (most recent last)
errorstringNo—Error message when query failed
error_typestringNo—Error class name when query failed

States ​

StateInitialTerminalSuccessAuto-advanceDescription
doneYesYesYes——

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "data.chat.engine.runs.summarize-failure",
  "initial_data": {
    "organization_uuid": "value",
    "user_uuid": "value",
    "workflow_uuid": "value"
  }
}