> For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

# setInitialStep

> Set which step the context starts on when entered.

[ref-context]: /docs/server-sdks/reference/typescript/agents/context-builder/context

Set which step the context starts on when entered. By default, a context
starts on its first step (index 0). Use this to skip a preamble step on
re-entry via `change_context`.

The step name is validated by `ContextBuilder.validate()` — the target step
must exist in this context or validation throws.

## **Parameters**

<ParamField path="stepName" type="string" required={true} toc={true}>
  The step to start on when the context is entered. Must be an existing step
  in this context.
</ParamField>

## **Returns**

[`Context`][ref-context] — self for method chaining.

## **Example**

```typescript {7}
import { ContextBuilder } from '@signalwire/sdk';

const builder = new ContextBuilder();
const billing = builder.addContext('billing');
billing.addStep('greeting').setText('Welcome to billing.');
billing.addStep('verify').setText('Please verify your account.');
billing.setInitialStep('verify'); // skip the greeting on re-entry
```