Summary
When a WayFlow flow containing an InputMessageNode is called as a child agent by an orchestrator via the A2A protocol, the input-required state produced by the InputMessageNode is never surfaced to the calling orchestrator. The orchestrator's send_message always returns completed (or failed), bypassing the HITL gate entirely.
Expected behaviour (per A2A spec)
The A2A specification defines input-required as a first-class task state. An orchestrator calling a child agent via send_message should receive input-required when the child hits an InputMessageNode, allowing the orchestrator to surface the HITL to the end user before resuming the child with the collected input.
Actual behaviour
In wayflowcore/agentserver/a2a/_worker.py, when a task starts (needs_new_conv = True) and the flow contains an InputMessageStep, the worker:
- Pre-executes the conversation to reach the
InputMessageStep (flow pauses internally)
- Immediately appends the caller's incoming message to the conversation
- Executes again — the
InputMessageStep consumes the caller's message as its input
- The flow continues past the gate and eventually returns
completed
The input-required state exists only transiently in memory between steps 1 and 2. It is never persisted or returned to the calling agent; the HTTP response only arrives after full execution.
Minimal reproduction
Orchestrator (WayFlow flow with AgentNode)
└─▶ Child Agent (WayFlow flow: StartNode → OutputMessageNode → InputMessageNode → ApiNode → EndNode)
- Orchestrator calls child via
AgentNode / A2A send_message
- Child flow pre-executes to
InputMessageNode → internally input-required
- Caller's resume message (e.g.
"Approved") is appended and immediately consumed by the InputMessageNode
ApiNode executes with "Approved" as the collected input — not the actual user response
- Child returns
completed; orchestrator never sees input-required
Impact
Multi-agent workflows that rely on InputMessageNode for scoped human-in-the-loop data collection (e.g. asking the user to confirm a parameter before a long-running step) cannot function when the flow is invoked as a child agent. The gate is silently bypassed, and the caller's generic resume acknowledgment is used as the HITL input.
Suggested fix
When needs_new_conv = True and the flow contains an InputMessageStep, _worker.py should:
- Pre-execute to the
InputMessageStep
- Persist the
input-required state
- Return the
input-required response to the caller without processing the incoming message
- Only on the next
send_message call (when needs_new_conv = False and the conversation is in UserMessageRequestStatus) should the incoming message be forwarded to the InputMessageStep
This aligns with the prioritize_task / needs_new_conv = False path that already handles subsequent messages correctly.
Environment
wayflowcore 26.1.x
- A2A blocking mode
- Multi-agent orchestration (parent
Flow with AgentNode calling a child Flow containing InputMessageNode)
Summary
When a WayFlow flow containing an
InputMessageNodeis called as a child agent by an orchestrator via the A2A protocol, theinput-requiredstate produced by theInputMessageNodeis never surfaced to the calling orchestrator. The orchestrator'ssend_messagealways returnscompleted(orfailed), bypassing the HITL gate entirely.Expected behaviour (per A2A spec)
The A2A specification defines
input-requiredas a first-class task state. An orchestrator calling a child agent viasend_messageshould receiveinput-requiredwhen the child hits anInputMessageNode, allowing the orchestrator to surface the HITL to the end user before resuming the child with the collected input.Actual behaviour
In
wayflowcore/agentserver/a2a/_worker.py, when a task starts (needs_new_conv = True) and the flow contains anInputMessageStep, the worker:InputMessageStep(flow pauses internally)InputMessageStepconsumes the caller's message as its inputcompletedThe
input-requiredstate exists only transiently in memory between steps 1 and 2. It is never persisted or returned to the calling agent; the HTTP response only arrives after full execution.Minimal reproduction
AgentNode/ A2Asend_messageInputMessageNode→ internallyinput-required"Approved") is appended and immediately consumed by theInputMessageNodeApiNodeexecutes with"Approved"as the collected input — not the actual user responsecompleted; orchestrator never seesinput-requiredImpact
Multi-agent workflows that rely on
InputMessageNodefor scoped human-in-the-loop data collection (e.g. asking the user to confirm a parameter before a long-running step) cannot function when the flow is invoked as a child agent. The gate is silently bypassed, and the caller's generic resume acknowledgment is used as the HITL input.Suggested fix
When
needs_new_conv = Trueand the flow contains anInputMessageStep,_worker.pyshould:InputMessageStepinput-requiredstateinput-requiredresponse to the caller without processing the incoming messagesend_messagecall (whenneeds_new_conv = Falseand the conversation is inUserMessageRequestStatus) should the incoming message be forwarded to theInputMessageStepThis aligns with the
prioritize_task/needs_new_conv = Falsepath that already handles subsequent messages correctly.Environment
wayflowcore26.1.xFlowwithAgentNodecalling a childFlowcontainingInputMessageNode)