Skip to content

How to trace, debug and evaluate agentic workflows

An agentic workflow is a process where an LLM decides which steps and tools to use. You debug and evaluate it by tracing each run and checking the outcome against the user's goal, not just whether each step returned success.

By Arun Prasad · Published · Last updated

On this page

Why agentic workflows matter

When the model picks the steps, a run can pass every step check and still miss what the user wanted. Ordinary request monitoring can't tell you which of those two things happened.

AI agents don't fail like normal software. A tool can return a 200 and the task can still fail. Picture a hypothetical support agent that calls a refund tool, gets a 200 back, and refunds the wrong order. Standard monitoring shows the request went through. It doesn't show whether the answer was right.

The steps below cover what to trace, how to debug from the trace, and how to evaluate the workflow.

Step 1: Decide whether you need an agentic workflow

Use an agentic workflow when the path to the answer can't be fixed in advance. Use a fixed pipeline when you already know the steps. This choice decides how much you need to trace.

In a fixed pipeline, the same steps run in the same order, so a failure is usually in one known step. In an agentic workflow, the model chooses tools, order and retries at run time. Two runs of the same request can take different paths, and a failure can sit in a choice the model made rather than in a step you wrote.

In practice, a fixed pipeline is easier to test and has fewer places to fail. Reach for an agentic workflow only when the variation in paths is the point.

The rest of this guide assumes you have an agentic workflow, or are about to ship one.

Step 2: Trace every run, tool call and session

Send a trace for every run, and give multi-turn conversations a shared session ID. Without that, you can see single requests but not what the workflow did across a conversation.

In PRISM by Block Convey, Agent Observability has four connected views:

  • Traces: per-run request, response, model, cost, timing and scores.
  • Sessions: the multi-turn journey and drift.
  • Agent Runs: steps, tool calls, retries, handoffs and state.
  • Scores & Alerts.

These views show what your integration sends. If your code doesn't send tool calls or handoffs, they won't appear.

Traces that share a session_id form one conversation. Sessions can't be backfilled, so set the ID before you go live, not after.

Pick the integration that matches how you build:

  • Frameworks: LangChain (PRISMtraceCallbackHandler), LangGraph (wrap_langgraph), Google ADK (PRISMtraceADKAdapter, labeled Beta in the SDK), LiteLLM, and OpenAI Agents SDK (labeled Preview in the SDK).
  • Python SDK: pip install "prismtrace-sdk>=0.5.1", then import prismtrace. Reading a framework's own conversation ID (LangGraph thread_id, ADK session_id) needs version 0.5.0 or later.
  • Other languages: the SDK is Python only. For TypeScript/JavaScript, Go or Java, use the HTTP API or OpenTelemetry.

Step 3: Debug an agentic workflow when something goes wrong

Debugging starts by finding the run that failed, reading its steps in order, and checking the outcome against the user's goal, not just span status. Then look for the same failure in other sessions, so you fix the most common cause first.

  • Open the run. In Agent Runs, read the steps, tool calls, retries and handoffs in order. Look for the step where the run left the path the user needed, not only for steps that errored. A step can succeed and still be the wrong step.
  • Check the outcome against the goal. PRISM tracks the outcome against the user's goal, not just span status. A run with every span marked successful can still be a failed run.
  • Look for the pattern. PRISM groups repeated failures into patterns and shows how many sessions share each one. A pattern shared by many sessions is usually a better first fix than a one-off.
  • Find the likely cause. AI Remediation traces a failure to a likely cause. The possible causes are the prompt, a missing source, retrieval, stale state, tool choice, a parameter, a guardrail or a workflow step. It is a likely cause, not a certain one, so check it against the trace.

Do this in order. If you can't see the steps, you can only guess which one failed.

Step 4: Evaluate your agentic workflow over time

Evaluation means checking your workflow against criteria you define, deterministic rules that always give the same verdict, plus an LLM judge for quality questions rules can't answer. Watch the scores as live traffic comes in.

