Runs — one invocation, one trace
A run represents a single piece of agent work: processing a user message, handling a webhook, or executing a scheduled job.withRun / with_run:
- Creates a run via
POST /v1/runs - Executes your callback
- Marks the run completed or failed
- Captures errors automatically
- Flushes the event queue before completing
What you’ll see
A new run in the dashboard with yourinputSummary, start/end timestamps, and status (completed or failed).
HTTP handlers and workers
Wrap request handlers so every incoming request gets its own run.apie.wrap() is JavaScript-only. In Python, use run_context or with_run.Manual run lifecycle
For fine-grained control, start and complete runs explicitly:Sessions — group related runs
Use sessions when multiple runs belong to one workflow: a release gate pipeline, a support escalation, or an orchestrator delegating to workers.| Kind | Use when |
|---|---|
single_agent | One agent, multiple steps in one session |
multi_agent | Multiple agents collaborating |
pipeline | Orchestrator → worker handoffs with ordered steps |
What you’ll see
A session replay timeline in the dashboard showing all runs and events in order. Open the session replay URL fromsend-test-event to see an example.
If runtime intelligence is enabled for your workspace, Apie can also generate a readable session story after the session has enough evidence. The story adds a summary, grouped timeline, action items, and guardrail recommendations while keeping the raw event timeline available as the source of truth.
See Runtime intelligence for how generated stories relate to raw events and guardrail decisions.
Next steps
Instrument tool calls
Track what tools your agent invokes inside a run.
Runtime intelligence
Understand generated session summaries, timelines, action items, and recommendations.
Multi-agent pipelines
Model orchestrator → worker handoffs.
