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

# set_initial_step

> Set which step the context starts on when entered.

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

[addstep]: /docs/server-sdks/reference/python/agents/context-builder/context/add-step

Set which step the context starts on when entered. By default, a context starts on
its first step (index `0`). When a context has a preamble step that should only run
on first entry -- for example, a greeting -- later entries via `change_context` can
skip it by setting `initial_step` to a different step name.

`initial_step` is honoured both at conversation creation (when the context is first
activated) and when switching to this context via `change_context` during the
conversation.

## **Parameters**

<ParamField path="step_name" type="str" required={true} toc={true}>
  Name of the step to start on. Must exist in this context's
  [step list][addstep]; validated by `ContextBuilder.validate()`.
</ParamField>

## **Returns**

[`Context`][ref-context] -- Self for method chaining.

## **Example**

```python {7}
from signalwire import AgentBase

agent = AgentBase(name="support", route="/support")
contexts = agent.define_contexts()

ctx = contexts.add_context("support")
ctx.add_step("greeting").set_text("Welcome the caller to support.")
ctx.add_step("triage").set_text("Ask what they need help with.")
ctx.set_initial_step("triage")  # skip greeting on re-entry

agent.serve()
```