***

title: setEnd
slug: /reference/typescript/agents/context-builder/step/set-end
description: Set whether the conversation should end after this step completes.
max-toc-depth: 3
---------------------

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

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

Set whether the conversation should end after this step completes.

## **Parameters**

<ParamField path="end" type="boolean" required={true} toc={true}>
  Whether to end the conversation after this step.
</ParamField>

## **Returns**

[`Step`][ref-step] -- Self for method chaining.

## **Example**

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

const builder = new ContextBuilder();
const ctx = builder.addContext('default');
ctx.addStep('greet').setText('Welcome the caller.');
const farewell = ctx.addStep('farewell');
farewell.setText('Thank you for calling. Goodbye!');
farewell.setEnd(true);
```