Can Freshworks Apps Have Multiple Recurring $schedule.create() Calls?

Hi community :wave:,

I’m currently developing a Freshdesk custom app using the Freshworks platform and the $schedule.create() API. I understand that we can create recurring schedules using the repeat property like this:

await $schedule.create({
name: “task1_repeat”,
data: { task: “task1” },
schedule_at: “…”,
repeat: {
time_unit: “minutes”,
frequency: 5
}
});

Now I want to run two different recurring tasks from the same app:

  1. Task 1 — runs every 5 minutes (starting 2 minutes after install)
  2. Task 2 — runs every 5 minutes (starting 6 minutes after install)

So I tried creating two separate $schedule.create() calls with different names and repeat configs.

However, I received the following error:

:x: Schedule creation error:
{
status: undefined,
message: ‘The maximum number of recurring schedules is 1’
}

:question: My Questions:

  • Does the platform restrict apps to only one active recurring schedule with repeat at a time?
  • Is it possible to create multiple recurring schedules, each with its own repeat?
  • If not, is the only workaround to have one task use repeat, and schedule the other(s) manually using schedule_at?

Any clarification or best practices would be greatly appreciated :pray:

Hi @allenjohn

You can’t create multiple recurring schedules, but you can achieve recurring schedule functionality by creating a one-time schedule each time the previous one finishes executing. To do this, use the same name and set the next execution date accordingly. Please refer to the post below.