You can configure an event-driven flow to run at regular intervals or at specific dates and times by adding a Scheduler node to the flow.

The Scheduler is available from the Toolbox tab in the flow editor and must be added as the first node (that is, as the event that triggers your event-driven flow).

Selecting the Scheduler from the Toolbox

Defining a schedule for a flow

After you add a Scheduler node, you can define a schedule for the flow in either of the following ways:

Schedule the flow to trigger at regular intervals
  1. From the Select schedule type list, select Repeating interval.
  2. From the Run every drop-down lists, select either of the following options to define the unit of time for the interval, and also set a corresponding value (of x):
    • Hour: Trigger the flow once every x hours. The first trigger will occur x hours after the flow is started.
    • Minute: Trigger the flow once every x minutes. The first trigger will occur x minutes after the flow is started.

      In the following example, the flow will first be triggered 5 hours after it was switched on, and every 5 hours subsequently.

      Fields to trigger a flow at repeating intervals

  3. Optional. To trigger the flow to run once immediately after it’s switched on, select the Also run the flow when it’s first switched on check box. If selected in the previous image, the flow will be triggered immediately after it’s switched on, and every 5 hours after that.
Schedule the flow to trigger on a specific day or time
  1. From the Select schedule type list, select Calendar.
  2. From the Run every drop-down lists, select one of the following units of time, and then set a corresponding value for the schedule:
    • Hour: Use this option to trigger the flow every hour at x minutes past the hour. For example, trigger the flow every hour at 30 minutes past the hour:

      Calendar option: Hour

    • Day: Use this option to trigger the flow every day at x hours and y minutes. For example, trigger the flow daily at 14:00:

      Calendar option: Day

    • Week: Use this option to trigger the flow every week on day x of the week, at y hours and z minutes. For example, trigger the flow every week on Monday at 09:15:

      Calendar option: Week

    • Month: Use this option to trigger the flow every month on day x, at y hours and z minutes. For example, trigger the flow every month on the 28th day, at 20:45:

      Calendar option: Month

    • Year: Use this option to trigger the flow every year on day x of month m, at y hours and z minutes. For example, trigger the flow every year on the 5th day of April, at 18:00:

      Calendar option: Year

  3. From the Time zone drop-down list, select a timezone for the selected schedule. The default timezone is GMT.
  4. Optional. To trigger the flow to run once immediately after it’s switched on (before subsequently running on schedule), select the Also run the flow when it’s first switched on check box.

After configuring a schedule, you can complete your flow in the usual way by adding the actions and toolbox utilities that you need. You can also use the timestamp emitted at the start of each scheduled time period to retrieve information that was created, generated, or processed during those time periods, as described in the next section.

Using the emitted timestamps from the schedule

The Scheduler emits the following output, which you can map to in subsequent nodes in your flow:

  • Current event time: The time when the current schedule was triggered
  • Previous event time: The time when the previous schedule was triggered

    Scheduler output fields for mapping

Note:

  • Both of these time stamps are presented in ISO format and will be in the default GMT timezone that’s defined for the Calendar schedule type.
  • The Previous event time value is, by default, set to 1 Jan 1970 when the flow is first triggered.

Example

The following example shows a sample flow that’s configured to run Salesforce and Slack actions on a schedule. To read about what this flow does and see an example of how you can use the timestamp emitted at the start of each scheduled time period, see the Scenario section in the “Configuring scheduled events with IBM App Connect” blog.

Flow image for Scheduler scenario

Join The Discussion

Your email address will not be published. Required fields are marked *