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

Background information

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

Modify a flow by using the console

  1. Log on to the Serverless Workflow console.
  2. On the Flows page, click the name of the flow that you want to modify.
  3. On the Details page, click Edit to modify the flow.
    update-flow-1
  4. On the Edit Flow page, modify the definition, description, and executions RAM role of the flow.
    update-flow-2
    version: v1
    type: flow
    steps:
       - type: pass
         name: pass1
       - type: pass
         name: pass2  
  5. Click Save.

Modify a flow by using Alibaba Cloud CLI

  1. Replace the local definition of the flow that you want to modify with the following code. The modified flow contains two steps.
    version: v1
    type: flow
    steps:
       - type: pass
         name: pass1
       - type: pass
         name: pass2    
  2. Run the following command to update the flow:
    aliyun fnf UpdateFlow --Description "update demo" --Type FDL --RoleArn acs:ram::xxx:xxx --Name cli_guide_1 --Definition "$(<./flow.yaml)"

    Expected output:

       # The execution result of the command
       {
           "Name": "cli_guide_1",
           "Description": "update demo",
           "Definition": "version: v1\ntype: flow\nsteps:\n  - type: pass\n    name: pass1\n  - type: pass\n    name: pass2",
           "Id": "78c68342-d63b-4cb5-9207-4e44eeb7e632",
           "Type": "FDL",
           "RoleArn": "acs:ram::xxx:xxx",
           "CreatedTime": "2019-05-13T05:59:51.762Z",
           "LastModifiedTime": "2019-05-13T05:59:51.762Z",
           "RequestId": "xxxx"
       }