> ## Documentation Index
> Fetch the complete documentation index at: https://docs.inworld.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# GraphOutputStream

> Handles output streaming from a graph execution. Provides methods to iterate over execution results and control execution flow. **Key Features:** - Async iteration over graph execution results - Cancellation support via `abort()` - Automatic cleanup and resource management Returned by as part of the execution result.

## Examples

```typescript theme={"system"}
// With cancellation
const { outputStream } = await graph.start(input);
setTimeout(() => outputStream.abort(), 5000); // Cancel after 5 seconds

for await (const result of outputStream) {
  // Processing will stop when abort() is called
}
```

## Methods

* [next](#next)
* [abort](#abort)

***

## Methods

### next

```typescript theme={"system"}
next(): Promise<GraphOutputStreamResponse<any>>
```

Gets the next result from the execution.

#### Returns

`Promise<GraphOutputStreamResponse<any>>`

### abort

```typescript theme={"system"}
abort(): void
```

Cancels the graph execution and stops processing. This method immediately aborts the ongoing graph execution, canceling any pending operations including LLM generation, TTS synthesis, and custom node processing. The cancellation propagates through the entire execution graph. **Use Cases:** - User-initiated cancellation (e.g., stop button) - Timeout handling - Early termination based on conditions - Resource cleanup **Behavior:** - Safe to call multiple times (subsequent calls are no-op) - Stops all async operations in the graph - Causes streams to end early - Triggers cancellation context in custom nodes (`context.isCancelled`)

#### Returns

`void`
