Recurrence trigger not fired at specified frequency

Published Jan 11 2021 01:20 AM 1,147 Views

There might be scenarios noticed where recurrence trigger did not fire at specified frequency. This blog tries to consolidate these recurrence behaviors.

 

Recurrence trigger:

In some scenarios the start times of recurrences might drift due to factors such as latency during storage calls. The options that can be made use of to make sure that your logic app doesn't miss a recurrence are documented here .

 

Connection-based trigger:

In addition to the factors explained above for recurrence trigger, recurrences for connection-based triggers like SFTP-SSH, Service Bus etc.  the recurrence schedule isn't the only driver that controls execution, and the time zone only determines the initial start time. Subsequent runs depend on the recurrence schedule, the last trigger execution, and other factors that might cause run times to drift or produce unexpected behavior. For more information, see Recurrence for connection-based triggers.

 

Recurrences for connection-based triggers might also drift due to long polling nature of the trigger. If suppose, SFTP-SSH recurrence trigger 'When a file is added or modified' fires as per schedule and finds a file, another trigger will run again after 15 seconds to check if there are any more files present. The subsequent next trigger execution time is calculated from the last trigger execution time plus Recurrence interval. Hence, whenever trigger is fired, the immediate 15 seconds trigger is getting executed and altering the subsequent trigger executions.

 

In the below example, we have a simple logic app where the recurrence trigger checks if a file is added or modified every 3 minutes.

 

Manohar_Patel_Seshapur_0-1610199094565.png

 

Let's consider the below 3 trigger runs.

 

Trigger history.PNG

 

Here, the trigger fired at 6:52:14 PM and found a file.

 

TriggerFireSucceeded.PNG

 

And then the trigger executed another run in roughly 15 seconds to check for any other pending files.

 

TriggerFollwupRund.PNG

The subsequent next trigger which you would assume to run at 6:55:14 PM as per schedule has actually run at 6:55:33 PM i.e. 3 minutes after the follow-up trigger run that ended at 6:52:33 PM.

 

SubsequentNextTriggerRun.PNG

 

This is by design, contrary to normal assumption. So, every time the trigger fires and finds a file, the next subsequent would drift by roughly 15 seconds and in the long run the trigger recurrence would drift by hours or days from the expected schedule.

 

If this a concern, you can workaround this behavior by using a the normal recurrence trigger instead of the SFTP-SSH recurrence trigger as shown in the below sample.

 

SFTPWithNormalRecurrenceTrigger.PNG

