Skip to content

Implement WorkflowAgent telemetry support#15078

Merged
gr2m merged 21 commits into
mainfrom
workflow-agent-telemetry
May 8, 2026
Merged

Implement WorkflowAgent telemetry support#15078
gr2m merged 21 commits into
mainfrom
workflow-agent-telemetry

Conversation

@gr2m
Copy link
Copy Markdown
Collaborator

@gr2m gr2m commented May 7, 2026

Background

Implements stable telemetry support for WorkflowAgent as tracked in #15074.

Summary

Adds WorkflowAgent telemetry integrations, focused coverage, a Next Workflow e2e harness, and a patch changeset for @ai-sdk/workflow.

Manual Verification

/telemetry route in workflow-agent example (examples/next-workflow/app/telemetry/page.tsx)

Screen.Recording.2026-05-07.at.1.22.24.PM.mov

Run Locally

Start DevTools from the example workspace:

cd examples/next-workflow
pnpm exec devtools

Open http://localhost:4983 to inspect captured telemetry.

In a second terminal, run the Workflow example:

cd examples/next-workflow
pnpm dev

Open http://localhost:3000/telemetry and run the scenarios from the sidebar.

Checklist

  • All commits are signed (PRs with unsigned commits cannot be merged)
  • Tests have been added / updated (for bug fixes / features)
  • Documentation has been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

Related Issues

Closes #15074

gr2m and others added 9 commits May 5, 2026 10:58
Adds `runtimeContext` and `toolsContext` to `WorkflowAgent.stream` and
constructor options, plus `telemetry.includeRuntimeContext` and
`telemetry.includeToolsContext` for telemetry filtering. Tools receive
their own validated entry from `toolsContext` as `context` (validated
against `tool.contextSchema` when defined). The legacy
`experimental_context` is kept as a fallback when no `toolsContext`
entry is set.
…ntext and toolsContext

The previous `experimental_context` option (and corresponding fields on
`PrepareStepInfo`, `PrepareStepResult`, `PrepareCallOptions`,
`WorkflowAgentOptions`, `WorkflowAgentStreamOptions`, and `onFinish`)
is removed. Shared agent state now lives on `runtimeContext`; per-tool
values are passed through `toolsContext`, validated against
`tool.contextSchema` when defined.
Wire `runtimeContext` and `toolsContext` through the next-workflow
example app, validate per-tool context with `contextSchema`, and use
`telemetry.includeRuntimeContext` / `telemetry.includeToolsContext` to
scope what's exposed to telemetry. Update the WorkflowAgent docs to
cover both APIs and add a migration note from `experimental_context`.
…s-context

# Conflicts:
#	content/docs/03-agents/07-workflow-agent.mdx
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
gr2m and others added 2 commits May 6, 2026 21:31
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
gr2m and others added 2 commits May 6, 2026 21:40
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@gr2m gr2m changed the title Add WorkflowAgent telemetry e2e harness Implement WorkflowAgent telemetry support May 7, 2026
Base automatically changed from workflow-runtime-tools-context to main May 7, 2026 16:00
Co-authored-by: Cursor <cursoragent@cursor.com>
@gr2m gr2m marked this pull request as ready for review May 7, 2026 17:51
Co-authored-by: Cursor <cursoragent@cursor.com>
# Conflicts:
#	packages/workflow/src/workflow-agent.ts
@gr2m gr2m enabled auto-merge (squash) May 8, 2026 16:23
@gr2m gr2m merged commit 39dad72 into main May 8, 2026
18 checks passed
@gr2m gr2m deleted the workflow-agent-telemetry branch May 8, 2026 16:33
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

🚀 Published in:

Package Version
ai 7.0.0-canary.127
@ai-sdk/alibaba 2.0.0-canary.45
@ai-sdk/amazon-bedrock 5.0.0-canary.55
@ai-sdk/angular 3.0.0-canary.127
@ai-sdk/anthropic 4.0.0-canary.49
@ai-sdk/assemblyai 3.0.0-canary.38
@ai-sdk/azure 4.0.0-canary.53
@ai-sdk/baseten 2.0.0-canary.43
@ai-sdk/black-forest-labs 2.0.0-canary.37
@ai-sdk/bytedance 2.0.0-canary.38
@ai-sdk/cerebras 3.0.0-canary.43
@ai-sdk/cohere 4.0.0-canary.39
@ai-sdk/deepgram 3.0.0-canary.37
@ai-sdk/deepinfra 3.0.0-canary.43
@ai-sdk/deepseek 3.0.0-canary.40
@ai-sdk/elevenlabs 3.0.0-canary.37
@ai-sdk/fal 3.0.0-canary.37
@ai-sdk/fireworks 3.0.0-canary.43
@ai-sdk/gateway 4.0.0-canary.74
@ai-sdk/gladia 3.0.0-canary.37
@ai-sdk/google 4.0.0-canary.57
@ai-sdk/google-vertex 5.0.0-canary.76
@ai-sdk/groq 4.0.0-canary.40
@ai-sdk/huggingface 2.0.0-canary.43
@ai-sdk/hume 3.0.0-canary.37
@ai-sdk/klingai 4.0.0-canary.38
@ai-sdk/langchain 3.0.0-canary.127
@ai-sdk/llamaindex 3.0.0-canary.127
@ai-sdk/lmnt 3.0.0-canary.37
@ai-sdk/luma 3.0.0-canary.37
@ai-sdk/mcp 2.0.0-canary.45
@ai-sdk/mistral 4.0.0-canary.41
@ai-sdk/moonshotai 3.0.0-canary.43
@ai-sdk/open-responses 2.0.0-canary.39
@ai-sdk/openai 4.0.0-canary.53
@ai-sdk/openai-compatible 3.0.0-canary.43
@ai-sdk/otel 1.0.0-canary.73
@ai-sdk/perplexity 4.0.0-canary.40
@ai-sdk/prodia 2.0.0-canary.40
@ai-sdk/provider-utils 5.0.0-canary.36
@ai-sdk/react 4.0.0-canary.128
@ai-sdk/replicate 3.0.0-canary.38
@ai-sdk/revai 3.0.0-canary.38
@ai-sdk/rsc 3.0.0-canary.128
@ai-sdk/svelte 5.0.0-canary.127
@ai-sdk/togetherai 3.0.0-canary.43
@ai-sdk/valibot 3.0.0-canary.36
@ai-sdk/vercel 3.0.0-canary.43
@ai-sdk/voyage 2.0.0-canary.11
@ai-sdk/vue 4.0.0-canary.127
@ai-sdk/workflow 1.0.0-canary.43
@ai-sdk/xai 4.0.0-canary.56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement new telemetry APIs in WorkflowAgent

2 participants