***

title: move_step
slug: /reference/python/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/python/agents/context-builder/context

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

## **Parameters**

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

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

## **Returns**

[`Context`][ref-context] -- Self for method chaining. Raises `ValueError` if the step is not found.

## **Example**

```python {10}
from signalwire import AgentBase

agent = AgentBase(name="my-agent", route="/agent")

contexts = agent.define_contexts()
ctx = contexts.add_context("default")
ctx.add_step("collect_info").set_text("Collect the caller's information.")
ctx.add_step("confirm").set_text("Confirm the details with the caller.")

ctx.move_step("confirm", 0)

agent.serve()
```