Cron time conditions - Intro and how to set them up

With our release of time conditions, we wanted to stay true to our tinkering roots and add an advanced time condition configuration through cron expressions. If you are familiar with these: this is exciting, right :star_struck:? And if you have never heard about them, don’t worry, as you can read more about them below and you’ll be using them in no time!

What’s a cron expression?

A cron expression is a string that represents a schedule when you want to execute a routine. For example in this image from crontab guru we are showing you that 5 8 * 4 6,7 means “At 08:05 on Saturday and Sunday in April.”

Click here to go to this example and have a play! https://crontab.guru/#5_8_*_4_6,7

Why are they powerful?

You are not limited by what you can setup in the UI, you can create a really customised time expression that will run your logic only at times of the day/week/month/year that you specify.

You can setup a condition that sets a schedule for your routine to only run on Saturdays in February, March and April. Or only run something the 15th of every month. You can be very specific with your cron expressions! :nerd_face: :alarm_clock:

In Apilio, you’ll be able to specify the cron expression plus a duration: this sets the length of the timeframe when you want your condition to be valid. For example, to allow a logicblock to operate every Monday at 9AM for 1 hour. This means that it will be allowed between 9AM and 10AM, on every Monday.

How do I set a time condition with a cron expression in Apilio?

These are a time condition, so head over to your condition section in Apilio:

  1. Go to https://app.apilio.com/conditions
  2. Choose new condition
  3. Choose type “time”
  4. From the dropdown, you’ll select “Advanced setup with cron”
  5. Fill in the details. You can use an external cron expression builder to write the expression. Enter a duration for your condition as well. Don’t forget to enter a name! You’ll be using this name in your logicblock to refer to this condition.
  6. Click save and you are done :slight_smile:

As is an advanced setup that is only available for our pro-plan users, and those of you who are on your trial (as you get to test everything Apilio can do for you).

Free cron expression builders

We have used crontab guru for these examples:
https://crontab.guru/

But there are many others out there:
http://www.cronmaker.com/
https://www.freeformatter.com/cron-expression-generator-quartz.html

Any further questions?

If you have any other questions, please leave them below

:bulb: Want to learn more about conditions? Have a look at these articles:

1 Like