All Products
Search
Document Center

CloudFlow:Modify a workflow

Last Updated:Jul 23, 2024

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

Background information

If you execute a workflow after you modify it, the new execution is based on the new workflow information. The modified workflow definition doe not affect the completed and ongoing executions.

Modify a workflow by using the console

  1. Log on to the Serverless Workflow console.

  2. On the Flows page, click the name of the workflow that you want to modify.

  3. On the Details page, click Edit to modify the workflow.

    image

  4. On the Edit Flow page, modify the definition, description, and executions RAM role of the workflow.

    update-flow-2

    version: v1
    type: flow
    steps:
       - type: pass
         name: pass1
       - type: pass
         name: pass2  
  5. Click Save.

Modify a workflow by using Alibaba Cloud CLI

  1. Replace the local definition of the workflow that you want to modify with the following code. The modified workflow contains two steps.

    version: v1
    type: flow
    steps:
       - type: pass
         name: pass1
       - type: pass
         name: pass2    
  2. Run the following command to update the workflow:

    aliyun fnf UpdateFlow --Description "update demo" --Type FDL --RoleArn acs:ram::xxx:xxx --Name cli_guide_1 --Definition "$(<./flow.yaml)"

    Expected output:

    # The output of the command
    {
      "Name": "cli_guide_1",
      "Description": "demo",
      "Definition": "version: v1\ntype: flow\nsteps:\n   - type: pass\n     name: pass1\n   - type: pass\n     name: pass2    ",
      "Id": "47ced55d-590b-482a-975f-915ac2365ad6",
      "Type": "FDL",
      "RoleArn": "acs:ram::xxx:xxx",
      "CreatedTime": "2024-06-24T02:31:43.359Z",
      "LastModifiedTime": "2024-06-24T02:56:19.758Z",
      "ExecutionMode": "Standard",
      "RequestId": "4534dec7-98ae-28be-bd52-741c3dd399a6"
    }