***

title: setValidSteps
slug: /reference/typescript/agents/context-builder/step/set-valid-steps
description: Set which steps the agent can navigate to from this step.
max-toc-depth: 3
---------------------

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

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

Set which steps the agent can navigate to from this step.

## **Parameters**

<ParamField path="steps" type="string[]" required={true} toc={true}>
  List of step names within the same context. Use `"next"` to allow sequential
  advancement to the next step in order.
</ParamField>

## **Returns**

[`Step`][ref-step] -- Self for method chaining.

## **Example**

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

const builder = new ContextBuilder();
const ctx = builder.addContext('default');
ctx.addStep('greet').setText('Welcome the caller.');
const step = ctx.addStep('collect_info');
step.setText('Collect the caller\'s information.');
step.setValidSteps(['process_request', 'escalate']);
ctx.addStep('process_request').setText('Process the caller\'s request.');
ctx.addStep('escalate').setText('Escalate to a human agent.');
```