- Updated on 27 Feb 2020
- 1 minute to read
This tutorial demonstrates how to create and use Interval Job in Decisions. Interval Job is a type of Scheduled Job introduced in Decisions 4.1. It allows a user to pick a Flow and run it a defined number of times with provided interval.
An interval job is a timer. An Interval Job sets the interval or the time span between when a job should be run. The Interval Job uses the Time Span control to set this. The Count input also allows a user to set how many times the flow should be run. So if a user wanted to run a specified flow 2 times in 15-minute intervals, an Interval Job would be beneficial.
A Scheduled Job sets the time and day a flow is run. If a user wanted to run a specified flow on a daily schedule or a weekly schedule, this would be the best method to do so. There are pre-set Calendar settings to help, such as setting the flow to run on the first or last day of the month.
The Scheduled Job can also use the Time Span control, but only if a user sets the Calendar control to Time Span Schedule.
In this example, we are going to create a simple Flow that will be sending an Email.
Then, we are going to create an Interval Job to run this Flow three times every five minutes.
We begin in the Designer Folder by clicking Create Flow on Folder Actions Panel.
Then, we Name the Flow and click Ok to proceed to the Flow Designer.
In the Flow Designer, we add Send Email step from Favorite Steps category.
Next, we select Send Email step to edit step input data. In the Email settings, we define Constant From and To fields.
Then, we define the Constant Subject and Body fields.
Finally, we connect the outcome from the Send Email step to the End Step. This completes our Flow. We can save the Flow and close Flow Designer.
Back in Decisions Studio Portal, we navigate to System > Jobs and Events > Scheduled Jobs Folder.
Then, we click Add Interval Job on Folder Actions Panel.
In the resulting Add Interval Job dialog window, we define Job Name. Then, we click Pick to select our Flow.
In the Pick Entity window, we search and select our Flow. Click Ok to save and continue.
Back in the Add Interval Job window, we set Count property. This is the number of times our Flow is going to run when Job is triggered (in this case we set it to 3 so we are going to receive 3 Emails each time this Job runs). Then, we set Interval setting to five minutes. This will trigger this Job to run every 5 minutes.
Optionally, we can set Thread Queue Name and Only Run On Job Server settings.
When finished, click Ok to save Interval Job.
We can manage our Interval Jobs on the respective view of Scheduled Jobs Folder.
When our Job runs we receive three Emails .