Creating event-driven flows from scratch

In an event-driven flow, you identify an event that can occur in a source application, and then define actions that you want to complete in one or more target applications as a result of that event. The flow is triggered when the event occurs.

Before you begin

  • To create an event-driven flow, you must have access to an App Connect Designer instance in your cluster.
  • If you know which applications you want to interact with, open the App Connect Designer catalog and create accounts for the connectors that will be used to process events from a source application and to perform actions against the target applications. (It is also possible to create accounts while creating a flow.) For more information, see Connecting to accounts.

About this task

Creating an event-driven flow involves the following steps:
  1. Specify which event from a source application should trigger the flow. Or, indicate that you want to start the flow on a schedule.
  2. Add the actions that should be performed against one or more target applications. Optionally add toolbox utilities to the flow for specialized processing of the input or output data from these applications.

Take note of the following considerations:

  • You can add a maximum of 10 actions to a flow.
  • Actions are performed in the order shown on the canvas.
  • If one of the actions fails, subsequent actions are not completed, but previous actions are not reversed.

Procedure

To create an event-driven flow, complete the following steps:

  1. From your App Connect Designer instance, use either of these methods to create the flow.
    • From the Home page, click Create an event-driven flow.
    • From the navigation pane, click the Dashboard icon Dashboard icon to open the App Connect Designer dashboard and then click Create > Event-driven flow (or New > Event-driven flow in earlier versions).

    The flow editor is displayed.

  2. Enter a name that identifies the purpose of your flow.
    Specifying the flow name

    As you progress with the flow, 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.

  3. Add the event node to the flow. You can choose to receive streamed events from a source application, poll an application for events, or configure a schedule for events from an application. Only the supported event nodes are shown in the flow editor. To see what event nodes are supported for event-driven flows, see Supported event connectors for triggering event-driven flows.
    • To stream events from a source application, click Add trigger node to display the list of applications and toolbox utilities in a set of tabs. Then, click to select the application from the Applications tab, and click the object and event type for which events should be streamed. For example, if you want event notifications to be sent to App Connect whenever a contact is created in Salesforce, click to select Salesforce, and then click Contacts and New contact.

      Also ensure that the correct account is selected in the Account list.

      (In earlier Designer versions, the applications and toolbox utilities are displayed in tabs by default when the flow editor opens.)

      Selecting an application and event type for streamed events

      The event node is added to the flow.

      Event node for streamed events
    • To poll a source application for new or updated objects, click Add trigger node to display the list of applications and toolbox utilities in a set of tabs. Then, click to select the application from the Applications tab and click Configure more events. From the Select the event to configure panel, click the object that you want to monitor and click the type of event. For example, if you want to trigger your flow every time a new account is created in Salesforce, click Salesforce > Configure more events, and then click Accounts and New accounts.

      (In earlier Designer versions, the applications and toolbox utilities are displayed in tabs by default when the flow editor opens.)

      Selecting an application and event type for polled events

      The event node is added to the flow. Ensure that the correct account is selected in the Account list and then configure the polling intervals in the fields that are displayed. For information about completing these fields, see Configuring polled events to trigger flows.

      Event node for polled events

    • To configure your flow to run at regular intervals or at specific dates and times, click Add trigger node to display the list of applications and toolbox utilities in a set of tabs. Then, click the Toolbox tab and click Scheduler.

      (In earlier Designer versions, the applications and toolbox utilities are displayed in tabs by default when the flow editor opens.)

      Selecting the Scheduler from the Toolbox tab

      The Scheduler node is added to the flow. Define a schedule for the flow as described in Configuring your flow to run at scheduled times.

      In this example, a schedule is defined to trigger the flow when it first starts, and then daily on an hourly basis.

      Configured Scheduler node
  4. To add the first action to the flow, click (+) and then select the application or API, and the required action. Also ensure that the correct account, which App Connect will use to connect to the target application or API, is selected. If there are no connected accounts, you can create one, as described in Connecting to accounts.

    In this example, a Salesforce action to retrieve leads is selected from the Applications and APIs tab.

    Selecting a Salesforce action to add to the flow
    Note: If your App Connect Designer instance is configured to use a switch server for callable flows or private network connections, you can also add these types of nodes to your flow:
    • You can add Callable flow nodes that invoke running callable flows in either IBM App Connect Enterprise or IBM Integration Bus on premises. If this capability is enabled in your instance, a Callable flows icon Callable flows icon is included in the navigation pane. You must also configure secure connectivity as described in Configuring connectivity between a calling flow and a callable flow.
    • You can add nodes that enable you to connect to and interact with applications in a private network. You can configure private network connections by clicking the Private network connections icon Private network connections icon in the navigation pane. For more information, see Connecting to a private network from App Connect Designer.
  5. Populate the fields for the action with values that you want to pass to the target application. The type of input required depends on the action and required fields must be completed in order to start the flow. You can specify static data in plain text, or specify dynamic data by adding mappings from previous nodes in the flow. You can also apply functions (or JSONata expressions) to transform your data, or use other built-in mechanisms to define custom values.
    In the following example, a Salesforce Retrieve leads action is used to retrieve details of new leads that were created in Salesforce after the flow was last triggered. To define this action, complete the following steps:
    1. Click Add condition and select Created date and is greater than from the first two fields.
    2. Click within the rightmost field and click the Insert a mapping icon Insert a mapping icon to open the Available mappings list. Then, expand Scheduler / Schedule flow and select the Previous event time mapping, which depicts the time when the previous schedule was triggered.
    3. Optionally configure the maximum number of items to retrieve, and error conditions.
    Populated fields for an action
    Tip:
    • After you complete the fields for the action, you can use auto-generated or custom sample data to try out the action and verify its effect. The action is performed on the target application that you're connected to, so ensure that you use a non-production account if you want to try out the action. For more information, see Testing a non-running flow with sample data.
    • You can copy or delete the node for an action by hovering your mouse over the node and then clicking the Copy or Delete icons that are displayed.
      Copy and Delete icons for an action node are displayed when you hover the mouse over the node
  6. Optional: Add further actions to be performed on selected applications if needed.
  7. Optional: Use one or more supported toolbox utilities to provide specialized processing. For example, you can add an If node to provide conditional processing, or a For each node to process retrieved items. For more information, see Adding special processing to a flow (Toolbox utilities).

    In this example, a For each node is used to loop through the retrieved Salesforce records and to create corresponding lead records in Insightly. Click the (+), go to the Toolbox tab, and then click For each to select the collection of items to process and your processing options.

    For each node settings

    Next, click the plus (+) within the For each node, and from the Applications and APIs tab, click Insightly > Leads > Create lead. The Insert a mapping icon Insert a mapping icon can be used to populate individual fields with mappings that represent the processed output from the Salesforce node. However, Mapping Assist is enabled for this Designer instance and generates smart mappings that can be used to collectively populate the fields, as indicated by the Preview 5 mapping suggestions button in the following example. (In earlier Designer versions, the text is displayed as 5 suggestions View suggestions.) The number of mapping suggestions varies based on the applications.

    Smart mapping suggestions generated by Mapping Assist

    Click Preview 5 mapping suggestions to switch to preview mode, which inserts a preview of the suggested mappings into the matching fields. Examine the preview mappings to verify that they are suitable for your requirements and then click Apply suggestions to populate the fields. Manually add any other mappings that you need to the remaining fields.

    (In earlier Designer versions,click View suggestions to switch to inline preview mode, which inserts a preview of the suggested mappings into the matching fields. Examine the preview mappings to verify that they are suitable for your requirements and then click Apply 5 suggestions to populate the fields.)

    Fields populated with smart suggestions
  8. Optional: After you have configured all of the flow's nodes, use auto-generated or custom sample data to try out the flow before you start it in order to verify its behavior. The configured actions in the flow are performed on the target applications that you're connected to, so ensure that you use non-production accounts if you want to try out the flow. For more information, see Testing a non-running flow with sample data.
  9. Ensure that there are no validation errors in any of the nodes in the flow.
    For more information about validating the nodes in a flow and resolving errors, see Validating your flow is ready to run.
  10. To save and start your flow, click Start flow. (In earlier Designer versions, open the options menu [⋮] on the banner, and click Start flow.) Then, to exit the flow, click Dashboard. Your flow is displayed as a tile in the dashboard with a Running status, and is listening for the event type that you configured.
    Tip: To save but not start your flow from the flow editor, click Dashboard without clicking Start flow. Your flow is displayed in the dashboard as Stopped, and can be started manually from the options menu on the tile. If you do not complete the flow, the flow is displayed in the dashboard with the label Incomplete.
    Flow tile in the dashboard

What to do next

Test the behavior of the running flow by completing the event activity that triggers the flow. Then verify that you can see the expected results in the target applications. For more information, see Testing a running event-driven flow.

From the options menu for a flow, you can start, stop, export, or delete the flow, and can choose to share it with other users as an asset if an Automation assets instance is available in your cluster. While the flow is running, you can also open it to view the configuration, but you’ll have to stop the flow if you want to edit it.

Flow menu options
To run the flow in a production system, deploy it as an integration server or integration runtime in the App Connect Dashboard, which provides a runtime environment.
  1. After you successfully test the flow in your App Connect Designer authoring environment, export the flow as a broker archive (BAR) file that packages the integration.
  2. Upload the BAR file to an App Connect Dashboard instance and then deploy the file to an integration server or integration runtime to run the integration in the production system.

    For more information, see Deploying Designer and Toolkit integrations in the App Connect Dashboard.