-
Notifications
You must be signed in to change notification settings - Fork 0
Example 2 Build a Sequential Pipeline
Fernando Koch edited this page Mar 30, 2026
·
3 revisions
Understand how GraphK turns several nodes into one ordered architecture.
One processing step is rarely enough. You want the session to pass through several named stages in sequence.
import graphk
pipeline = graphk.SequencePipe(
nodes=[
graphk.demo.IncrementNode("A", increment=1, target_key="total", order_key="order", response=True),
graphk.demo.IncrementNode("B", increment=2, target_key="total", order_key="order", response=True),
graphk.demo.IncrementNode("C", increment=3, target_key="total", order_key="order", response=True),
]
)
program = graphk.Program({"sequence": pipeline})
emitter = graphk.Emitter(program)
emitter.request("sequence", graphk.Session(task="sequence"))
print(emitter.response())- the program stores the sequential pipeline
- the emitter dispatches a session to that pipeline id
- each node runs in order
- every node updates the same session
This is where GraphK stops looking like a single callable and starts looking like an explicit stored execution graph.