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

Orchestrating a Flow

Function

This API is used to orchestrate a flow. You can execute a flow step by step, including starting the flow, running the flow, performing the next or previous step, completing the flow, terminating the flow, or deleting the flow. The input parameters include the operation to be performed and the name or ID of the flow.

URI

POST Huawei Cloud Astro Zero domain name/u-route/baas/v1.0/flow/{action}/{name_or_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

action

Yes

String

Explanation

Operation to be performed on the Flow instance.

Constraints

None

Value

The values and meanings of each operation are as follows:

  • start: used to start a Flow instance. This is a standard system startup operation.
  • run: used to run a Flow instance. This is a custom startup operation.
  • next: used to perform the next step of the Flow instance.
  • back: used to perform the previous step of the Flow instance.
  • finish: used to complete the Flow instance.
  • terminate: used to terminate the Flow instance and related resources.
  • del: used to delete the Flow instance and related resources.

Default value

None

name_or_id

Yes

String

Explanation

When action is set to start or run, set this parameter to the flow name. For other actions, set this parameter to the ID of the running Flow instance. You can call the API for Querying a Flow Instance to query the id in the response message.

Constraints

None

Value

None

Default value

None

Request parameters

The parameters in the request body are the input parameters defined in the Flow instance.

Response parameters

Table 2 Response parameters

Parameter

Type

Description

resCode

String

Explanation

Return code.

Value

If the request is successful, 0 is returned. For details about other error codes, see Error Codes.

resMsg

String

Explanation

Message returned.

Value

If the request is successful, "Success" is returned. In other cases, an error message is returned.

result

result object

Explanation

If the request is successful, the interviewId and outputs fields are returned.

Table 3 result field description

Parameter

Type

Description

interviewId

String

Explanation

ID of the Flow instance. After the Flow instance is started, you can obtain its ID from the returned result.

Value

None

outputs

Any

Explanation

Execution result of the Flow instance. It can be any value.

Example Request

To start the Flow instance named testFlowXyz, send the following request:
POST https://Huawei Cloud Astro Zero domain name/u-route/baas/v1.0/flow/start/testFlowXyz
{
    "paramA": "valueA",
    "paramB": {
        "subParamBA": [
            "A",
            "B"
        ],
        "subParamBB": "BB"
    }
}

Example Response

{
    "resCode": "0",
    "resMsg": "Success",
    "result": {
         "interviewId": "1234567890",
         "outputs": {
             "outA": "123",
             "outB": "456"
         }
}
}

Status Code

See Status Codes.

Error Code

See Error Codes.