LangGraph runtime does not enforce EndNode output schema constraints
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 420
- Forks
- 60
- Avg merge
- 9h 30m
- Merged PRs (30d)
- 4
Description
The LangGraph Agent Spec runtime does not enforce the schema declared on an EndNode when returning the final flow output.
A minimal flow was created with:
- A permissive
StartNodeschema, allowing the test payload to enter the flow. - A strict
EndNodeschema requiring:nameprofileprofile.scoreprofile.activeprofile.tags
- A direct
DataFlowEdgefrom theStartNodepayload to theEndNode.
The serialized Agent Spec correctly contains the strict schema on the EndNode, including:
{
"required": ["name", "profile"],
"properties": {
"profile": {
"required": ["score", "active", "tags"]
}
}
}
Valid case
The following payload conforms to the EndNode schema:
{
"name": "Ada",
"profile": {
"score": 0.98,
"active": true,
"tags": ["verified", "structured"]
}
}
Both LangGraph and Wayflow successfully return this payload.
Invalid case
The following payload is intentionally missing the required nested field profile.active:
{
"name": "Ada",
"profile": {
"score": 0.98,
"tags": ["verified", "structured"]
}
}
The permissive StartNode allows this value to enter the flow. The value then reaches an EndNode whose declared schema requires profile.active.
Expected Behavior
The runtime should reject the value at the EndNode boundary because it does not conform to the EndNode's declared output schema.
The invalid value should not be returned as a successful flow output.
Actual Behavior
LangGraph
LangGraph accepts the invalid value and successfully completes the flow:
AgentSpecFinishedExecutionStatus(
outputs={
"payload": {
"name": "Ada",
"profile": {
"score": 0.98,
"tags": ["verified", "structured"]
}
}
},
agent_messages=[]
)
No validation error is raised even though the returned value violates the EndNode schema.
Wayflow
Wayflow rejects the same value with a TypeError because it does not satisfy the expected ObjectProperty.
This is the expected behavior.
Runtime Comparison
| Runtime | Valid payload | Missing profile.active |
|---|---|---|
| Wayflow | Accepted | Rejected |
| LangGraph | Accepted | Accepted |
| Expected | Accepted | Rejected |
Impact
An Agent Spec flow executed by the LangGraph runtime can successfully return values that violate the schema explicitly declared by its EndNode.
This makes the EndNode output contract unenforced and produces different behavior for the same Agent Spec across runtimes.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the LangGraph runtime's EndNode handling and the final flow-output path, then compare how the Wayflow runtime validates the same boundary. Add a regression case using the invalid payload with missing profile.active and verify that the runtime rejects it rather than returning a successful output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100