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 on selected days

  1. From the Select schedule type list, select Repeating interval.

    Default fields to trigger a flow at repeating intervals

  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 (on the appropriate day).
    • Minute: Trigger the flow once every x minutes. The first trigger will occur x minutes after the flow is started (on the appropriate day).
  3. Use the on Mon/Tue/Wed/Thu/Fri/Sat/Sun check boxes to select the days on which to trigger the flow. By default, all the days of the week are selected.
  4. From the Timezone drop-down list, select a timezone for the selected schedule. The default timezone is UTC.
  5. 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.

    Note:

    • The schedule is calculated based on when the flow is first triggered in the specified timezone. If the Also run the flow when it’s first switched on check box is selected, the flow is triggered immediately after it’s switched on, and then every x minutes or hours after that.
    • If there’s a break of one or more days in the schedule, the schedule will restart at 00:00 in the specified timezone on the next scheduled day.
  • Examples

    Run the flow every 12 hours every day in the UTC timezone. Select the Also run the flow when it’s first switched on check box. The flow will initially be triggered when it’s first switched on, and will then run every 12 hours subsequently.

    Fields to trigger a flow at repeating intervals every day

    Run the flow every five hours on Monday, Wednesday, and Friday in the Europe/London timezone. Leave the Also run the flow when it’s first switched on check box blank. Assuming the flow is switched on on a Saturday or Sunday, the flow will initially be triggered at 05:00 on Monday, and will then run at 10:00 on Monday, 15:00 on Monday, 20:00 on Monday, 00:00 on Wednesday, 05:00 on Wednesday, 10:00 on Wednesday, 15:00 on Wednesday, 20:00 on Wednesday, 00:00 on Friday, 05:00 on Friday, 10:00 on Friday, 15:00 on Friday, and 20:00 on Friday. Subsequently, the flow will run at 00:00 on Monday, 05:00 on Monday, 10:00 on Monday, 15:00 on Monday, 20:00 on Monday, 00:00 on Wednesday, 05:00 on Wednesday, 10:00 on Wednesday, 15:00 on Wednesday, 20:00 on Wednesday, 00:00 on Friday, 05:00 on Friday, 10:00 on Friday, 15:00 on Friday, and 20:00 on Friday.

    Fields to trigger a flow at repeating intervals on Monday, Wednesday, and Friday

    Run the flow every 10 hours on Tuesday and Wednesday in the GMT timezone. Leave the Also run the flow when it’s first switched on check box blank. Assuming the flow is switched on anytime between Thursday and Monday, the flow will initially be triggered at 10:00 on Tuesday, and will then run at 20:00 on Tuesday, 06:00 on Wednesday, and 16:00 on Wednesday. Subsequently, the flow will run at 00:00 on Tuesday, 10:00 on Tuesday, 20:00 on Tuesday, 06:00 on Wednesday, and 16:00 on Wednesday.

    Fields to trigger a flow at repeating intervals on Tuesday and Wednesday

    Run the flow every 9 hours on Tuesday and Wednesday in the EST timezone. Select the Also run the flow when it’s first switched on check box. Assuming the flow is switched on at 08:00 on Tuesday, the flow will initially be triggered at 08:00 on Tuesday, and will then run at 17:00 on Tuesday, 02:00 on Wednesday, 11:00 on Wednesday, and 20:00 on Wednesday. Subsequently, the flow will run at 00:00 on Tuesday, 09:00 on Tuesday, 18:00 on Tuesday, 03:00 on Wednesday, 12:00 on Wednesday, and 21:00 on Wednesday.

    Fields to trigger a flow at repeating intervals on Tuesday and Wednesday

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 Timezone drop-down list, select a timezone for the selected schedule. The default timezone is UTC.
  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 UTC 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 *