03 โ YAML Pipelines
load_pipeline() builds a complete pipeline โ schema, state subclass, nodes,
graph, engine, and initial payload โ from one declarative YAML file.
๐ฏ Goal
Recreate the entity-resolution DAG from use case 02 purely in YAML.
๐ The YAML file
Node class paths are fully qualified (module.ClassName). The modules are
imported with importlib at load time, so they must be importable from your
runtime environment.
๐ Run it
๐ Schema short-hand
Leaf values in schema: map to Python types:
| YAML | Python |
|---|---|
str |
str |
int / float |
int / float |
bool |
bool |
dict / list |
dict / list |
bytes |
bytes |
object |
object |
None |
NoneType |
str | None |
str \| None (PEP-604 union) |
Nested schema blocks become nested Schema instances.
๐ Overriding the initial payload
Pipeline.run(payload_override=None) merges override values on top of
initial: using Payload.update โ the root payload is the override, not the
default:
๐ก Tips
- Give node names that match their
classintent โ they become the dict keys used byroots/edges. - Every node listed in
graph.roots/graph.edgesmust exist innodes:or you get aKeyError. - YAML pipelines are best for static topologies. For dynamic graphs (nodes built at import time, conditional wiring) use the programmatic API.