> For the complete documentation index, see [llms.txt](https://docs.maiagent.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/teams/traces.md).

# Team execution traces

Teams automatically hand off and delegate between agents, and the process is seamless to users. **Execution traces** let you go back and review "which agents were involved and how many resources each consumed" for every conversation, helping you confirm the team is dividing work as expected and making it easy to troubleshoot and optimize.

## <mark style="color:blue;">1. View execution traces</mark> <a href="#view-traces" id="view-traces"></a>

In the team page, switch to the <mark style="color:blue;">Execution Traces</mark> view to see a list of every execution for this team. Each record includes:

| Field           | Description                                                                        |
| --------------- | ---------------------------------------------------------------------------------- |
| **Trace ID**    | The unique identifier for this execution.                                          |
| **Status**      | "Running," "Completed," "Failed," or "Timed out."                                  |
| **Iterations**  | The total number of back-and-forth exchanges between agents during this execution. |
| **Token count** | The total token usage for this execution.                                          |
| **Duration**    | The total time from receiving the message to completing the response.              |

## <mark style="color:blue;">2. Expand step details</mark> <a href="#step-detail" id="step-detail"></a>

Expanding a single record reveals the **Step Details** — which agent nodes this execution **passed through in order**, along with the details of each step:

| Item               | Description                                                                                                                                   |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| **Step number**    | Which step this is in the overall flow and which agent executed it.                                                                           |
| **Input**          | A summary of the content this agent received at this step.                                                                                    |
| **Output**         | A summary of the content this agent produced at this step.                                                                                    |
| **Cost breakdown** | The token usage for this step (input tokens, output tokens, embedding tokens), letting you see exactly which agent the cost is attributed to. |

{% hint style="info" %}
**Not seeing any traces?** Execution traces are only generated after the team is actually triggered by a conversation. If the list shows "No execution traces yet," chat with the team through the channel first, then come back to check.
{% endhint %}

## <mark style="color:blue;">3. How to use these traces to optimize your team</mark> <a href="#optimize" id="optimize"></a>

* **Routing not as expected**: If questions are being sent to the wrong agent, go back to the [canvas orchestration](/maiagent-user-guide/maiagent-user-guide-en/teams/setup.md#compose-canvas) and adjust the connection's "trigger condition description" to be more explicit about "when to use this connection."
* **Iterations or duration too high**: Agents may be handing off back and forth too many times. Check for unnecessary connections, or adjust the team's "max iterations" and per-node settings.
* **Cost concentrated on one agent**: Use the "cost breakdown" to find the agent consuming the most tokens, and consider switching it to a lighter model or narrowing its knowledge base and tool scope.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.maiagent.ai/maiagent-user-guide/maiagent-user-guide-en/teams/traces.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
