Add serverless-workflow library: compile CNCF Serverless Workflow DSL into LangGraph StateGraph

Proposal

Add a new serverless-workflow library under libs/ that compiles a CNCF Serverless Workflow ( GitHub - open-workflow-specification/specification: Contains the official specification for the Open Workflow Specification Domain Specific Language. It provides detailed guidelines and standards for defining, executing, and managing workflows in serverless environments, ensuring consistency and interoperability across implementations. · GitHub ) DSL document (YAML/JSON) into a LangGraph StateGraph.

Motivation

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.

Hey, @hambuger!

Interesting idea! I think this would make a great community package!

If it picks up traction, then perhaps we could consider merging into core.

Feel free to explore this and I’m excited to see what you come up with!

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.

Looking forward to your guidance!

Love the enthusiasm!

I would recommend creating this as a community package first. A project you host and own.

We have a thriving community of third-party integrations.

Feel free to share what you made here on the forums!

here it is:

It compiles a CNCF Serverless Workflow ( GitHub - open-workflow-specification/specification: Contains the official specification for the Open Workflow Specification Domain Specific Language. It provides detailed guidelines and standards for defining, executing, and managing workflows in serverless environments, ensuring consistency and interoperability across implementations. · GitHub ) YAML/JSON document into a LangGraph StateGraph: each DSL state becomes a node, and transitions / switch conditions become edges (including conditional edges). Function callables, event/callback handlers, sleep, and the expression evaluator are all pluggable.

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.