Skip to main content
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. Every 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 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
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.

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

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: