Chained Summarizer · chained-summarizer
prompt chaining
The pattern
The only straight line in the gallery — no branch, no cycle, no tool, no mount. It
exercises exactly one thing: an agent's prompt port accepting an
upstream agent's result, which is the port-level widening every longer
chain is built on.
Behind the scenes
Each agent.llm compiles to a create_agent loop added with
add_node, wired by four static edges — no conditional edge is emitted
because nothing decides anything. The compiler adds LangGraph's
__start__/__end__ terminals and a default error handler.
True and worth knowing: the smoke run kept both stages in the run's
outputs map, at 532 characters and 134 characters. A chain does not
throw the intermediate away, which is what makes a chain debuggable and a single
mega-prompt not.
Use it
$ openstategraph examples copy chained-summarizer
$ openstategraph run ./workflows/chained-summarizer "Summarise what a state machine is, then cut it to one sentence."
- Asked
- “Summarise what a state machine is, then cut it to one sentence.”
- Answered
- One sentence, no preamble — “A state machine is a model that defines a system's possible states and the rules for transitioning between them in response to inputs.”
from openstategraph import load_workflow
wf = load_workflow("workflows/chained-summarizer")
print(wf.ask("Summarise what a state machine is, then cut it to one sentence."))