move_step

View as MarkdownOpen in Claude

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

Parameters

name
strRequired

Name of the step to move.

position
intRequired

Target index in the step order. 0 places the step first.

Returns

Context — Self for method chaining. Raises ValueError if the step is not found.

Example

1from signalwire import AgentBase
2
3agent = AgentBase(name="my-agent", route="/agent")
4
5contexts = agent.define_contexts()
6ctx = contexts.add_context("default")
7ctx.add_step("collect_info").set_text("Collect the caller's information.")
8ctx.add_step("confirm").set_text("Confirm the details with the caller.")
9
10ctx.move_step("confirm", 0)
11
12agent.serve()