All Products
Search
Document Center

CloudFlow:Create a workflow from a blank canvas

Last Updated:Aug 25, 2026

A workflow in CloudFlow consists of a series of task states, and each task state is an independent unit that represents a specific operation or service. Create a workflow from a blank canvas in the CloudFlow console to describe and manage your business processes.

Prerequisites

  • A function to invoke — The example workflow in this topic uses an InvokeFunction task state, which invokes an existing function. To obtain the ARN of the function, see Create an event-triggered function.

  • A role for cloud service integration — If your workflow integrates with cloud services, including CloudFlow, you must configure a role that is granted the required access policy. You specify the role in the workflow configuration.

Procedure

  1. Log on to the CloudFlow console. In the top menu bar, select a region.

  2. On the Workflows page, click Create Workflow.

  3. In the Create Workflow dialog box, select Use Blank Canvas. For Workflow mode, select Express Mode. Keep the default settings for the other parameters.

    Note

    This topic uses an express mode workflow as an example. To compare the workflow modes supported by CloudFlow before you choose a mode, see Standard and express modes.

  4. On the Edit Workflow page, define the workflow by using one of the following methods:

    • CloudFlow Studio — Build the workflow on a canvas. You drag states onto the canvas and configure each state in the properties panel.

    • YAML editing — Write the workflow definition as YAML code in a code editor. The workflow diagram next to the editor reflects the definition.

    Both methods define the same workflow, and you can switch between them while you edit. Complete the steps on the tab of the method that you choose, and then continue with the remaining steps of this procedure.

    CloudFlow Studio

    To define the workflow in CloudFlow Studio

    1. On the CloudFlow Studio tab, drag the states and flow nodes that you need onto the canvas. In an existing diagram, you can also reposition nodes to tailor the business process diagram.

    2. Click a state on the canvas, and then configure its Basic Settings, Input Settings, Output Settings, and Error Handling in the properties panel on the right. Repeat this step for each state in the diagram.

    3. For the InvokeFunction task state used as an example in this topic, click the InvokeFunction state on the canvas. On the Basic Settings tab, set Function to myfunction, Version or alias to LATEST, and Function invocation method to Sync invocation.

    Key parameters of the InvokeFunction task state

    The following table describes the key parameters of the InvokeFunction task state. Keep the default values for the other parameters.

    Configuration type Parameter Description Example
    Basic Settings Status Name The name of the state. Use a name that describes what the state does. InvokeFunction
    Function The name of the function to invoke. myfunction
    Version or alias The version or alias of the function to invoke. LATEST
    Function invocation method Specifies whether the function is invoked synchronously or asynchronously. For more information about function invocation methods, see Function invocation and triggers. Sync invocation
    Request payload The payload that triggers the function. YAML and JSON formats are supported. {"key1": "value1", "key2.$": "$.myStateInput.key", "key3": 100}
    Next state The next state to transition to. Changes take effect in real time. Hello World
    Error Handling Error retry The retry policy that applies when an error occurs. Click Add Retry below to add one or more retry policies.
    Error type The error types that can be matched. You can select one or more error types. FC.BadResponse
    Maximum retries The maximum number of retries. 5
    Retry interval (seconds) The interval between retries, in seconds. The maximum value is 86400. 3
    Backoff multiplication factor The multiplier that sets the next retry interval as a multiple of the current retry interval. 1
    Maximum backoff (seconds) The maximum number of seconds for retries that use exponential backoff. 5
    Error/exception capture Recovery to the state that you want when an error or exception occurs. Click Add Capture Rule below to add one or more capture rules.
    Error type The error types that can be matched. You can select one or more error types. FC.EntityTooLarge
    Fallback state The target state to fall back to when the specified error is captured. Hello World
    Result return When the specified error is captured and result return is used, the error is added to the input of the fallback step. YAML and JSON formats are supported. {"key": "hello world"}

    To specify the function, the version or alias, and the invocation method by using a YAML script instead of the form, click Switch to YAML Editing in the upper-right corner. The following YAML script shows an example:

    invocationType: Sync
    resourceArn: acs:fc:{regionId}:{accountId}:functions/myfunction/LATEST
    body:
      key: value

    Input and output filtering

    On the Input Settings tab, configure how the input is filtered. The options are as follows:

    • Use JSONPath to select specific parameters — In the code editor below, enter a filter expression to use JSONPath to select a subset of the parameter object as the node input.

    • Pass the original input to the node — Uses the original input of the node as the node input.

    • Construct parameters by using a parameter filter — Uses a parameter filter to construct new parameters as the node input.

    On the Output Settings tab, configure how the output is filtered. The options are as follows:

    • Use JSONPath to select specific parameters — In the code editor below, enter a filter expression to use JSONPath to select a subset of the valid output as the node output.

    • Pass the original input to the output — Passes the original input of the node downstream as the output.

    • Construct parameters by using a parameter filter — Uses a parameter filter to construct new parameters as the node output.

    Parameter filters support YAML and JSON formats. The following YAML code shows an example parameter filter:

    FieldA: 123
    FieldB: string
    FieldC.$: $Input
    Note

    Error handling is required only when you integrate workflows with other services. For more information, see Error handling.

    YAML editing

    To define the workflow in YAML

    1. Click the YAML tab or the YAML button in the top navigation bar to switch to YAML editing.

    2. In the code editor on the left, enter the YAML code that defines the workflow. The workflow diagram on the right updates in real time. The following code shows an example workflow definition:

      Type: StateMachine
      Name: my-wkfl
      SpecVersion: v1
      StartAt: InvokeFunction
      States:
        - Type: Task
          Name: InvokeFunction
          Action: FC:InvokeFunction
          TaskMode: RequestComplete
          Parameters:
            invocationType: Sync
            resourceArn: >-
              acs:fc:{regionId}:{accountId}:functions/myfunction/LATEST
          Retry:
            - Errors: []
              Description: 'Retry policy #1'
              MaxAttempts: 1
              IntervalSeconds: 1
          Next: Hello World
          Catch:
            - Errors:
                - FC.AccessDenied
              Description: 'Error capture rule #1'
              Next: Hello World
        - Type: Pass
          Name: Hello World
          End: true
    3. Validate the resourceArn value before you save the workflow. Replace the example value acs:fc:{regionId}:{accountId}:functions/myfunction/LATEST with the actual ARN of your function, which you obtain as described in Prerequisites. The example value uses the following placeholders:

      • regionId: The Alibaba Cloud region where your function resides, such as cn-beijing or cn-hangzhou.

      • accountId: The ID of your Alibaba Cloud account.

      • myfunction: The actual name of your function.

      • LATEST: Indicates that the latest version of the function is used. You can specify a different version or alias as needed.

  5. (Optional) Click Workflow Configuration at the top, and then specify the description of the workflow and the role that the workflow uses to run. The role must be granted the required access policy, as described in Prerequisites.

  6. Click Save and Exit.

Edit a workflow

Edit an existing workflow to change its definition, its description, or the role that the workflow uses to run.

  1. Log on to the CloudFlow console. In the top menu bar, select a region.

  2. On the Workflows page, click the workflow that you want to edit.

  3. In the upper-right corner of the workflow details page, click Edit Workflow, and then select CloudFlow Studio editing or YAML editing.

  4. Modify the workflow:

    • In CloudFlow Studio, add or remove task states, or change the Basic Settings, Input Settings, Output Settings, or Error Handling of a task state. For parameter descriptions, see the key parameter table in Procedure.

    • In YAML editing, modify the workflow definition. The workflow diagram in the chart area on the right reflects your changes.

  5. (Optional) To change the description of the workflow or the role that the workflow uses to run, click Workflow Configuration at the top.

  6. Click Save and Exit.

Next steps

After you save the workflow, run it to confirm that the definition works as expected. For instructions, see Execute a workflow.

To run a workflow on a schedule, see Workflow scheduling. To connect a workflow to other cloud services, see Workflow integrations.