Updated on 2025-08-19 GMT+08:00

Configuring a Function Component

Function flows support the function component. You can associate a created function with the component to meet service requirements.

Notes and Constraints

  • Function flows created in Data Workroom (DWR) can only be viewed on the FunctionGraph console; editing and deletion must be done within DWR.
  • The data returned by the configured function must be in JSON format. Otherwise, it cannot be parsed.
  • Synchronous invocation does not support long-term running functions and is max. 15 minutes.
  • Asynchronous invocation supports long-term running functions. The max. duration of a function node is the same as that supported by FunctionGraph.
  • A flow can have zero to 99 functions.
  • A function connected to an error handling node can be connected to another node that is not start or error handling.
  • A function that is not connected to an error handling node can be connected to only one non-start node.

Prerequisites

Configuration Description

Click the function node to edit it. Set the function parameters. For details, see Table 1.
Figure 1 Configuring a function node
Table 1 Function parameters

Parameter

Description

App

App to which the desired function belongs. You can create multiple functions under an app.

Function

Function you want to use.

Version

Function version you want to use.

CallMode

Required when creating a standard flow. By default, function nodes in a flow are invoked synchronously.

Function Parameters

Key-value pairs passed for executing a function. Set constants, or obtain values from the input defined during function flow startup or the output of the former node using a JSONPath expression. To include sensitive information such as passwords, encrypt them first to prevent leakage.

Parameters that will be passed in JSON format in the body.

Key: parameter name

Value: parameter value

DefaultValue: used if no value is specified for the parameter

Operation: to edit or delete the parameter

Input Filter Expression

JSONPath expression used to filter the input information of the node.

Output Filter Expression

JSONPath expression used to filter the output information of the node.

Turn on StandbyOperation

When enabled, the current node name cannot be the same as other function node names.

Example

This section uses Python 3.9 to demonstrate function implementation. The code and function are shown below. For detailed instructions on creating functions, see Creating a Function from Scratch.

Function: Returning the value of the event input
import json
def handler (event, context):
    input = event.get('input',0)
    return {
        "result": input
        }