What Gets Traced
Each 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
- Child workflows — nested as their own trees with the same structure
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 withoptions.disableTrace: true — see Workflow options.
Local only (recommended to start):
logs/runs/<workflowName>/<timestamp>_<workflowId>.json under your project root.
Local + remote:
All Environment Variables
| Variable | Required when | Description |
|---|---|---|
OUTPUT_TRACE_LOCAL_ON | Local tracing | Set to true to write trace files to disk |
OUTPUT_TRACE_REMOTE_ON | Remote tracing | Set to true to upload traces to S3 on run completion |
OUTPUT_REDIS_URL | Remote tracing | Redis address for correlating events before S3 upload |
OUTPUT_REDIS_TRACE_TTL | Remote tracing | TTL in seconds for Redis keys that accumulate trace events before a workflow is uploaded. Default: 7 days (604800). |
OUTPUT_TRACE_REMOTE_S3_BUCKET | Remote tracing | S3 bucket name |
OUTPUT_AWS_REGION | Remote tracing | AWS region for the bucket |
OUTPUT_AWS_ACCESS_KEY_ID | Remote tracing | AWS access key |
OUTPUT_AWS_SECRET_ACCESS_KEY | Remote tracing | AWS secret key |
OUTPUT_TRACE_HOST_PATH | Docker setups | Host path where trace files are mounted. The worker writes inside the container; this tells the API and CLI what path to report so you can open files on the host |
Reading a Trace
Each trace file is a single JSON object — the root workflow node. Every node in the tree has the same shape:| Field | Description |
|---|---|
id | Unique identifier for this node |
kind | workflow, step, evaluator, llm, or http |
name | Workflow name or activity type |
startedAt / endedAt | Unix timestamps (ms) |
input | What the node received |
output | What the node returned (absent on error) |
error | Error details with name, message, stack (absent on success) |
children | Array of child nodes (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 anerror object instead of output. The error includes the name, message, and stack trace:
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 askind: "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:- Directly — Open the JSON files at
logs/runs/<workflowName>/ - Via API — See Get workflow trace log
- Via CLI — See output workflow debug