Creating a Flow

Every app has at least one flow. Each flow can be attached to one or more triggers. You have the option to begin by creating a blank flow (flow without a trigger) too and attaching the flow to one or more triggers at a later time. Use the Create link on the app details page to create the first flow in an app. If there are existing flows in an app, click the Create button to create additional flows.

Prerequisites

Before creating a flow that uses connectors, make sure that you have created the necessary connections.
Important: If an app has multiple triggers that require a port to be specified, for example REST and/or GraphQL triggers, make sure that the port number is unique for each trigger. Two triggers in the same app cannot run on the same port.
Note: A flow can be attached to multiple triggers. For such flows, you cannot disable a trigger, specify a particular trigger to execute, or specify the order in which the triggers execute. When a flow executes, all triggers get initialized in the order that they appear within the flow.

The output of a trigger provides the input to the flow. Hence, it must be mapped to the flow input. In the absence of a trigger, when creating a flow, there must be a well-defined contract within the flow which specifies the input to the flow and the output expected after the flow completes execution. You define this contract in the Flow Inputs & Outputs dialog. The Flow Inputs & Ouputs contract works as a bridge between the flow and the trigger, hence every trigger has to be configured to map its output to the Input parameters defined in Flow Inputs & Ouputs. You do this in the Map to Flow Inputs tab of the trigger.

Likewise, for triggers such as the ReceiveHTTPMessage REST trigger that send back a reply to the caller, the trigger reply must be mapped to the flow outputs (parameters configured in the Output tab of the Flow Inputs & Ouputs accordian tab). You do this mapping in the Map from Flow Outputs tab of the trigger.
Note: A Return activity is not added by default. Depending on your requirements, you must add and configure the Return activity manually. For example, if any trigger needs to send a response back to a server, its output must be mapped to the output of the Return activity in the flow.

The Map Outputs tab of the Return activity displays the flow output schema that you configured in the Output tab of the Flow Inputs & Outputs accordion tab. The Map from Flow Output tab of the trigger constitutes the trigger reply. This tab also displays the flow output schema that you configured in the Output tab of the Flow Inputs & Outputs accordion tab.

You must do the following when using a ReceiveHTTPMessage REST trigger:
  • Add a Return activity at the end of the flow.
  • In the Map Outputs tab of the Return activity, map the elements in the schema to the data coming from the upstream activities.
  • In the Map from Flow Output tab of the trigger, map the trigger reply elements to the flow output elements.

Follow these steps to create a flow:

Procedure

  1. Click an app name on the Apps page in TIBCO Cloud Integration - Flogo (PAYG) to open its page.
  2. Click the Create link if this is the first flow in the app. If one or more flows exist, click the Create button.
    The Add triggers and flows dialog opens.
  3. Enter a name for the flow in the Name text box.
    Flow names within an app must be unique. An app cannot contain two flows with the same name.
  4. Optionally, enter a brief description of what the flow does in the Description text box. The Flow option is selected by default.
    To create a flow from a specification, select the specification under Start with and refer to the appropriate section under Building APIs.
  5. Click Create.
    You will be prompted to select one of the following options:

    • Start with a trigger - If you know the trigger with which you want to activate the flow, select this option. If this is the first flow, the Trigger catalog opens. Select a trigger from the catalog. Refer to the appropriate section under Starting with a Trigger for more details on the the type of trigger that you want to create. If there are existing flows attached to triggers, you get a dialog which gives you an option to either use an existing trigger or use a new trigger that has not been used in an existing flow within the app.
    • Configure flow inputs and outputs - Select this option if you know the algorithm for the flow, but do not yet know the circumstances that will cause the flow to execute. It will create a blank flow that is not attached to any trigger. Flow inputs and outputs create a contract between the trigger and the flow. When you create a trigger, you must map the output of the trigger to the input to the flow. This contract serves as a bridge between the trigger and the flow. You have the option to attach your flow to one or more triggers at any later time after the flow has been created.

    A flow gets created. If you selected Start with a trigger, the flow is attached to the trigger you selected. If you selected Configure flow inputs and outputs, a blank flow without a trigger gets created.