/outputai:output-workflow-tracefrom outputai
Analyzes Output SDK workflow runs from Temporal history using `workflow debug`. Helps debug step failures, examine input/output data, understand execution flow, and investigate workflow IDs.
Ships in outputai. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill provides guidance on reading and analyzing a workflow run's Temporal history using the Output CLI. workflow debug reads Temporal directly and prints one JSON document with an entry per workflow (the run, then its child workflows), each with its history events, including step inputs, results, failures and timestamps. Long values are truncated.
npx output workflow debug <workflowId>
The output is one compact JSON document on a single line of stdout, always, so pipe it to jq (jq . to indent it) instead of reading the raw line. A failure (workflow not found, Temporal unreachable) exits non-zero with the message on stderr and nothing on stdout. Its shape:
{ "complete": true, "warnings": [], "temporal": {...},
"workflows": [
{ "workflowId", "runId", "workflowType", "status", "pendingActivities", "pendingChildren", "events": [ ...raw Temporal events... ] },
{ ...a child workflow: same fields plus "parent": { "workflowId", "runId" } }
] }
complete is false when part of the tree could not be read. Check it first, then read warnings (plain sentences naming the workflow and run). A workflow that was not read still has an entry, with events: [].workflows[0] is the run you asked for. Children follow, in the order the parent started them. A workflow that continued as new has one entry per run (same workflowId and parent, different runId; the root's runs have no parent), and each run but the last ends with EVENT_TYPE_WORKFLOW_EXECUTION_CONTINUED_AS_NEW.eventId.--run-id <runId>. Without it the latest run is read, and the entry says which run that was. The runs that continue from it are read too, so to see a whole continue-as-new chain pass its first run id.--profile <name> (from temporal.toml), or --address and --namespace.--json is accepted and ignored.- is read as a flag. Put flags first and -- before the id: npx output workflow debug --profile prod -- -Ab....Tip: Large values are always truncated (strings over 1,024 characters keep the first 1,000 and last 24, arrays keep 20 items). A marker such as ... [N more characters omitted] says what was cut. The full payload is in the Temporal UI.
Follow this checklist:
complete and warnings, then read each entry's status and pendingActivities (a stuck run shows its activity, attempt and lastFailure here)EVENT_TYPE_ACTIVITY_TASK_FAILED, EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT and EVENT_TYPE_WORKFLOW_EXECUTION_FAILEDfailure.message, failure.applicationFailureInfo.type, failure.stackTrace (first 10 lines) and failure.causescheduledEventId from the failure back to the EVENT_TYPE_ACTIVITY_TASK_SCHEDULED event, whose activityType.name is <workflowName>#<stepName> and whose input is what the step receivedEVENT_TYPE_ACTIVITY_TASK_COMPLETED events carry the resulteventTime between the scheduled, started and completed eventsA child workflow is its own entry in workflows, with a parent pointing at the workflow that started it. Events are grouped by workflow, not merged. To see what a parent and its children did at the same moment, build one timeline (each event tagged with _workflowId):
npx output workflow debug <workflowId> | jq '[.workflows[] | .workflowId as $w | .events[] | . + {_workflowId: $w}] | sort_by(.eventTime | sub("Z$"; "") | [ .[0:19], ((.[20:] // "") + "000000000")[0:9] ])'
The sort key pads the fractional seconds because Temporal drops trailing zeros, so a plain string sort can misorder events.
Open http://localhost:8080 in your browser for a visual workflow inspection:
| Error Message | Likely Cause |
|---|---|
| "incompatible schema" | Zod import issue - using zod instead of @outputai/core |
| "non-deterministic" | Using Math.random(), Date.now(), etc. in workflow code |
| "FatalError" with retry context | Try-catch wrapping step calls |
| "undefined is not a function" | Missing schema definitions |
| "workflow must be deterministic" | Direct I/O in workflow function |
| "ECONNREFUSED" or timeout | Services not running or network issues |
EVENT_TYPE_ACTIVITY_TASK_SCHEDULED: a step was scheduled (activityType.name, input)EVENT_TYPE_ACTIVITY_TASK_COMPLETED: a step finished (result)EVENT_TYPE_ACTIVITY_TASK_FAILED: a step failed after its retries (failure, retryState)EVENT_TYPE_ACTIVITY_TASK_TIMED_OUT: a step exceeded a timeoutEVENT_TYPE_WORKFLOW_EXECUTION_FAILED / _TIMED_OUT / _CANCELED / _TERMINATED: how the run endedEVENT_TYPE_CHILD_WORKFLOW_EXECUTION_STARTED: a child started (it names the child, whose events are in its own entry)Activities named __internal#... belong to the framework, not your code. Temporal records only the last attempt of an activity: earlier failed retries have no events. On a retried step, EVENT_TYPE_ACTIVITY_TASK_STARTED carries attempt and lastFailure (the failure before it), and pendingActivities[].attempt and lastFailure on the workflow's entry show the same for a step still retrying.
Each event holds its data under <eventName>EventAttributes, for example activityTaskFailedEventAttributes:
activityType.name, input.payloads[] (on the scheduled event)result.payloads[] (on the completed event)failure.message, failure.applicationFailureInfo.type, failure.stackTrace, failure.cause (on failure events)scheduledEventId, startedEventId: link an event to the events before iteventId, eventTime, eventType on every eventPayloads are decoded to plain JSON. A payload that cannot be decoded (for example an encrypted one) prints as [Undecodable Payload: <encoding>].
Scenario: Debug a failed workflow
# Get the workflow ID from runs list
npx output workflow runs list --limit 5 --json
# Failures, with their message
npx output workflow debug abc123xyz | jq -c '.workflows[] | .workflowId as $w | .events[] | select(.eventType == "EVENT_TYPE_ACTIVITY_TASK_FAILED") | { workflowId: $w, eventId, scheduledEventId: .activityTaskFailedEventAttributes.scheduledEventId, message: .activityTaskFailedEventAttributes.failure.message }'
Scenario: List the steps that ran
npx output workflow debug abc123xyz | jq -r '.workflows[] | .workflowId as $w | .events[] | select(.eventType == "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED") | "\($w) \(.activityTaskScheduledEventAttributes.activityType.name)"'
Scenario: Check the input to a specific step
npx output workflow debug abc123xyz | jq '.workflows[].events[] | select(.eventType == "EVENT_TYPE_ACTIVITY_TASK_SCHEDULED" and (.activityTaskScheduledEventAttributes.activityType.name | endswith("#processData"))) | .activityTaskScheduledEventAttributes.input'
Scenario: See why a run is stuck
npx output workflow debug abc123xyz | jq -c '.workflows[] | { workflowId, status, pendingActivities, pendingChildren }'
Scenario: Is the output complete?
npx output workflow debug abc123xyz | jq '{ complete, warnings }'
workflow-quality subagent for best practicesnpx output workflow run <workflowName> --input '<input>'npx output workflow debugWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
51 skills in this plugin
/output-build-workflowImplement an Output SDK workflow from a plan document. Use when the user asks to build, implement, or code a workflow from an existing plan, or after output-plan-workflow has produced a plan and the user is ready to build./output-credentials-editView, edit, and set encrypted credentials in an Output.ai project. Use when adding secrets, updating API keys, verifying credential values, or retrieving a specific credential./output-credentials-env-varsWire encrypted credentials to environment variables using the credential: convention. Use when setting up LLM provider keys (ANTHROPIC_API_KEY, OPENAI_API_KEY) or any env var that should come from encrypted credentials.npx claudepluginhub growthxai/output --plugin outputaiOther plugins' skills for the same job