Skip to content

Repository files navigation

Resumable LangGraph pipeline — minimal example

A five-node LangGraph pipeline over a text file, where every node checks whether its own output artifact already exists on disk and returns early if it does. Resumability is what falls out of that rule.

There is no API key, no network call and no cost: the "model" is a deterministic stub in resumable/fake_llm.py.

uv sync
uv run python demo_resume.py
uv run python demo_add_output.py
  • demo_resume.py crashes a run on the 4th model call, then calls the same entrypoint again. It plants a sentinel in the first finished summary to prove the completed work was not redone.
  • demo_add_output.py takes a completed run, enables an output that was switched off at submit time, and re-runs it. Exactly one model call happens.

Runs are written to runs/<run_id>/ and are gitignored.

File What it holds
resumable/graph.py The linear graph and the single run/resume entrypoint
resumable/nodes.py The five artifact-first nodes
resumable/store.py Run directory layout and atomic state writes
resumable/chunking.py Word-window chunking with overlap
resumable/fake_llm.py Deterministic offline stand-in for a model

About

A five-node LangGraph pipeline over a text file, where every node checks whether its own output artifact already exists on disk and returns early if it does.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages