7. Streaming and Multi-turn

The HelloWorld sample proves basics. Real systems need richer task state, incremental updates, and multi-turn continuation.

Why this step matters

  • Beginners see how A2A task state works in practice.
  • Developers learn how to emit status and artifact events correctly.
  • Advanced teams validate continuation and recovery behavior.

Run the LangGraph sample

  1. Configure GOOGLE_API_KEY for the sample.
  2. Start the server in the LangGraph sample directory.
  3. Run test_client.py from another terminal.

What to observe

  • TaskStatusUpdateEvent during intermediate processing.
  • TaskArtifactUpdateEvent when final outputs are produced.
  • Task continuation after input_required responses.

Multi-turn continuation pattern

  1. Client sends an initial ambiguous request.
  2. Agent returns input_required with clarification prompt.
  3. Client sends another message with the same taskId and contextId.
  4. Server continues the same task until completion.

Important v1.0 alignment

  • Do not rely on a final flag in status events.
  • Use task state transitions plus stream closure to detect completion.

Next step

Continue to 8. Next Steps .