Skip to content

Support running ADK agents outside Temporal workflows#1400

Open
tconley1428 wants to merge 10 commits intomainfrom
adk-outside-workflow-support
Open

Support running ADK agents outside Temporal workflows#1400
tconley1428 wants to merge 10 commits intomainfrom
adk-outside-workflow-support

Conversation

@tconley1428
Copy link
Copy Markdown
Contributor

Summary

  • Add in_workflow() fallback paths in TemporalModel, activity_tool, and TemporalMcpToolSet so ADK agents can run directly outside a Temporal workflow (e.g., local dev with adk run)
  • TemporalMcpToolSet accepts a new local_toolset parameter for direct MCP tool access outside workflows
  • Refactor McpModel test helper to extend TestModel for reusability across tests

Test plan

  • test_agent_outside_workflow — validates TemporalModel + activity_tool fallback
  • test_mcp_agent_outside_workflow — validates TemporalMcpToolSet with local_toolset delegation
  • test_mcp_toolset_outside_workflow_no_local_toolset — validates ValueError when no local_toolset provided

🤖 Generated with Claude Code

Add fallback paths in TemporalModel, activity_tool, and TemporalMcpToolSet
that detect when code is running outside a workflow (via in_workflow()) and
execute directly instead of scheduling activities. This enables local ADK
development without a Temporal worker. Includes tests for all three paths
plus the error case when no local MCP toolset is provided.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@tconley1428 tconley1428 requested a review from a team as a code owner March 30, 2026 16:45
name="test_agent",
model=TemporalModel("gemini-2.5-pro"),
tools=[
TemporalMcpToolSet(
Copy link
Copy Markdown
Contributor

@drewhoskins-temporal drewhoskins-temporal Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's also add to this snippet: registering the MCP toolset in the plugin and then sharing a function. Don't want to encourage config duplication.

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.

4 participants