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

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