Skip to main content

ADK Dynamic Workflows

CI PyPI

Model-generated, validated workflows that can execute against Google ADK 2 or Temporal without evaluating arbitrary generated Python.

This project is an early bootstrap. The implemented vertical slice includes:

  • A strict, versioned WorkflowSpec suitable for structured LLM output
  • An ADK planner agent backed by LiteLLM structured output
  • Agent, sequence, parallel, map, condition, and bounded-repeat steps
  • Stable execution IDs for replay and caching
  • A backend-neutral asynchronous interpreter
  • An ADK 2 adapter built on Context.run_node()
  • A Temporal adapter that dispatches agent calls as child workflows

Install

uv sync

Install the Temporal adapter dependencies when needed:

uv sync --extra temporal

The official temporalio[google-adk] extra currently requires google-adk<2. This project therefore uses Temporal's core SDK and leaves the ADK 2 child-workflow implementation as the next integration milestone.

Validate A Workflow

uv run adk-dynamic-workflows validate examples/review.json

Generate A Workflow With LiteLLM

Edit the gitignored .env file with your OpenAI or OpenAI-compatible provider:

DYNAMIC_WORKFLOWS_LLM_MODEL=openai/gpt-4o-mini
DYNAMIC_WORKFLOWS_LLM_API_BASE=https://api.openai.com/v1
DYNAMIC_WORKFLOWS_LLM_API_KEY=replace-with-your-api-key

For a compatible gateway, retain LiteLLM's openai/ model prefix and replace the model name and base URL with values supported by that gateway.

Generate, review, approve, and save a workflow:

uv run adk-dynamic-workflows plan \
  "Review every file provided in the files input" \
  --agent-profile explorer \
  --agent-profile reviewer \
  --output generated-review.json

The planner uses ADK LlmAgent.output_schema to request a WorkflowSpec, then validates the result locally. It retries once with validation feedback when the provider returns a structurally invalid workflow. The generated workflow may only reference profiles passed through --agent-profile.

Execute Locally

Register the agent profiles that a generated spec is allowed to invoke, then build a normal ADK workflow:

from adk_dynamic_workflows.adk_backend import build_adk_workflow
from adk_dynamic_workflows.spec import WorkflowSpec

spec = WorkflowSpec.model_validate_json(open("examples/review.json").read())
root_agent = build_adk_workflow(
    spec,
    {
        "reviewer": reviewer_agent,
    },
)

The allowlisted registry is intentional: generated workflows select an agent profile but cannot create unrestricted agents or grant themselves new tools.

Development

uv run ruff format --check .
uv run ruff check .
uv run pyright
uv run pytest

Run the real LiteLLM integration test after configuring .env:

uv run pytest -m integration tests/integration/test_litellm_planner.py

With placeholder credentials the integration test is skipped. With configured credentials it performs a real provider request and verifies that the returned workflow is valid and uses only the requested agent profile.

Next Milestones

  1. Implement an ADK 2-compatible Temporal child workflow for one agent run.
  2. Add budget estimates, progress queries, and cancellation.
  3. Store large outputs as artifact references instead of workflow-history data.
  4. Add semantic validation for branch scope and step-output dominance.

Release files for adk-dynamic-workflows 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for adk-dynamic-workflows 0.1.0
File Size Uploaded
adk_dynamic_workflows-0.1.0.tar.gz 9.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for adk-dynamic-workflows 0.1.0
File Interpreter ABI Platform
adk_dynamic_workflows-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 23.0 kB

Release files / adk_dynamic_workflows-0.1.0.tar.gz

Download URL adk_dynamic_workflows-0.1.0.tar.gz
Size 9.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6d570806052a70f6b424514cb3c7452cd9689c8003921819a05b59de0711b61a
BLAKE2b-256 checksum
How to use checksums
0ae3e572e9d7aa2d0f5df5ce005f57d87abe20f622e76b1fd28e28c9331818c2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.

Transparency log

Release files / adk_dynamic_workflows-0.1.0-py3-none-any.whl

Download URL adk_dynamic_workflows-0.1.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
57f83ef8c4e4c0d3c90659b648e9a132352a9bf3f85c5f17dc71d2d3fa13601c
BLAKE2b-256 checksum
How to use checksums
d906beb112553e7e1e5cfd2a8520c135a43ef8a0ed638d4b3b4d3ee7331bd5f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page