You can execute a workflow by using the console or the Alibaba Cloud CLI.
Background
To execute a workflow, you must specify the workflow name. The execution name and input are optional. Workflow execution is asynchronous. You can get the status of an execution to view the result and get the step details of an execution to view the execution history.
The following requirements apply to workflow execution:
-
Each execution name must be unique within the same workflow.
-
If you provide an input, it must be a valid JSON object.
Use the console
-
Log on to the CloudFlow console.
-
On the Workflows page, click the name of the workflow that you want to execute.
-
On the Workflow page, click Start Execution, and enter the Execution Name (Optional) and Input (Optional).
For example, enter
run1in the Execution Name field and the JSON object{"test": "hello world"}in the Input field. Then, click Start Execution. -
Click Start Execution. If you do not specify an execution name, Serverless Workflow automatically generates one.
Use the CLI
Run the following command to execute a workflow:
aliyun fnf StartExecution --FlowName cli_guide_1 --ExecutionName run1
Expected output:
{
"Name": "run1",
"FlowName": "cli_guide_1",
"FlowDefinition": "version: v1\ntype: flow\nsteps:\n - type: pass\n name: pass1\n - type: pass\n name: pass2",
"Input": "{}",
"Output": "",
"Status": "",
"StartedTime": "2024-06-24T03:04:38.614Z",
"StoppedTime": "",
"RequestId": "bf6ec55d-cade-187e-e7f2-a49c010b953a"
}