Add static JSON flow config example#259
Open
markbackman wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
food_ordering_staticexample that defines the entire flow graph in JSON, with aJSONFlowConfigadapter that bridges the JSON definition andFlowManager"handler": "select_pizza_order") are resolved from a namespace dict (globals()) lazily at node creation time, matching how dynamic flows workTest plan
uv run ruff format examples/food_ordering_static/passesuv run ruff check examples/food_ordering_static/passesuv run examples/food_ordering_static/food_ordering_static.py(requires API keys)🤖 Generated with Claude Code