Skip to content

Add static JSON flow config example#259

Open
markbackman wants to merge 1 commit into
mainfrom
mb/json-adapter-example
Open

Add static JSON flow config example#259
markbackman wants to merge 1 commit into
mainfrom
mb/json-adapter-example

Conversation

@markbackman
Copy link
Copy Markdown
Contributor

@markbackman markbackman commented Apr 16, 2026

Context

In moving to 1.0.0, static flows are deprecated. I'm creating this example as a draft of how to use a JSON configuration with the FlowManager. This isn't the only way to work, but it demonstrates that the underlying FlowManager is capable of working with a static flow, even though it isn't part of the API.

I'm not sure if this adapter will become part of Flows. For now, I just want to create and share an example to demonstrate a possibility.

Summary

  • Adds a food_ordering_static example that defines the entire flow graph in JSON, with a JSONFlowConfig adapter that bridges the JSON definition and FlowManager
  • Handler strings in JSON (e.g. "handler": "select_pizza_order") are resolved from a namespace dict (globals()) lazily at node creation time, matching how dynamic flows work
  • The adapter is kept as a standalone example file, not part of the library -- users can copy and adapt it for their own JSON schema and resolution strategy

Test plan

  • uv run ruff format examples/food_ordering_static/ passes
  • uv run ruff check examples/food_ordering_static/ passes
  • Manual: uv run examples/food_ordering_static/food_ordering_static.py (requires API keys)

🤖 Generated with Claude Code

Introduces a food ordering example where the flow graph is defined
entirely in JSON. A JSONFlowConfig adapter bridges the JSON definition
and FlowManager, resolving handler strings from a namespace dict
(globals()) at node creation time.
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.

1 participant