A2A Multi-Turn Conversations
Before writing code
Fetch live docs:
- Fetch
https://a2a-protocol.org/latest/specification/for multi-turn and input-required handling - Web-search
site:github.com a2aproject A2A multi-turn input-requiredfor multi-turn protocol details - Web-search
site:github.com a2aproject a2a-samples multi-turnfor conversation examples - Fetch SDK docs for multi-turn task handling patterns
Conceptual Architecture
What Multi-Turn Means in A2A
Multi-turn conversations allow agents to have iterative exchanges within a single task. The server agent can request more input from the client, creating a back-and-forth dialogue before reaching a final result.
The input-required State
The key mechanism for multi-turn is the input-required task state:
Client sends message → Task created (submitted) Server processes → working Server needs more info → input-required (with a message explaining what's needed) Client sends follow-up → working (task continues with same taskId) Server completes → completed
How It Works
- Initial request: Client sends
message/sendormessage/streamwithouttaskId - Server processes: May transition to
input-requiredif it needs clarification - Server response: Returns the task with
input-requiredstate and a message explaining what's needed - Client responds: Sends another
message/sendwith the sametaskIdand the requested information - Server continues: Resumes processing with the additional context
- Repeat or complete: May request more input or reach a terminal state
Context Preservation
Within a multi-turn task:
- All messages are associated with the same
taskId - The server maintains the full conversation history
- Each new message from the client adds to the context
- The server can reference previous messages when processing
Patterns
Clarification Loop
Agent asks for clarification when the request is ambiguous:
User: "Book a flight" Agent: (input-required) "Where are you flying from and to? What dates?" User: "NYC to London, March 15-22" Agent: (input-required) "I found 3 options. Which do you prefer? [options]" User: "Option 2" Agent: (completed) "Booked! Confirmation #ABC123"
Progressive Refinement
Agent produces intermediate results and asks for feedback:
User: "Write a blog post about AI" Agent: (input-required) "Here's an outline. Should I proceed? [outline]" User: "Looks good, but add a section on safety" Agent: (completed) "Here's the final post. [content]"
Human-in-the-Loop
Agent defers to a human for decisions it can't make:
User: "Process this insurance claim" Agent: (input-required) "This claim requires manager approval for amounts over $10,000. Please confirm." User: "Approved" Agent: (completed) "Claim processed and approved."
Data Collection
Agent collects required information step by step:
User: "Set up my account" Agent: (input-required) "What's your email address?" User: "user@example.com" Agent: (input-required) "What subscription plan? [Basic/Pro/Enterprise]" User: "Pro" Agent: (completed) "Account created with Pro plan."
Server Implementation
The server must:
- Maintain task state across multiple requests
- Store conversation history for context
- Return clear messages when requesting input
- Handle both new tasks and task continuations
- Validate that continued tasks exist and are in the right state
Client Implementation
The client must:
- Check response task state after each call
- Detect
input-requiredand present the agent's message to the user (or auto-respond) - Send follow-up messages with the same
taskId - Handle the possibility of multiple rounds
- Know when to give up (max turns, timeout)
Best Practices
- Include clear, specific messages when entering
input-required— the client needs to know what to provide - Set maximum turn limits to prevent infinite loops
- Preserve full context across turns — don't lose earlier parts of the conversation
- Use DataPart for structured input requests (e.g., forms, multiple-choice)
- Consider timeouts for tasks waiting in
input-requiredstate - Log all turns for debugging multi-turn flows
- Handle the case where the client never responds (timeout → canceled or failed)
Fetch the specification for exact multi-turn handling rules, message continuation semantics, and state transition constraints before implementing.


