Skip to content
STIRUP

TECHNOLOGY INTELLIGENCE

Understand what's next.

Multi-Agent Composition with ADK and Temporal

Multi-Agent Composition with ADK and Temporal enables the creation of complex dispatch pipelines by combining ParallelAgent and SequentialAgent components under a single Runner invocation.

Share
AI-generated conceptual illustration accompanying: Multi-Agent Composition with ADK and Temporal
AI-generated editorial illustration of the article topic; not a photograph, product screenshot or measured result.

Multi-Agent Composition with ADK and Temporal

Multi-agent composition with Google ADK and Temporal enables the creation of complex dispatch pipelines by combining ParallelAgent and SequentialAgent components under a single Runner invocation. This approach allows for structured coordination between agents, where each agent's output is stored in session state using keys such as fleet_assessment and customer_assessment. These keys ensure that downstream agents, like the Dispatch agent, can access upstream context without requiring explicit parameter passing. The integration leverages Temporal's workflow capabilities alongside ADK's agent orchestration to streamline multi-agent interactions. This method is highlighted in the recipe as a way to build scalable and maintainable agent systems. The use of session state for inter-agent communication is a key design pattern in this implementation.

Tool-as-Activity and Structured Output via Session State

Google's ADK (Agent Development Kit) and Temporal integration introduces a framework where tools are treated as activities within a multi-agent system. The activity_tool wrapper allows agents to invoke Temporal Activities, enabling structured execution and coordination. In the final agent stage, a plain Python tool is used to submit decisions, writing results into ADK session state for persistence and retrieval. This approach supports complex workflows by allowing parallel branches, such as inventory checks, credit assessments, and fraud screening, each contributing structured output via output_key for synthesis. These mechanisms ensure that agents can operate independently while maintaining coherence in decision-making processes. The use of session state and parallel agents highlights a design focused on scalability and structured data handling within distributed systems.

Sandbox-Safe ADK Imports and Workflow Configuration

In the context of Multi-Agent Orchestration using Google ADK and Temporal, sandbox-safe ADK imports are handled through the workflow.unsafe.imports_passed_through() mechanism. This allows modules such as google.adk.agents and google.genai.types to be imported without triggering rejections from the Temporal workflow sandbox. As noted in the evidence, these imports are explicitly wrapped in the imports_passed_through() context manager to ensure compatibility with the sandbox environment. The GoogleAdkPlugin registered on the worker further supports this by managing additional sandbox passthroughs and deterministic-runtime overrides, such as handling UUIDs and clocks, which are essential for ADK's operation. This configuration ensures that the workflow remains secure while still allowing the use of necessary ADK components.

Connecting to Temporal Cloud and Local Service

Connecting to Temporal Cloud or a local Temporal Service requires configuration through environment variables or the Temporal CLI. By default, without any configuration, the system connects to a local Temporal Service running at localhost:7233. To connect to Temporal Cloud, users must save their connection details as a profile using the Temporal CLI, specifying the endpoint, namespace, and API key. Once configured, the profile can be selected in each terminal session by setting the TEMPORAL_PROFILE environment variable to cloud. Verification can be done by running temporal workflow count to confirm the connection. For authentication using mTLS certificates instead of an API key, users should refer to the environment configuration documentation provided by Temporal.

TemporalModel and Activity Configuration for LLM Calls

The TemporalModel from temporalio.contrib.google_adk_agents integrates LLM calls into Temporal Activities, ensuring structured execution within workflows. As defined in workflows/assignment_workflow.py, the _fleet_agent() function initializes an Agent with a TemporalModel that specifies a task queue and summary for LLM reasoning. This setup aligns with upstream support in activity_tool (temporalio>=1.25), which handles multi-argument activities and local non-workflow ADK runs. These configurations enable more robust orchestration of AI-driven tasks, leveraging Temporal’s capabilities for reliability and scalability in distributed systems.

Sources and reporting notes

Based on published source material. No independent hands-on testing is claimed.

Read more