Skip to main content
When you call a Compose agent, the response comes back as a Server-Sent Events (SSE) stream. Each event has a type field that tells you what happened — text being generated, a tool being called, a payment receipt, or the final result.

Why streaming

Streaming lets you show progress as it happens. Instead of waiting 10 seconds for a full response, you see the first words in under a second. For agent calls that involve tool use, you see each tool start and finish in real time.

Basic streaming

What you receive

The stream yields typed events. The most common ones: The stream also yields timing events, reasoning deltas, plan events, child agent events, and conclave events. See Stream Protocol for the complete reference.

The final result

After the stream ends, the StreamIterator resolves with a final result containing the full text, tool calls, receipt, and budget:

Aborting a stream

You can also stop a stream server-side:

Workflow streaming

Workflows stream the same way, with additional event types for step progress and agent delegation:
See Workflow Streaming for workflow-specific events.