moveStep

View as MarkdownOpen in Claude

Move an existing step to a specific position in the step order.

Parameters

name
stringRequired

Name of the step to move.

position
numberRequired

Target index in the step order. 0 places the step first.

Returns

Context — Self for method chaining. Throws an Error if the step is not found.

Example

1import { ContextBuilder } from '@signalwire/sdk';
2
3const builder = new ContextBuilder();
4const ctx = builder.addContext('default');
5ctx.addStep('collect_info').setText('Collect the caller\'s information.');
6ctx.addStep('confirm').setText('Confirm the details with the caller.');
7
8ctx.moveStep('confirm', 0);