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

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