Execute Function

Note: Ensure you have installed the required package to use this SDK method.

A function can be executed by calling the execute() method in which the function ID and configuration (of type JSON) are passed as parameters. The functions reference used in the code snippets below is the component instance.

Create a Function Configuration (JSON)

Before executing a function, you must set the configuration required for it. Here, the configuration specifies the function arguments and their values.

An example to set the configuration is detailed in the following code snippet

copy
// Create Configuration for function Execution 
const conf = { args: { Name: 'Amelia' } }

The unique function ID is passed as a parameter to the execute() function to call the function to be executed with the necessary configuration.

The promise returned here will be resolved to an object which is a JSON. The functions reference used in the code below is the component instance.

Note: You can also pass the function name as a string to the execute() method instead of using the function ID.
copy
const functionResponse = await functions.execute(1510000000059262,conf);
console.log(functionResponse);

Last Updated 2026-07-02 14:51:41 +0530 IST