Server SDKs
Build AI agents, control calls, send messages, and more
Set which contexts the agent can navigate to from this step. Overrides any context-level setValidContexts() for this step.
setValidContexts()
List of context names that are reachable from this step.
Step — Self for method chaining.
Step
1import { ContextBuilder } from '@signalwire/sdk';23const builder = new ContextBuilder();4const ctx = builder.addContext('default');5ctx.addStep('greet').setText('Welcome the caller.');6const step = ctx.addStep('transfer');7step.setText('Transfer the caller to the appropriate department.');8step.setValidContexts(['billing', 'support']);9builder.addContext('billing').addStep('invoice').setText('Help with billing inquiries.');10builder.addContext('support').addStep('help').setText('Help with support issues.');