Skip to content

FunctionMethods

Experimental

Warning

Preview: This service is experimental and may change or be removed in future releases.

Methods available on function response objects. These are bound to the function data and delegate to the service.

Methods

invoke()

invoke<TInput, TOutput>(input?: TInput): Promise<TOutput>

Experimental

Invokes this function and returns its output.

Warning

Preview: This method is experimental and may change or be removed in future releases.

Type Parameters

Type Parameter Default type
TInput extends object Record<string, unknown>
TOutput unknown

Parameters

Parameter Type Description
input? TInput Input for the function, sent as the request body (or as query parameters for functions declared with the Get method). Defaults to an empty object.

Returns

Promise<TOutput>

Promise resolving to the function's output

Example

const deployed = await functions.getAll({ folderId: <folderId> });
const hello = deployed.items.find(f => f.name === 'hello');

if (hello) {
  const result = await hello.invoke({ name: 'Alice' });
}