Telemetry
AI agent operations

ai_agent_run_completed event schema

A terminal agent-run outcome with versioned workflow, tool summary, cost, and reviewed task result. Prompts, completions, tool arguments, and retrieved content are excluded.

Reviewed by the Telemetry product team on . Event grain, ownership, field types, privacy classification, example payload, and validation. Review standards and ownership

Question this contract answers

Which agent versions complete the intended task, require handoff, loop, or fail?

Fields
10
Required
9
Measurement path

One completed run becomes a reusable analytical contract

Emit only after the owner knows the terminal outcome, then validate the stored contract before a dashboard or evaluation workflow depends on it.

  1. 1

    Run completes

    The application knows the final status, tools, handoff, duration, tokens, and cost.

  2. 2

    Contract emitted

    Send bounded fields and approved identifiers without copying prompts or tool payloads.

  3. 3

    Fixture verified

    Inspect required types, privacy fields, retries, and one known alternate outcome.

  4. 4

    Analysis reused

    Power reviewed quality, reliability, and unit-economics SQL by feature and release.

Grain

One terminal outcome per logical agent run.

Owner

Agent orchestrator after the product outcome is determined

Emit when

After success, failure, cancellation, or human handoff becomes final.

Field contract

Typed fields with explicit privacy boundaries

Keep existing field names and types stable after production queries depend on them. Optional context should remain bounded, documented, and justified by a specific decision.

FieldTypeRequiredPrivacyMeaning
timestamp_utctimestampyesnon-sensitiveUTC time at the outcome boundary.
event_idstringyesnon-sensitiveStable unique identifier used for deduplication.
releasestringyesnon-sensitiveApplication or service version that emitted the event.
account_idstringyespseudonymousStable internal account identifier, never an email or name.
run_idstringyespseudonymousStable identifier shared by approved step-level events.
workflowstringyesnon-sensitiveVersioned product workflow handled by the agent.
statusstringyesnon-sensitiveSuccess, failed, cancelled, or human_handoff.
tool_call_countnumberyesnon-sensitiveTotal tool calls in the logical run.
estimated_cost_usdnumbernonon-sensitiveVersioned estimated provider cost allocation.
task_completedbooleanyesnon-sensitiveReviewed product-level success definition.

Synthetic JSON event

{
  "timestamp_utc": "2026-07-29T09:29:40Z",
  "event_id": "evt_agent_01",
  "account_id": "acct_8f31",
  "release": "2026.07.3",
  "run_id": "run_f28c",
  "workflow": "support_resolution_v3",
  "status": "success",
  "tool_call_count": 3,
  "estimated_cost_usd": 0.021,
  "task_completed": true
}

Privacy review

Review identifiers before ingestion

This example uses synthetic identifiers. Pseudonymous values can still be personal data, and review fields can expose business or provider context. Apply your own consent, retention, access, residency, and deletion requirements.

  • account_id: pseudonymous
  • run_id: pseudonymous

Validation checklist

Prove the contract before building a dashboard

  • Send one known ai_agent_run_completed fixture after the documented outcome boundary.
  • Verify all 9 required fields arrive with the documented types.
  • Retry the same event identifier and confirm the chosen deduplication behavior.
  • Send a controlled failure or alternate outcome when the workflow supports one.
  • Run the related SQL over a fixed window and reconcile the result to the fixture.

Common mistakes

Keep one row equal to one durable outcome

  • Emitting ai_agent_run_completed before agent orchestrator after the product outcome is determined knows the final outcome.
  • Mixing several grains in one table, which makes counts and rates ambiguous.
  • Replacing controlled categories with raw URLs, payloads, prompts, or error text.
  • Changing a field type in place after saved queries and dashboards depend on it.
  • Adding identifiers without a documented investigation, access, and retention need.

Use the contract

Query and operationalize the event

Related contracts

Send a fixture before production traffic

Create a free API key, send the synthetic event, and inspect the inferred table before connecting a live workflow.

Test this schema