***

title: moveStep
slug: /reference/typescript/agents/context-builder/context/move-step
description: Move an existing step to a specific position in the step order.
max-toc-depth: 3
---------------------

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

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

Move an existing step to a specific position in the step order.

## **Parameters**

<ParamField path="name" type="string" required={true} toc={true}>
  Name of the step to move.
</ParamField>

<ParamField path="position" type="number" required={true} toc={true}>
  Target index in the step order. `0` places the step first.
</ParamField>

## **Returns**

[`Context`][ref-context] -- Self for method chaining. Throws an `Error` if the step is not found.

## **Example**

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

const builder = new ContextBuilder();
const ctx = builder.addContext('default');
ctx.addStep('collect_info').setText('Collect the caller\'s information.');
ctx.addStep('confirm').setText('Confirm the details with the caller.');

ctx.moveStep('confirm', 0);
```