Automate Backend Jobs with Cron Like Scheduling
- API Maker’s Schedulers feature gives your applications a Cron-like capability to automate backend jobs and schedule API tasks.
- With a user-friendly interface, you set up tasks such as nightly data syncs, routine maintenance, or automated report emails, and API Maker handles running them reliably on time.
- In short, Schedulers let developers and teams schedule API tasks and automate routine work without manual triggers.
- Create and manage schedules via API Maker’s no-code dashboard. For each scheduler you provide a name, label, timeout, script, and one or more intervals . The web interface is designed for developers and non-developers.
- Use built-in intervals (seconds, minutes, hours, days, weeks, months) or enter custom CRON expressions for complex schedules. You can also set different time zones and toggle each interval active or inactive.
- Each scheduled job runs with a default timeout (10 minutes) to prevent runaway scripts. If a script exceeds this, it stops (you can adjust the timeout).
- Deploying new code or restarting servers won’t interrupt an ongoing job – it finishes gracefully and then resumes on the updated code
- Schedulers automatically distribute tasks across all servers in your API Maker cluster. Only one server executes a given job at a time, and if a server goes offline, another automatically picks up its scheduled tasks. This makes scheduling highly reliable at enterprise scale.
- Before activating a schedule, you can test your code in the API Maker API Testing page. Select the scheduler, hit “SEND”, and see the live output and logs in the UI. This helps debug and verify results in real-time.
Why Use API Maker Schedulers?
Automating tasks shouldn’t feel like rocket science, and with API Maker’s Schedulers, it isn’t. Here’s why developers, startups, and enterprise teams love it:
No More External Cron Servers
- Forget managing third-party cron services or writing custom backend workers. API Maker has built-in scheduling – just plug in your logic and hit save. It runs directly on your existing backend, no extra setup required.
Unified Backend Automation
- From syncing data to sending daily reports, everything runs within your existing API ecosystem. You don’t need separate jobs or pipelines, it’s all native, efficient, and tightly integrated with your database, APIs, and logic.
Smart for Teams, Safe for Ops
- Need a script to run every Monday? Or every 10 minutes in Tokyo time? No problem.
With timezone-aware scheduling, fine-tuned intervals, and safe fail-overs across servers, API Maker ensures your jobs run on time, every time, even if a server goes down.
Schedule Without Code (or with Code)
- Developers can use the UI to create, toggle, or monitor schedules easily.
Can go deeper, writing custom scripts in JS/TS, accessing collections, calling APIs, and logging detailed outputs. It’s low-code when you need it. Full-code when you want it.
Changes Apply Instantly
- Edit your code, save it, boom, next run uses the latest logic. No redeploys. No delays. Schedulers update in real-time.
Developer-Friendly Features
- Supports CRON expressions & custom timezones.
- Built-in testing before going live.
- Cluster-safe execution (only one job at a time, not multiple execution of scheduler even if we have multiple servers).
- Full access to
g
object for DB, email, APIs, and more.
- Logging with log profiles.
- Timeout control to prevent job hangs.
- Developer can directly check & fix issues of production or QA or UAT servers without reproducing entire scenario in local and press
ctrl + s
and changes are saved & deployed. This saves lot of time of developer and makes bug fixing super fast and enjoyable.
Why Developers Prefer API Maker's Schedulers Over Others:
Feature |
API Maker |
Supabase |
Appwrite |
Firebase |
Built-in schedulers |
✅ Yes |
⚠️ Using pg_cron Extension |
⚠️ Using Serverless Functions |
⚠️ Cloud Functions |
Cron/interval support |
✅ Yes |
✅ Yes |
✅ Yes |
✅ Yes |
Visual scheduling |
✅ GUI |
✅ Yes |
⚠️ Limited |
❌ |
Script editing |
✅ Yes (JS/TS) |
✅ Yes |
✅ Yes |
✅ Yes |
Auto failover on cluster |
✅ Yes |
⚠️ Yes |
⚠️ Yes |
✅ Yes |
Code testing in UI |
✅ Yes |
❌ |
❌ |
❌ |
Can developer test/trigger manually |
✅ Yes |
❌ |
✅ Yes |
❌ |
Common Use Cases of schedulers
- Data Syncs & Integrations: Schedule regular API calls or database queries to sync data between systems (e.g. nightly ETL jobs, syncing CRM to data warehouse).
- Automated Reports & Notifications: Generate and email reports (sales summaries, analytics dashboards, log digests) on a schedule (daily, weekly, etc.), or trigger alerts when certain conditions are met.
- Maintenance & Cleanup: Periodic housekeeping tasks like cleaning old records, archiving logs, or recalculating aggregates can run automatically (e.g. delete stale data every week).
- Cache Refresh & Watch logs: Refresh caches or run health-check scripts on a schedule to keep the system performant and resilient. For example, ping external services or refresh API tokens hourly.
- Any Repeating Task: Essentially any backend job or custom API call that needs to repeat over time. Instead of writing a separate cron server, use API Maker’s scheduler engine to run code on multiple
intervals
at multiple time zones.
How Schedulers Work (Technical Details)
API Maker’s Schedulers run your custom JavaScript/TypeScript code on a schedule. Under the hood, each scheduler is an object with properties like name
, label
, timeouts
, code
, and an array of intervals. You can create, update or delete these schedulers either via the API Maker admin UI or its REST API. Key capabilities include:
- Create/Update/Delete: Define a new scheduler by providing a unique name (immutable) and label, specify a timeout (in minutes) and the code to run, and add one or more intervals with time unit, CRON (if custom), timezone, and active flag. You can later change the label, code, or intervals as needed.
- Intervals & Timing: Choose from preset intervals (e.g. “5 Minute”, “2 Hour”, “Daily”) from dropdowns. For advanced schedules, enter a CRON expression – API Maker supports custom CRON definitions (e.g. 0 22 * * 1-5 for every weekday at 22:00). Each interval also has a timezone setting, so tasks run at the correct local time.
- Single execution per interval: Even on a multi-servers setup, each scheduled job runs exactly once per interval across the entire cluster. API Maker ensures no duplicate runs; the job is picked up by one node.
- Smooth Shutdown & Updates: If a server goes offline, jobs shift to another one instantly. You can update code without stopping running tasks, they finish normally, and new ones use the latest code.
- On-Demand Control: Start or stop schedulers anytime from the UI or API. Great for quick pauses or one time runs.
- Logging and Debugging: Each scheduler can use API Maker’s logging. By setting a log profile, you capture execution logs for every run. In your code, you can use
console.log
or the global object g
to log details, and view them in the logs tab of the UI.
Example: JSON Definition and Script
{
"name": "DailyReport",
"label": "Send Daily Sales Report",
"timeouts": 5,
"code": "____Scheduler_Code____",
"intervals": [
{
"timeInterval": "Daily",
"timeZone": "UTC",
"active": true
}
]
}
In this example, the scheduler is named Daily Report, will time out after 5 minutes if the job hangs, and runs once per day at midnight UTC. The code
uses the global object g
(an API Maker helper) to get data and send a notification. The actual scheduler script can use any of API Maker’s system APIs via g
. For instance, a code sample might look like:
async function main(g) {
// Fetch all documents from a collection and implement business logic with them.
const results = await g.sys.db.getAll({
instance: "INSTANCE_NAME",
database: "DB_NAME",
collection: "COLLECTION_NAME" });
return results;
}
module.exports = main;
This uses the global object g
(see docs) to query a database. You could also call external APIs, update other collections, etc.
Testing and Monitoring
- Test & Monitor Your Scheduler Easily Go to the API Maker Testing page, choose your scheduler from the dropdown, and its code will load automatically. Click SEND to run it instantly and see the output or any errors.
- You’ll find the result in the Response tab, and any
console.log
or log()
messages will appear in the Logs tab on the right.
- For ongoing monitoring, make sure you’ve set up a log profile. This helps you track past runs, catch errors, and record custom metrics, all in one place.
FAQ's
1. What is the Scheduler feature in API Maker?
The Scheduler lets you automate API calls at specific times or intervals, like a built-in cron job system, but with more control and visibility. You can schedule tasks like sending emails, clearing logs, syncing data, or even calling third-party APIs, all without external tools or extra code.
2. Why should I use API Maker's Scheduler instead of writing my own cron job?
Because writing and maintaining cron jobs is a pain. API Maker’s Scheduler offers a visual interface, version control, built-in logging, failure handling, and retry logic, all from a central platform. No need to SSH into servers or worry about OS-level scripts failing silently.
3. Can I run custom APIs or third-party APIs on a schedule?
Yes! You can schedule any API, including system APIs, custom APIs, and third-party URLs. Just define the schedule, add any headers/body parameters, and you're done.
4. Do I need to redeploy to change a schedule?
Not at all. You can update, pause, or delete a scheduler from the Admin UI in real-time, no server restart or deployment required. Changes take effect instantly.
5. What kind of schedule intervals are supported?
You can run tasks at fixed intervals (like every 5 minutes), daily at specific times, weekly, monthly, or even with custom cron expressions for advanced control.
6. Is there logging or error tracking for scheduled tasks?
Yes. API Maker keeps logs for each scheduled task run, whether it succeeded or failed. You can view the response, status code, and execution time right in the dashboard.
7. Can I disable a schedule temporarily?
Yes. You can pause/resume schedulers with a single toggle. Great for maintenance windows or testing changes before reactivating.
8. What if my scheduled task fails?
Failures are logged with full details. You can manually retry a failed task or implement retry logic using custom headers or a fallback scheduler.
9. Can I pass headers and body data with the scheduled API request?
Absolutely. API Maker lets you customize each scheduled request with method, headers, request body, and even dynamic variables, just like any other API call for testing purpose.
10. Is there a limit on how many schedulers I can create?
There’s no hard limit in API Maker itself, it depends on your infrastructure and how often your tasks are scheduled. API Maker is built to scale with enterprise use cases.