All Products
Search
Document Center

CloudFlow:Execute a flow

Last Updated:Oct 30, 2023

This topic describes how to execute a flow by using the Serverless Workflow console or Alibaba Cloud CLI.

Background information

To execute a flow, you must specify the name of the flow. You can also configure a name and input for the execution. The name and input of the execution are optional. A flow execution is an asynchronous operation. You can call the DescribeExecution operation to query the execution result and call the GetExecutionHistory operation to query the details of the execution.

The following conditions must be met when you execute a flow:
  • The name of each execution of a flow must be unique.
  • The input must be in the JSON object format.

Execute a flow by using the Serverless Workflow console

  1. Log on to the Serverless Workflow console.
  2. On the Flows page, click the name of the flow that you want to execute.
  3. On the Details page, click Start Execution. In the dialog box that appears, set Execution Name (Optional) and Input (Optional).
    start-exec-1
  4. Click Start Execution to start the execution. If you do not specify an execution name, Serverless workflow automatically generates a name for the execution.

Execute a flow by using Alibaba Cloud CLI

You can run the following command to execute a flow. Example:
aliyun fnf StartExecution --FlowName cli_guide_1 --ExecutionName run1

Expected output:

{
    "Name": "run1",
    "FlowName": "cli_guide_1",
    "FlowDefinition": "version: v1\ntype: flow\nname: test\nsteps:\n  - type: pass\n    name: pass1",
    "Input": "",
    "Output": "",
    "Status": "",
    "StartedTime": "2019-05-13T06:23:48.767Z",
    "StoppedTime": "1970-01-01T00:00:00Z",
    "RequestId": "xxxx"
}