Create a workflow

Updated at:

Create a simple workflow that executes an HTTP request in the CloudFlow console.

Background

A workflow in CloudFlow defines your business logic and the information required for execution. For example, an order management workflow might include creating an order, processing payments, reserving inventory, shipping items, and sending notifications. After you create a workflow, you can run it multiple times with different input each time. CloudFlow provides control primitives that let you execute tasks in series or parallel, choose between execution branches, or iterate over items in a dataset.

Procedure

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

  2. On the Workflows page, click Create Workflow.

  3. In the Create Workflow dialog box, select Use blank canvas, select Workflow Mode, set Name and Description, and click Create.

    This example uses a standard workflow. For more information about workflow modes, see Standard and express workflows.

  4. On the CloudFlow Studio page, drag the Request node from the state browser pane onto the canvas. Release the mouse button when a placement line appears to add the node to the workflow.

  5. Click the Request node. In the right-side pane, configure the Basic Settings, Input Settings, Output Settings, and Error Handling tabs.

    The following table describes the key parameters on the Basic Settings tab. You can use the default values for the other parameters. For more information about Input Settings, Output Settings, and Error Handling, see State transitions.

    Parameter

    Description

    Example

    Call parameters

    • Request Method: Select an HTTP request method, such as GET.

    • Request URL:

      • If you select a fixed value, enter the complete URL of the HTTP service.

      • If you select an expression, you can use format() to construct the URL.

    • Headers: Optional. Add HTTP request headers as needed, such as Content-Type or Authorization.

    • Body: Optional. If you use the POST method, provide the request body data.

    • Query: Optional. Specify query parameters as needed.

    Note

    You can also click the Switch to YAML Editing tab to define invocation parameters in YAML.

    Parameters:
          method: POST
          url.$: format("http://www.{}.com","aliyun") 
          body: {}
          headers:
            Content-Type: multipart/form-data

    Next State

    Select the next state to transition to. Changes take effect immediately.

    Hello World

  6. (Optional) Click the Workflow Configuration tab to configure a role for the workflow. Then, click Save and Exit.

    If you have already created a RAM role, select it. If this is your first time using CloudFlow, create a role first. For more information, see Create an execution role.

    Note

    The workflow in this example makes an HTTP request and does not require a role. If your workflow integrates with other cloud services, you must configure a role with the required permissions.

Related documents

  • You can also create workflows using an SDK or API. For more information, see Create a workflow.

  • CloudFlow provides various state nodes to help you build workflows efficiently. For more information, see State transitions.