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

Referencing Variables

Orchestrating a composite application flow and configuring connectors and processors involve various inputs, outputs, and configurations, which can be referenced as variables when you edit and design a composite application to create efficiency.

Variables of composite applications are classified as system, node, and custom variables. Variables with the same name are prioritized as follows: system variable > node variable > custom variable.

System Variables

System variables indicate system parameters or specific outputs of some connectors. Table 1 lists the system variables for composite applications.

System variable reference mode: ${Variable name}
Table 1 System variables

Variable

Description

Method

Instance ID

ID of the current instance.

${env|instance_id}

APP ID

ID of the current composite application.

${env|composed_app_id}

Workflow ID

ID of the current workflow.

${env|workflow_id}

Execution ID

ID of the workflow running record.

${env|flow_execution_id}

Execution start time

UTC time when the workflow is executed, for example, 2023-03-01T10:26:33.410Z.

${env|flow_execution_start_time}

Node Variables

The output of a previous node can be stored as a variable and referenced by subsequent nodes—for example, as the request body for an OpenAPI or the result from connectors and processors like database queries, HTTP requests, scripts, or variable assignments.

Reference methods:

  1. Variable selection: Click the variable in the data input area of a node.
  2. ${payload}: Reference the payload output of the previous connector or processor node.
  3. ${node ID|payload.xxx}: Reference the xxx value in the payload output of the specified connector or processor node.
  4. ${Node ID|parameter name}: Reference the parameter name output of the specified connector or processor node.

  1. Not all input boxes support the variable selection mode. For details, see the description of each connector.
  2. If the execution result is an object, such as a JSON or XML object, use ${payload.id} or ${payload[0].id} to reference certain data in the execution result.

Example:

If the response body received by an HTTP request node is in JSON format as follows, use ${payload} to reference the JSON data, ${payload.id} to reference the value 00000000, and ${payload.data[0].value} to reference the value x.

{
    "id":"00000000",
    "name":"sample01",
    "data":[
        {
            "id":1,
            "value":"x"
        },
        {
            "id":2,
            "value":"y"
        },
        {
            "id":3,
            "value":"z"
        }
    ]
}

Custom Variables

Custom variables include the variables configured by users.

Reference methods:

  1. Variable selection: Click available variables in the text box to choose one.
  2. Manual input: Use ${env|xxx} to reference the configured variable named xxx.
Adding variables on the canvas page
  1. Log in to the new ROMA Connect console.
  2. In the navigation pane on the left, choose Composite Applications. On the page displayed, click the target composite application.
  3. Click on the composite application and choose Modify to enter the canvas page.
  4. Click Variable on the top of the page.
  5. In the pop-up box displayed, click Add.
    Table 2 Configure variables

    Parameter

    Description

    Variable

    Enter a variable name to be referenced.

    Type

    Data type of the variable: string, integer, long integer, decimal, boolean, and password.

    Value

    Enter the value of the variable.

    Scope

    Select the effective scope of the variable: global (all composite applications); current composite application.

    Description

    Enter a description of the variable.

  6. Click Save.