Custom Cron Expression | Experience Community
Skip to main content
Question

Custom Cron Expression

  • February 9, 2026
  • 1 reply
  • 14 views

kgillis
Level 6 ●●●●●●
Forum|alt.badge.img+30

I have stand alone workflows set up with custom cron expressions that are not working as anticipated and as appearing to be programmed correctly - per Qualtrics support “The entire statement can't be treated as an AND statement. This means that it was checking for if the day was 15th-21st or if the day was a Thursday. They confirmed that, it looks like there isn't a way to set up a Cron expression that specifically sends on the first, second, or third Thursday of a month.” This is very frustrating and there is nothing on the Qualtrics side stating this is not possible and there was an error in the expression.
 

This will be very time consuming as every 2nd and 4th Thursday I am sending out email invites to a specific survey and every 3rd Thursday it needs another email and survey invite sent (different from the one that is sent on the 2nd and 4th Thursdays). This is a long term project and I would like to not have to manually set up individual distributions 36+/year. Does anyone have a trick/shortcut to achieving this?

1 reply

vgayraud
QPN Level 7 ●●●●●●●
Forum|alt.badge.img+61
  • QPN Level 7 ●●●●●●●
  • February 10, 2026

Hi,

The way I’ve done similar things in the past in by running workflows daily at a fixed time but adding a code task to compute if the current day was a distribution day or not.

Then in your workflow you can add conditions and branches based on the returned values.

Be sure to take into account your timezone.

In your case, it would probably look like this:

function codeTask() {
const today = new Date();
const dayOfWeek = today.getDay();
const dayOfMonth = today.getDate();
const weekOfMonth = Math.floor((dayOfMonth - 1) / 7) + 1;

let isDistributionDay = false;

if (dayOfWeek === 4 && weekOfMonth <= 3) {
isDistributionDay = `thursday${weekOfMonth}`; // e.g., "thursday1", "thursday2", or "thursday3"
}

return {
isDistributionDay,
today,
dayOfWeek,
dayOfMonth,
weekOfMonth
};
}