Skip to main content

Model-generated, backend-neutral dynamic workflows for Google ADK

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adk_dynamic_workflows-0.1.0.tar.gz (9.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adk_dynamic_workflows-0.1.0-py3-none-any.whl (13.2 kB view details)

Uploaded Python 3

File details

Details for the file adk_dynamic_workflows-0.1.0.tar.gz.

File metadata

  • Download URL: adk_dynamic_workflows-0.1.0.tar.gz
  • Upload date:
  • Size: 9.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for adk_dynamic_workflows-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6d570806052a70f6b424514cb3c7452cd9689c8003921819a05b59de0711b61a
MD5 14a71f87e13a9cf18aae06a677b55cc7
BLAKE2b-256 0ae3e572e9d7aa2d0f5df5ce005f57d87abe20f622e76b1fd28e28c9331818c2

See more details on using hashes here.

Provenance

The following attestation bundles were made for adk_dynamic_workflows-0.1.0.tar.gz:

Publisher: publish.yml on manojlds/adk-dynamic-workflows

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file adk_dynamic_workflows-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for adk_dynamic_workflows-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 57f83ef8c4e4c0d3c90659b648e9a132352a9bf3f85c5f17dc71d2d3fa13601c
MD5 5c7c4d028e3696481f49a21322945ffc
BLAKE2b-256 d906beb112553e7e1e5cfd2a8520c135a43ef8a0ed638d4b3b4d3ee7331bd5f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for adk_dynamic_workflows-0.1.0-py3-none-any.whl:

Publisher: publish.yml on manojlds/adk-dynamic-workflows

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page