setEnd

View as MarkdownOpen in Claude

Set whether the conversation should end after this step completes.

Parameters

end
booleanRequired

Whether to end the conversation after this step.

Returns

Step — Self for method chaining.

Example

1import { ContextBuilder } from '@signalwire/sdk';
2
3const builder = new ContextBuilder();
4const ctx = builder.addContext('default');
5ctx.addStep('greet').setText('Welcome the caller.');
6const farewell = ctx.addStep('farewell');
7farewell.setText('Thank you for calling. Goodbye!');
8farewell.setEnd(true);