fallbackOutput

View as MarkdownOpen in Claude

Set a top-level fallback output used when no webhook or expression matches.

Parameters

result
FunctionResultRequired

A FunctionResult defining the fallback response.

Returns

DataMap — Self for method chaining.

Example

1import { DataMap, FunctionResult } from '@signalwire/sdk';
2
3const dm = new DataMap('get_weather');
4dm.webhook('GET', 'https://api.weather.com/v1/current?q=${args.city}');
5dm.output(new FunctionResult('Weather: ${response.current.condition.text}'));
6dm.fallbackOutput(new FunctionResult('Weather service is currently unavailable.'));