Introduction: Creating an event-driven flow

In an event-driven flow, you identify an event that can occur in your source application and actions that can be completed in one or more target applications. The flow is triggered when the event occurs.

Creating an event-driven flow takes just a few steps:

  1. On the Designer dashboard in IBM® App Connect, click Create > Event-driven flow.
  2. Complete the following steps. As you progress, App Connect automatically saves your changes. If you move away from the flow at any stage, the flow is saved as a draft flow that you can complete at another time.
    1. Enter a name that identifies the purpose of your flow, for example: Contact tasks for new attendee
    2. Select the first (source) application, and the event to trigger the flow. For hints and tips about using specific applications, see the "how to" pages under How to guides for apps.
    3. If App Connect isn't yet connected to the application, you can connect now to allow App Connect to interact with your application.
    4. Add a target application, and the action to be completed.
      1. If App Connect isn't yet connected to the application, you can connect now to allow App Connect to interact with your application.
      2. Populate any mandatory fields for the target application, and any other fields that you want to use for the target application.
        Note: In each mandatory field for the target application, provide the value that the target application needs. If you map the name of a source field, make sure that the source application passes a suitable value. If the application passes an invalid value, the flow can't complete successfully. In your flow, you can use conditional logic to do something appropriate if a value passed is invalid.
        • In the default edit view for some create actions, you can select the parent object in which to create a new object. For example, for the Asana action Create Task, you can select the project within which to create the task in the following way.
          
          <strong>*Project</strong>
          Event team tasks
          

          If the parent object is later deleted, then when you next edit the flow it displays a message to indicate that the object no longer exists; for example:

          
          <strong>*Project</strong>
          No object with ID "232105349566428" exists in the target system.
          

          Where the ID value is the system ID for the parent object.

        • In the default edit view for an action, some applications have fields that are hidden because they are not needed for general use cases. For more advanced use cases, to be able to work with all available fields for objects, you can switch to advanced mode editing.
        • If a field name is truncated, hover over the field name to display the full name.
          Figure 1. A mandatory field with truncated name and a mouse pointer that is used to show the full name
          A required field with truncated name and mouse pointer used to show full name
        • You can add the names of source fields, apply functions to transform source data, and type text. For more information, see Techniques for specifying data to be passed to a target application or API.
        • If a target field references an object in the source app (like a Contact) and the object is deleted from the source app, the flow displays a message. In the following example, the ID value is the system ID for the object.
          No object with ID "232105349566428" exists in the target system.
    5. Insert other target applications, and the actions to be completed, as in step 2.d. You can insert a target application at any (+) point in the flow.
      Figure 2. A multi-node flow, with the source application and 2 target applications
      A multi-node flow, with the source application and 2 target applications
      • You can add a maximum of 10 target applications (actions).
      • Actions are completed in the order that is shown on the canvas.
      • If one of the actions fails, the following actions aren't completed, but any previous actions aren't reversed.
      • In the target fields for an action, you can map data from the trigger application or from previous target applications in the flow.
    6. If you choose an action to retrieve or update data in one of your applications, you can add a condition to retrieve or update a single record.

      For example, the following condition retrieves a single record where the email address of the Insightly lead matches the email address in the trigger application, and the Insightly lead comes from Ireland.

      Figure 3. Example Retrieve action that returns a single record where the email address of the Insightly lead matches the email address in the trigger application, and the Insightly lead comes from Ireland
      • You can add a maximum of 10 conditions. If you add more than one condition, all the conditions must be matched to succeed.
      • You can retrieve a single record only. If the condition matches more than one record, or no records, you see an error message on the dashboard. The following actions aren't completed, but any previous actions aren't reversed.
    7. You can add some conditional logic to your flow. If you want your flow to do different things according to the data that it receives from the trigger application, you can add one or more ‘If’ nodes to your flow. For more information, see Adding conditional logic to a flow.
    8. You can parse the data that is returned by an app in your flow, for subsequent use by another app. For example, if data is returned as a JSON string, you need to parse it into a JSON object before you use the data as input into another app. For more information, see Using the JSON parser to parse a JSON string into a JSON object and Using the CSV parser to parse CSV text into a JSON object.
  3. Choose one of the following options to complete your flow:
    • To save and start your flow, click Start flow on the toolbar. Then, to exit the flow, click Dashboard. Your flow is displayed on the Dashboard as running, and is listening for the event that you configured.
    • To save but not start your flow, click Dashboard. Your flow is displayed on the Dashboard as Stopped, and can be started manually from the menu:
      Figure 4. Flow menu options to manage or edit the flow
      Flow menu options to manage or edit the flow
Note: If you do not complete the flow, the flow is displayed on the Dashboard with the label (!) Incomplete.

For simple step-by-step examples of how to create a flow for different use cases, see the other tutorials for App Connect.