Create, schedule, and run recurring tasks and workflows with the Recurrence trigger in Azure Logic Apps

To regularly run tasks, processes, or jobs on specific schedule, you can start your logic app workflow with the built-in Recurrence - Schedule trigger. You can set a date and time as well as a time zone for starting the workflow and a recurrence for repeating that workflow. If recurrences are missed for any reason, this trigger continues recurring at the next scheduled interval. For more information about the built-in Schedule triggers and actions, see Schedule and run recurring automated, tasks, and workflows with Azure Logic Apps.

Here are some patterns that this trigger supports along with more advanced recurrences and complex schedules:

  • Run immediately and repeat every n number of seconds, minutes, hours, days, weeks, or months.

  • Start at a specific date and time, then run and repeat every n number of seconds, minutes, hours, days, weeks, or months.

  • Run and repeat at one or more times each day, for example, at 8:00 AM and 5:00 PM.

  • Run and repeat each week, but only for specific days, such as Saturday and Sunday.

  • Run and repeat each week, but only for specific days and times, such as Monday through Friday at 8:00 AM and 5:00 PM.

For differences between this trigger and the Sliding Window trigger or for more information about scheduling recurring workflows, see Schedule and run recurring automated tasks, processes, and workflows with Azure Logic Apps.

Tip

If you want to trigger your logic app and run only one time in the future, see Run jobs one time only.

Prerequisites

Add Recurrence trigger

  1. Sign in to the Azure portal. Create a blank logic app.

  2. After Logic App Designer appears, in the search box, enter "recurrence" as your filter. From the triggers list, select this trigger as the first step in your logic app workflow: Recurrence

    Select "Recurrence" trigger

  3. Set the interval and frequency for the recurrence. In this example, set these properties to run your workflow every week.

    Set interval and frequency

    Property Required JSON name Type Description
    Interval Yes interval Integer A positive integer that describes how often the workflow runs based on the frequency. Here are the minimum and maximum intervals:

    - Month: 1-16 months
    - Day: 1-500 days
    - Hour: 1-12,000 hours
    - Minute: 1-72,000 minutes
    - Second: 1-9,999,999 seconds

    For example, if the interval is 6, and the frequency is "Month", then the recurrence is every 6 months.

    Frequency Yes frequency String The unit of time for the recurrence: Second, Minute, Hour, Day, Week, or Month

    For more scheduling options, open the Add new parameter list. Any options that you select appear on the trigger after selection.

    Advanced scheduling options

    Property Required JSON name Type Description
    Time zone No timeZone String Applies only when you specify a start time because this trigger doesn't accept UTC offset. Select the time zone that you want to apply.
    Start time No startTime String Provide a start date and time in this format:

    YYYY-MM-DDThh:mm:ss if you select a time zone

    -or-

    YYYY-MM-DDThh:mm:ssZ if you don't select a time zone

    So for example, if you want September 18, 2017 at 2:00 PM, then specify "2017-09-18T14:00:00" and select a time zone such as Pacific Standard Time. Or, specify "2017-09-18T14:00:00Z" without a time zone.

    Note: This start time must follow the ISO 8601 date time specification in UTC date time format, but without a UTC offset. If you don't select a time zone, you must add the letter "Z" at the end without any spaces. This "Z" refers to the equivalent nautical time.

    For simple schedules, the start time is the first occurrence, while for complex schedules, the trigger doesn't fire any sooner than the start time. What are the ways that I can use the start date and time?

    On these days No weekDays String or string array If you select "Week", you can select one or more days when you want to run the workflow: Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, and Sunday
    At these hours No hours Integer or integer array If you select "Day" or "Week", you can select one or more integers from 0 to 23 as the hours of the day for when you want to run the workflow.

    For example, if you specify "10", "12" and "14", you get 10 AM, 12 PM, and 2 PM for the hours of the day, but the minutes of the day are calculated based on when the recurrence starts. To set the minutes of the day, specify the value for the At these minutes property.

    At these minutes No minutes Integer or integer array If you select "Day" or "Week", you can select one or more integers from 0 to 59 as the minutes of the hour when you want to run the workflow.

    For example, you can specify "30" as the minute mark and using the previous example for hours of the day, you get 10:30 AM, 12:30 PM, and 2:30 PM.

    For example, suppose that today is Monday, September 4, 2017. The following Recurrence trigger doesn't fire any sooner than the start date and time, which is Monday, September 18, 2017 at 8:00 AM PST. However, the recurrence schedule is set for 10:30 AM, 12:30 PM, and 2:30 PM on Mondays only. So the first time that the trigger fires and creates a logic app workflow instance is at 10:30 AM. To learn more about how start times work, see these start time examples.

    Future runs happen at 12:30 PM and 2:30 PM on the same day. Each recurrence creates their own workflow instance. After that, the entire schedule repeats all over again next Monday. What are some other example occurrences?

    Advanced scheduling example

    Note

    The trigger shows a preview for your specified recurrence only when you select "Day" or "Week" as the frequency.

  4. Now build your remaining workflow with other actions. For more actions that you can add, see Connectors for Azure Logic Apps.

Workflow definition - Recurrence

In your logic app's underlying workflow definition, which uses JSON, you can view the Recurrence trigger definition with the options that you chose. To view this definition, on the designer toolbar, choose Code view. To return to the designer, choose on the designer toolbar, Designer.

This example shows how a Recurrence trigger definition might look in an underlying workflow definition:

"triggers": {
   "Recurrence": {
      "type": "Recurrence",
      "recurrence": {
         "frequency": "Week",
         "interval": 1,
         "schedule": {
            "hours": [
               10,
               12,
               14
            ],
            "minutes": [
               30
            ],
            "weekDays": [
               "Monday"
            ]
         },
         "startTime": "2017-09-07T14:00:00Z",
         "timeZone": "Pacific Standard Time"
      }
   }
}

Next steps