Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Composes LangGraph 1.0 Python subgraphs with shared state keys, Send/Command dispatch, callback scoping, and per-subgraph recursion limits.
54% 92%+38 ptsof test cases passed
Passed 22 of 24 test cases with the skill, and 13 of 24 without it.
We want to unit test a data extraction subgraph in isolation before adding it to a master orchestrator graph. The developer suggests testing it by embedding it in a mock parent graph. What is the recommended pattern for testing subgraphs individually?
Isolation unit tests verify state updates using FakeListChatModel and an in-memory checkpointer.
3 of 3 safety checks passed
A parent StateGraph invokes a compiled child subgraph as a node. The child
node writes state["answer"] = "42" and returns. The parent's next node reads
state["answer"] and gets None. No error, no warning, no deprecation notice —
just a silent None that surfaces as a wrong answer three nodes later when the
router picks the "couldn't find it" branch.
The cause is pain-catalog entry P21: LangGraph subgraphs run on an
independent state schema. Only keys declared in both the parent's
TypedDict and the child's TypedDict propagate across the subgraph boundary.
answer existed in the child schema but not the parent schema, so it was
discarded on return. The fix is to declare answer in both schemas (with
matching reducers, if the field is a list) or to use explicit
Command(graph=ParentGraph, update={"answer": "42"}) to bubble it up.
The second silent failure waits one step further. Attach a tracing callback to
the parent runnable via parent.with_config(callbacks=[tracer]) and invoke.
The tracer fires on parent nodes and never on child tool calls. This is
pain-catalog entry P28: LangGraph creates a fresh runtime per subgraph, so
callbacks bound at definition time do not inherit. The fix is to pass
callbacks at invocation time via config["callbacks"], which does propagate.
This skill walks through the shared-state contract, three dispatch patterns
(compiled subgraph as a node, Send fan-out, Command(graph=Parent) bubble-up),
callback scoping, per-subgraph recursion_limit budgets, and a testing pattern
that exercises every subgraph in isolation before composition. Pin:
langgraph 1.0.x, langchain-core 1.0.x. Pain-catalog anchors: P21, P28,
with supporting references to P18 (reducers), P19 (stream modes on nested
graphs), and P55 (recursion budget).
A planner-executor is typically 1 parent + 2-4 subgraphs; a hierarchical
agent team with a supervisor and N specialists is 1 parent + N subgraphs.
Each subgraph has its own independent recursion_limit (default 25) — a parent
at step 20 can still invoke a child that runs 25 of its own steps.
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.