Presets for the usual
Every 1, 5, 10, 15 or 30 seconds, every few minutes or hours, every day, working days, every month or every year.
API Maker
The backend engine for the AI era
Your code
Run your code on a timetable, once per cluster, without a cron server.
A scheduler is a function, in any of the 8 languages, plus one or more intervals: every few seconds, every day at midnight, or your own cron. With several servers, each scheduler belongs to one of them, held with a key in Redis, so every run happens once. If that server goes down, another one takes over.
Step through it, slow it down, or open the full canvas.
A scheduler is your code and its intervals. Write a function with g, in any of the 8 languages, add one or more intervals and press Ctrl + S. It is saved and scheduled: no cron server to set up.
Write a function with g, in any of the 8 languages, add one or more intervals and press Ctrl + S. It is saved and scheduled: no cron server to set up.
From every 5 seconds to every year, or your own cron with seconds. Each interval has its time zone and can be switched off.
The schedulers are spread evenly over the servers which are up. The server a scheduler belongs to takes it with a key in Redis, so each run happens once in the cluster.
The owner runs your code in a sandbox, with the timeout of the scheduler, and saves the log of each run. It renews its Redis key every 5 seconds.
A server that stops hands its schedulers over within a second. When it dies, its key is not renewed and runs out after 20 seconds: another server takes the scheduler.
The owner stops its jobs, a run in progress finishes, and the scheduler starts again with the new code. No redeploy.
Every 1, 5, 10, 15 or 30 seconds, every few minutes or hours, every day, working days, every month or every year.
A server which stops hands its schedulers to the others within a second. When it dies, they move within about twenty seconds, when its hold runs out.
Query and update any database, call external APIs, emit events and use your utility classes, like in a custom API.
Expire old carts, send a daily sales report by email, sync prices from a supplier API every 15 minutes. Each one is a scheduler in API Maker, versioned with the rest of your project and deployed with it.
import * as T from 'types';async function main(g: T.IAMGlobal) { const dayAgo = new Date(Date.now() - 24 * 60 * 60 * 1000); const result = await g.sys.db.updateMany({ instance: 'mongodb', database: 'shop', collection: 'carts', find: { status: 'open', updatedAt: { $lt: dayAgo } }, updateData: { status: 'expired' }, }); g.logger.log(`${result.updatedRowsCount} carts expired`);}module.exports = main;Interval: every day, at midnight, Asia/Kolkata. Press Ctrl + S and it is scheduled.
On the real admin panel, with real data.
Yes. Switch the scheduler off, or switch off one of its intervals.
In a sandbox of its account, on the server which holds it, or on the native process when you allow it.
Documentation