Evaluators in PRISM are reusable criteria run on real runs. There are two kinds:

  • Deterministic rules give the same verdict for the same input. No model is involved, and they run on 100% of sessions.
  • LLM-as-judge means a model reads the exchange. It is not sampled: it scores every incoming trace until your plan's daily allowance runs out. After that, only the deterministic rules run.

Each verdict links to the rule, the span, the source checked and the reason, so you can check a score instead of taking it on trust. Core scores are on the Free plan. Custom evaluators and the Evaluators Hub need Builder or above.

Two limits to plan around:

  • Evaluators score incoming traffic. To see whether a change helped, you need new traffic after the change. Step 5 covers how PRISM compares before and after.
  • Traces sent with content-free ingest get no LLM-judge scores.

If the LLM-judge allowance runs out before the day does, you are down to the deterministic rules for the rest of it. Choose your deterministic rules so they cover the failures you care about most.

Step 5: Fix the cause and check the result

You check a fix by comparing results from before and after it merged. Don't assume a fix worked because it looked right.

AI Remediation suggests changes to prompts, retrieval, Knowledge Base content, guardrails, workflow state and tool use. It produces a backlog where each item has a severity, suggested fix, owner, expected impact and status.

Nothing ships without human sign-off. For code changes, PRISM opens a draft pull request only if your team has turned remediation on and granted write access, and only if at least 80% of replays pass. A person reviews and merges it. Prompt changes are versioned, diffable and reversible, and each approval is attributed to a named person.

After a fix is merged, PRISM compares pass rates for the 7 days before and the 7 days after the merge. That window is short, so a low-traffic workflow may not show a clear difference. Treat the comparison as evidence, not proof.

How this looks in production

If your agent isn't built on a supported framework, OpenTelemetry is one way to send its traces to PRISM. Group the turns of a conversation by declaring a session attribute yourself.

PRISM accepts OTLP trace export at /api/otlp over http/protobuf or http/json. gRPC is not served. It groups turns into a session only from attributes you declare: gen_ai.conversation.id, session.id or prismtrace.session_id. PRISM does not infer sessions. If you send none of them, each trace stands alone.

Example (settings only; check names against the docs before use):

Example · text
endpoint:   https://api.prism.blockconvey.com/api/otlp
protocol:   http/protobuf        # or http/json; gRPC is not served
auth:       <key header from /docs>: pt-sk-...   # key shown once when created
attribute:  session.id = "<your conversation ID>"   # same value on every turn

The API key (pt-sk-…) is shown once when you create it, so store it when you do. The main API host is api.prism.blockconvey.com.

Once traces arrive, the Traces, Sessions and Agent Runs views described in Step 2 show each run's model, cost, timing, tool calls, retries and handoffs. Sessions group the turns you tagged with the same session_id, so you can follow a multi-turn conversation from start to finish. The views contain only what your instrumentation sends.

To see your own workflow's runs, tool calls and sessions, send traces from it to PRISM.

Common mistakes

Five ways teams go wrong with agentic workflows, each with the fix.

  • Trusting step status instead of the outcome. Every span can succeed while the task fails. Fix: check the outcome against the user's goal, as in Step 3, not only span status.
  • Not sending a session ID. Without a shared session_id, the turns of one conversation can't be grouped, and sessions can't be backfilled. Fix: set the session ID in your integration before you go live.
  • Assuming the LLM judge samples, or re-runs past traffic. It scores every incoming trace, not a sample, until your plan's daily allowance runs out. After that only the deterministic rules run. Fix: put your most important checks in deterministic rules, and watch your allowance.
  • Treating a fix as working without a before-and-after comparison. A change that looks right can leave the failure rate where it was. Fix: use the 7-day before and after pass-rate comparison from Step 5, and allow for low traffic.
  • Expecting PRISM to change your code unprompted. PRISM opens a draft pull request only when remediation is turned on, write access is granted and at least 80% of replays pass; a person reviews and merges it. Fix: assign someone to review and merge, and decide in advance who that is.

Trace your first agentic workflow

Connect your agent and see its runs, tool calls and sessions.

Free plan available.