updateGlobalData

View as MarkdownOpen in Claude

Set or update key-value pairs in the global session data. Global data persists for the entire agent session and is accessible in prompt variable expansion (${global_data.key}) and by all SWAIG functions.

Parameters

data
Record<string, unknown>Required

Object of key-value pairs to merge into the global data store. Existing keys are overwritten; new keys are added.

Returns

FunctionResultthis, for chaining.

Example

1import { FunctionResult } from '@signalwire/sdk';
2
3const result = new FunctionResult('Data updated.')
4 .updateGlobalData({ customer_name: 'John', status: 'verified' });