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 performed 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 Dashboard page in IBM® App Connect Designer, click New > Event-driven flow to start creating the flow.
  2. Complete the following steps. As you progress, App Connect automatically saves your changes. If you navigate 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 you haven't connected to the application already, you can do so now to allow App Connect to interact with your application.
    4. Add a target application, and the action to be performed.
      1. If you haven't connected to the application already, you can do so now to allow App Connect to interact with your application.
      2. Populate any required fields for the target application, and any other fields that you want to use for the target application.
        Note: In each required field for the target application, ensure that you provide a value as needed by the target application. If you map the name of a source field, you should ensure that the source application will pass a suitable value; otherwise, if a value passed is invalid the flow can't complete successfully. In your flow, you can use conditional logic to do something appropriate if a value passed is invalid.

        Considerations:

        • In the default edit view for some create actions, you can select the parent object within 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; for example:
          
          <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 required field with truncated name and mouse pointer used to show 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 in Salesforce) and the object is deleted from the source app, then the flow displays a message to indicate that the object no longer exists; for example:
          No object with ID "232105349566428" exists in the target system.

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

    5. (Optional) Insert other target applications, and the actions to be performed, 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

      Considerations:

      • You can add a maximum of 10 target applications (actions).
      • Actions are performed in the order shown on the canvas.
      • If one of the actions fails, the following actions won't be performed, but any previous actions won't be 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. (Optional) 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

      Considerations:

      • 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'll see an error message on the dashboard. The following actions won't be performed, but any previous actions won't be reversed.
    7. You can add some conditional logic to your flow. If you want your flow to do different things depending on 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 returned by an app in your flow, for subsequent use by another app. For example, if data is returned as a JSON string, you'll need to parse it into a JSON object before using 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.