Execution flow
When an agent run is triggered (via dashboard, API, or webhook):Queued
A message is sent to the execution queue (Azure Service Bus). The run status is set to Pending.
Processing
A worker picks up the message, loads the agent configuration, and sets status to Running.
LLM Loop
The agent enters a loop:
- Build the prompt (system message + conversation history + tool definitions)
- Call the LLM
- If the LLM returns a tool call → execute the tool, add the result to history, repeat
- If the LLM returns a final text response → exit the loop
- If max steps reached → exit with current output
Quality Check
If a QualityChecker system agent is configured, it evaluates the output and assigns a score.
Run metrics
Each run records:| Metric | Description |
|---|---|
| Steps Executed | Number of tool-call iterations |
| Tokens Used | Total input + output tokens across all LLM calls |
| Actions Used | Number of tool/function executions |
| Credits Used | Total credit cost based on model pricing |
| Duration | Wall-clock time from start to finish |
Step details
Each step within a run records:- Tool Name — which function was called
- Input Data — parameters passed to the tool
- Output Data — result returned by the tool
- Reasoning — the LLM’s chain-of-thought before the tool call
- Token Usage — per-step input/output tokens
- Duration — execution time in milliseconds
Hierarchical runs
Agents can invoke other agents using the InvokeAgent tool. This creates a parent-child relationship:- The parent run’s
ParentAgentRunIdlinks child runs - Child runs execute independently with their own step limits and credit tracking
- The parent agent receives the child’s final output as a tool result
Error handling
When an agent run fails:- The ErrorAnalyzer system agent (if enabled) examines the error and provides diagnosis
- The error message is stored on the run record
- Credits consumed up to the point of failure are still deducted
- LLM API timeout or rate limit
- Tool execution error
- Max steps exceeded without resolution
- Insufficient credits

