Serverless Workflow is a CNCF spec for describing event-driven, stateful workflows. A compiler from this DSL to LangGraph would let users author workflows in a standardized, portable format and run them on the LangGraph runtime, bridging the spec ecosystem with LangGraph’s stateful multi-actor model.
Proposed scope
Translate each DSL state into a LangGraph node and transitions / switch conditions into edges (incl. conditional edges).
Support the commonly used state types: inject, operation, switch, sleep, event, callback, foreach, parallel.
Pluggable function callables (register_function), event/callback handlers, sleeper, and expression evaluator (defaults to jq when available, else a bundled jq-subset).
New package langgraph-serverless-workflow depending only on langgraph + the serverlessworkflow.sdk + pyyaml.
Out of scope (for first pass)
subflow and other unsupported state types raise at compile time.
Full jq language (only a subset is bundled; users can plug in a real evaluator).
Open questions
Is a new top-level library acceptable, or should this live elsewhere (e.g. an integration package)?
New library implies a new serverless-workflow entry in the PR title scope allowlist — would that be acceptable?
Happy to open a draft PR with a working implementation + tests if there’s interest.
First of all, thank you for the positive feedback on this proposal!
I’ve been actively working on this feature and have a working implementation ready locally. Before I open a Pull Request, I’d like to follow the project’s contribution guidelines properly — so I’m kindly requesting to have this Discussion converted into a formal Issue (or have a new Issue created), so that I can reference it in the PR and get properly assigned.
To be transparent: I already have the code written and have tested it locally (all tests pass, linting clean). I’m more than happy to adjust the implementation based on any feedback you might have during the review — I just want to make sure I go through the correct channel first.
If you prefer, I can also create the Issue myself and link back to this Discussion — just let me know what works best for the team.
Supported state types so far: inject, operation, switch, sleep, event, callback, foreach, parallel. subflow and other unsupported types raise at compile time rather than failing silently.
Quick example:
from langgraph_serverless_workflow import ServerlessWorkflowCompiler
compiler = ServerlessWorkflowCompiler()
compiler.register_function("greet", lambda **kw: {"msg": f"hi {kw['who']}"})
graph = compiler.compile(dsl) # YAML/JSON string
print(graph.invoke({"data": {}}))
Install:
pip install langgraph-serverless-workflow
It's a thin bridge — no vendoring, just depends on langgraph + the serverlessworkflow.sdk + pyyaml. The jq package is used automatically when available for full expression support; otherwise a bundled jq-subset handles the common switch patterns.
Would love feedback, especially on:
Anything you'd want covered before considering it for the monorepo later
Edge cases in real-world Serverless Workflow specs you'd want tested
Not on PyPI yet — pip install git+https://github.com/hambuger/langgraph-serverless-workflow for now. Happy to publish if there's interest.