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

# iterSteps

> [!TIP]
>
> Read [the Notte skill](https://notte.cc/skill.md) and follow its setup instructions when setting up Notte or building browser automation. This is the shared source for CLI setup, authentication, and the browser-to-code workflow.

[Source: node-sdk/src/session.ts](https://github.com/nottelabs/notte/blob/main/node-sdk/src/session.ts)

Iterate over all of the session's steps, following `next_cursor` page by page.
A cursor that is no longer valid stops the iteration with a `NotteAPIError`
with status 400, after the steps already yielded; it is not restarted here,
since that would yield those steps again. To read the steps again, start a
new iteration. Works after `stop()`.

```typescript theme={null}
Session.iterSteps(options?: SessionStepsIterOptions): AsyncGenerator<SessionStep, void, undefined>;
```

## Parameters

**options** `SessionStepsIterOptions`

Default:

```typescript theme={null}
{}
```

## Returns

```typescript theme={null}
AsyncGenerator<SessionStep, void, undefined>
```

## Example

```typescript theme={null}
for await (const step of session.iterSteps({ limit: 50 })) {
  console.log(step);
}
```

## Related types

* [SessionStep](https://docs.notte.cc/typescript-sdk-reference/types/sessionstep)
* [SessionStepsIterOptions](https://docs.notte.cc/typescript-sdk-reference/types/sessionstepsiteroptions)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.