***

title: Step
slug: /reference/typescript/agents/context-builder/step
description: An individual step in a conversation context with prompt, criteria, and navigation.
max-toc-depth: 3
---------------------

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

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

[addbullets]: /docs/server-sdks/reference/typescript/agents/context-builder/step/add-bullets

[addgatherquestion]: /docs/server-sdks/reference/typescript/agents/context-builder/step/add-gather-question

[addsection]: /docs/server-sdks/reference/typescript/agents/context-builder/step/add-section

[clearsections]: /docs/server-sdks/reference/typescript/agents/context-builder/step/clear-sections

[setend]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-end

[setfunctions]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-functions

[setgatherinfo]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-gather-info

[setresetconsolidate]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-consolidate

[setresetfullreset]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-full-reset

[setresetsystemprompt]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-system-prompt

[setresetuserprompt]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-user-prompt

[setskiptonextstep]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-skip-to-next-step

[setskipuserturn]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-skip-user-turn

[setstepcriteria]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-step-criteria

[settext]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-text

[setvalidcontexts]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-valid-contexts

[setvalidsteps]: /docs/server-sdks/reference/typescript/agents/context-builder/step/set-valid-steps

A Step represents a single phase within a
[`Context`][context]. Each step
has its own prompt text, completion criteria, available functions, and navigation
rules. The AI advances through steps automatically when criteria are met.

You create steps by calling `addStep()` on a Context object. All setter methods
return `this` for fluent method chaining.

## **Properties**

<ParamField path="name" type="string" required={true} toc={true}>
  Step name. Must be unique within the parent context.
</ParamField>

## **Methods**

<CardGroup cols={3}>
  <Card title="addBullets" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/add-bullets">
    Add a POM section with bullet points to the step.
  </Card>

  <Card title="addGatherQuestion" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/add-gather-question">
    Add a question to this step's gather info configuration.
  </Card>

  <Card title="addSection" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/add-section">
    Add a POM section to the step.
  </Card>

  <Card title="clearSections" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/clear-sections">
    Remove all POM sections and direct text from this step.
  </Card>

  <Card title="setEnd" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-end">
    Set whether the conversation should end after this step completes.
  </Card>

  <Card title="setFunctions" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-functions">
    Set which SWAIG functions are available during this step.
  </Card>

  <Card title="setGatherInfo" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-gather-info">
    Enable structured info gathering for this step.
  </Card>

  <Card title="setResetConsolidate" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-consolidate">
    Set whether to consolidate conversation history on context switch.
  </Card>

  <Card title="setResetFullReset" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-full-reset">
    Set whether to fully reset conversation history on context switch.
  </Card>

  <Card title="setResetSystemPrompt" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-system-prompt">
    Set a new system prompt for context switching from this step.
  </Card>

  <Card title="setResetUserPrompt" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-reset-user-prompt">
    Set a user message to inject when this step triggers a context switch.
  </Card>

  <Card title="setSkipToNextStep" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-skip-to-next-step">
    Automatically advance to the next step without evaluating criteria.
  </Card>

  <Card title="setSkipUserTurn" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-skip-user-turn">
    Skip waiting for user input when entering this step.
  </Card>

  <Card title="setStepCriteria" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-step-criteria">
    Define when this step is considered complete.
  </Card>

  <Card title="setText" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-text">
    Set the step's prompt text directly.
  </Card>

  <Card title="setValidContexts" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-valid-contexts">
    Set which contexts the agent can navigate to from this step.
  </Card>

  <Card title="setValidSteps" href="/docs/server-sdks/reference/typescript/agents/context-builder/step/set-valid-steps">
    Set which steps the agent can navigate to from this step.
  </Card>
</CardGroup>

## **Example**

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

const builder = new ContextBuilder();
const ctx = builder.addContext('default');

const step = ctx.addStep('collect_info');

// Structured prompt with POM sections
step.addSection('Task', 'Collect the caller\'s account information.');
step.addBullets('Required Information', [
  'Full legal name',
  'Account number (10 digits)',
  'Reason for calling',
]);

// Completion criteria
step.setStepCriteria(
  'Complete when all three pieces of information have been collected and confirmed with the caller.'
);

// Only allow relevant functions
step.setFunctions(['lookup_account', 'verify_identity']);

// Navigation
step.setValidSteps(['process_request', 'escalate']);
```