***

title: swml_change_step
slug: /reference/python/agents/function-result/swml-change-step
description: Transition to a different step within the current conversation context.
max-toc-depth: 3
---------------------

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

[contextbuilder]: /docs/server-sdks/reference/python/agents/context-builder

[functionresult]: /docs/server-sdks/reference/python/agents/function-result

Transition to a different step within the current conversation context. Steps
are defined using
[`ContextBuilder`][contextbuilder] and
represent discrete stages in a workflow (e.g., "greeting", "verification",
"checkout").

## **Parameters**

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

## **Returns**

[`FunctionResult`][functionresult] — self, for chaining.

## **Example**

```python {11}
from signalwire import AgentBase
from signalwire import FunctionResult

agent = AgentBase(name="my-agent", route="/agent")
agent.set_prompt_text("You are a helpful assistant.")

@agent.tool(name="move_to_checkout", description="Transition to the checkout step")
def move_to_checkout(args, raw_data):
    return (
        FunctionResult("Moving to checkout.")
        .swml_change_step("checkout")
    )

agent.serve()
```