cancel
Showing results for 
Search instead for 
Did you mean: 

Schedule a recipe

MurugarajSa
Deputy Chef III
Deputy Chef III

Hi,

I have to schedule a recipe to run every 4 hours starting from 11 AM in Timezone America/New_York(-05:00).

I am able to provide value to run every 4 hours but I am not able to provide starting time.

Your suggestion would be greatful for me.

Thanks

Capture1.PNG

2 ACCEPTED SOLUTIONS

gary1
Executive Chef III
Executive Chef III

Maybe there is a smarter way to do this, but when I need a recipe to run at specific times, I make multiple recipes with a Scheduler trigger set to the specific time that I want. The Scheduler recipe then calls the recipe function I want to run (and, as a best practice, I always create recipes as functions that are called by other recipes. There are many advantages to this approach, but mainly it makes recipes easier to maintain and troubleshoot.) 

Using the Scheduler like this ensures that the recipe ALWAYS runs at the EXACT time I want it to. Turning the recipe on/off doesn't affect the timing, and there is otherwise no drift in the timing. 

In your case, I would do this:

  1. Recipe 1 at 11 AM
  2. Recipe 2 at 3 PM
  3. Recipe 3 at 7 PM
  4. Recipe 4 at 11 PM

And so on...

View solution in original post

girish-naralla
Deputy Chef II
Deputy Chef II

Hi Murugaraja,

You can use the custom schedule there and you can use this cron expression ( 0 11/4 * * * ) and than you can select the timezone as America/New_York(-05:00).

Screenshot 2024-05-14 183700.png

Thanks.

 

View solution in original post

5 REPLIES 5

gary1
Executive Chef III
Executive Chef III

Maybe there is a smarter way to do this, but when I need a recipe to run at specific times, I make multiple recipes with a Scheduler trigger set to the specific time that I want. The Scheduler recipe then calls the recipe function I want to run (and, as a best practice, I always create recipes as functions that are called by other recipes. There are many advantages to this approach, but mainly it makes recipes easier to maintain and troubleshoot.) 

Using the Scheduler like this ensures that the recipe ALWAYS runs at the EXACT time I want it to. Turning the recipe on/off doesn't affect the timing, and there is otherwise no drift in the timing. 

In your case, I would do this:

  1. Recipe 1 at 11 AM
  2. Recipe 2 at 3 PM
  3. Recipe 3 at 7 PM
  4. Recipe 4 at 11 PM

And so on...

Prajwal
Deputy Chef III
Deputy Chef III

Hi @MurugarajSa ,

Following @gary1's advice, opting for that method seems more efficient than creating individual schedulers for multiple recipes.

If you insist on setting up a scheduler for your recipe and desire to establish a 'start after' time, ensure the recipe status should be 'never active'. Meaning, you cannot set a start-after field if the recipe has already executed several jobs of 'inactive' status as shown in the below pic.
Screenshot 2024-05-14 100705.png

To address this issue, simply make a copy of that recipe and configure the 'start after' field accordingly.

Prajwal Prasanna

shivakumara
Executive Chef I
Executive Chef I

Hi @MurugarajSa ,

Once a recipe has already run, it's not possible to set a Start_after field. In such cases, one option is to clone the recipe and provide a value for the field. 

Here I  Provided a screenshots which contains 1. After cloning the recipe 2. Before cloning the recipe  3. Talk about description where it states "Start_after" date cannot be set once the recipe has started. After Cloning RecipeAfter Cloning RecipeBefore Cloning RecipeBefore Cloning Recipe
Start_after.png

 

girish-naralla
Deputy Chef II
Deputy Chef II

Hi Murugaraja,

You can use the custom schedule there and you can use this cron expression ( 0 11/4 * * * ) and than you can select the timezone as America/New_York(-05:00).

Screenshot 2024-05-14 183700.png

Thanks.