When an LLM workflow fails or produces bad output, you need to understand what happened — what data each step received, what the LLM returned, and where things went wrong. Tracing gives you that visibility. When tracing is enabled, each workflow run produces a trace: a tree of events showing the workflow and every step, evaluator, child workflow, LLM call, and HTTP call with their inputs, outputs, errors, and timing.
Traces are written automatically when the worker runs. You don’t need to add any instrumentation to your code — just turn tracing on and tell it where to write.
What Gets Traced
Each traced workflow execution produces a trace tree. The root is the workflow, and children are everything that ran inside it:
- Steps and evaluators — input, output (or error), start/end timestamps;
- LLM calls — the prompt name, variables, loaded config, the result, and token usage (
inputTokens, outputTokens, totalTokens);
- HTTP calls — method, URL, status code. Requests made with
@outputai/http appear as http events; workflow sendHttpRequest calls appear as internal activities;
- Internal activities — Output-managed activities such as trace destination lookup and workflow HTTP requests;
- Child workflows — nested as their own trees with the same structure
This means you can open a trace file and see the full picture: which steps ran, what the LLM received and returned, how many tokens it used, and exactly where a failure happened.
Trace files are not a secure storage boundary. They can include workflow inputs and outputs, step inputs and outputs, LLM prompts and results, activity inputs and outputs, URLs, payloads, and opt-in HTTP response bodies. Misconfigured HTTP requests can leak keys, tokens, cookies, signed URLs, or other sensitive data into trace files and Temporal history. Avoid putting secrets directly in workflow inputs, URLs, payloads, or literal headers; use the documented $ENV_VAR_NAME header placeholders for sendHttpRequest request header secrets.
Enabling Tracing
Tracing is off by default. You enable it with environment variables. Local tracing writes JSON files to disk — no extra services needed. Remote tracing uploads to S3 when a run completes (requires Redis to correlate events). You can disable trace generation for specific workflows with options.disableTrace: true — see Workflow options.
Local only (recommended to start):
Trace files appear at logs/runs/<workflowName>/<timestamp>_<workflowId>.json under your project root.
Local + remote:
All Environment Variables
AWS Credential Permissions
The worker uploads each trace to S3 when the run completes, so its credentials (OUTPUT_AWS_ACCESS_KEY_ID / OUTPUT_AWS_SECRET_ACCESS_KEY) must allow write access to the trace bucket:
The API server reads those same traces back to serve output workflow debug, cost, and dataset generate --download — see API Configuration for the read-side policy. The worker and API can share one key pair or use two identities each scoped to their own actions.
Reading a Trace
Each trace file is a single JSON object — the root workflow node. Every node in the tree has the same shape:
Step with an LLM Call
This is the most common trace shape you’ll see. The step has the LLM call as a child, so you can see exactly what prompt was loaded, what variables were passed, what the LLM returned, and how many tokens it used:
Failed Step
When a step fails, it has an error object instead of output. The error includes the name, message, and stack trace:
The parent workflow node also gets an error when the run fails, so you can see at the root level that something went wrong.
Full Workflow Trace
A complete trace puts it all together — the workflow root with all its step children:
Child Workflows
Child workflows appear as kind: "workflow" children with their own nested tree of steps:
Continue-as-New
When a workflow calls continueAsNew, the trace records "<<continued_as_new>>" as the output for that run. The new run keeps the same workflow ID but gets a new start time — each run produces its own trace file. To see the full chain, list trace files for that workflow name and match by workflow ID; sort by timestamp for order.
Accessing Traces
You can access traces in three ways:
The CLI never reads S3 itself. output workflow debug, output workflow cost, and output workflow dataset generate --download all fetch traces through the API’s trace-log endpoint, and the API reads remote traces from S3. The API’s AWS credentials therefore need s3:GetObject and s3:ListBucket on the trace bucket — see API Configuration.