%3CLINGO-SUB%20id%3D%22lingo-sub-2033429%22%20slang%3D%22en-US%22%3ERecurrence%20trigger%20not%20fired%20at%20specified%20frequency%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2033429%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20might%20be%20scenarios%20noticed%20where%20recurrence%20trigger%20did%20not%20fire%20at%20specified%20frequency.%20This%20blog%20tries%20to%20consolidate%20these%20recurrence%20behaviors.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ERecurrence%20trigger%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%20data-unlink%3D%22true%22%3EIn%20some%20scenarios%20the%20start%20times%20of%20recurrences%26nbsp%3B%3CSPAN%3Emight%20drift%20due%20to%20factors%20such%20as%20latency%20during%20storage%20calls.%20The%20options%20that%20can%20be%20made%20use%20of%20to%20make%20sure%20that%20your%20logic%20app%20doesn't%20miss%20a%20recurrence%20are%20documented%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Flogic-apps%2Fconcepts-schedule-automated-recurring-tasks-workflows%23schedule-triggers%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehere%26nbsp%3B%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%3EConnection-based%26nbsp%3B%3C%2FSPAN%3Etrigger%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIn%20addition%20to%20the%20factors%20explained%20above%20for%20recurrence%20trigger%2C%20recurrences%20for%20connection-based%20triggers%20like%20SFTP-SSH%2C%20Service%26nbsp%3BBus%20etc.%26nbsp%3B%20the%20recurrence%20schedule%20isn't%20the%20only%20driver%20that%20controls%20execution%2C%20and%20the%20time%20zone%20only%20determines%20the%20initial%20start%20time.%20Subsequent%20runs%20depend%20on%20the%20recurrence%20schedule%2C%20the%20last%20trigger%20execution%2C%26nbsp%3B%3CEM%3Eand%3C%2FEM%3E%26nbsp%3Bother%20factors%20that%20might%20cause%20run%20times%20to%20drift%20or%20produce%20unexpected%20behavior.%26nbsp%3BFor%20more%20information%2C%20see%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fconnectors%2Fapis-list%23recurrence-connection-based%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%20data-linktype%3D%22relative-path%22%3ERecurrence%20for%20connection-based%20triggers%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERecurrences%20for%20connection-based%20triggers%20might%20also%20drift%20due%20to%20long%20polling%20nature%20of%20the%20trigger.%26nbsp%3B%3C%2FSPAN%3EIf%20suppose%2C%20SFTP-SSH%20recurrence%20trigger%20%3CSPAN%3E'When%20a%20file%20is%20added%20or%20modified'%26nbsp%3B%3C%2FSPAN%3Efires%20as%20per%20schedule%20and%20finds%20a%20file%2C%20another%20trigger%20will%20run%20again%20after%2015%20seconds%20to%20check%20if%20there%20are%20any%20more%20files%20present.%20The%20subsequent%20next%20trigger%20execution%20time%20is%20calculated%20from%20the%20last%20trigger%20execution%20time%20plus%20Recurrence%20interval.%26nbsp%3BHence%2C%20whenever%20trigger%20is%20fired%2C%20the%20immediate%2015%20seconds%20trigger%20is%20getting%20executed%20and%20altering%20the%20subsequent%20trigger%20executions.%3C%2FP%3E%0A%3CP%20class%3D%22xmsonormal%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%20class%3D%22xmsonormal%22%3EIn%20the%20below%20example%2C%20we%20have%20a%20simple%20logic%20app%20where%20the%20recurrence%20trigger%20checks%20if%20a%20file%20is%20added%20or%20modified%20every%203%20minutes.%3C%2FP%3E%0A%3CP%20class%3D%22xmsonormal%22%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Manohar_Patel_Seshapur_0-1610199094565.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F245050iE58242AAF9F0FDFA%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Manohar_Patel_Seshapur_0-1610199094565.png%22%20alt%3D%22Manohar_Patel_Seshapur_0-1610199094565.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELet's%20consider%20the%20below%203%20trigger%20runs.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Trigger%20history.PNG%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F245085iDD93088DB163512C%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Trigger%20history.PNG%22%20alt%3D%22Trigger%20history.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHere%2C%20the%20trigger%20fired%20at%20%3CSPAN%3E6%3A52%3A14%20PM%3C%2FSPAN%3E%20and%20found%20a%20file.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22TriggerFireSucceeded.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F245086i5F1E9F095676EBB2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22TriggerFireSucceeded.PNG%22%20alt%3D%22TriggerFireSucceeded.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20then%20the%20trigger%20executed%20another%20run%20in%20roughly%2015%20seconds%20to%20check%20for%20any%20other%20pending%20files.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22TriggerFollwupRund.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F245088i2C10EA0DF7503115%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22TriggerFollwupRund.PNG%22%20alt%3D%22TriggerFollwupRund.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20subsequent%20next%20trigger%20which%20you%20would%20assume%20to%20run%20at%26nbsp%3B%3CSPAN%3E6%3A55%3A14%20PM%3C%2FSPAN%3E%26nbsp%3Bas%20per%20schedule%20has%20actually%20run%20at%26nbsp%3B%3CSPAN%3E6%3A55%3A33%20PM%20i.e.%203%20minutes%20after%20the%20follow-up%26nbsp%3Btrigger%20run%20that%20ended%20at%26nbsp%3B6%3A52%3A33%20PM.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SubsequentNextTriggerRun.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F245090iCF267175F4A5E2F2%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SubsequentNextTriggerRun.PNG%22%20alt%3D%22SubsequentNextTriggerRun.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20is%20by%20design%2C%20contrary%20to%20normal%20assumption.%20So%2C%20every%20time%20the%20trigger%20fires%20and%20finds%20a%20file%2C%20the%20next%20subsequent%20would%20drift%20by%20roughly%2015%20seconds%20and%20in%20the%20long%20run%20the%20trigger%20recurrence%20would%20drift%20by%20hours%20or%20days%20from%20the%20expected%20schedule.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20this%20a%20concern%2C%20you%20can%20%3CSTRONG%3Eworkaround%26nbsp%3B%3C%2FSTRONG%3Ethis%20behavior%20by%20using%20a%20the%20normal%20recurrence%20trigger%20instead%20of%20the%20SFTP-SSH%20recurrence%20trigger%20as%20shown%20in%20the%20below%20sample.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SFTPWithNormalRecurrenceTrigger.PNG%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F245174i1407F4BDBF7F486C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SFTPWithNormalRecurrenceTrigger.PNG%22%20alt%3D%22SFTPWithNormalRecurrenceTrigger.PNG%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-2033429%22%20slang%3D%22en-US%22%3E%3CP%3EThere%20might%20be%20scenarios%20noticed%20where%20recurrence%20trigger%20did%20not%20fire%20at%20specified%20frequency.%20This%20blog%20tries%20to%20consolidate%20these%20recurrence%20behaviors.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2033429%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ELogic%20Apps%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Version history
Last update:
‎Jan 11 2021 01:20 AM
Updated by: