How Custom App Background Jobs and Scheduling Work
On This Page
How Background Jobs Work
The platform runs a cron system that checks for work every minute. When a scheduled job is due, the cron spawner reads your app's configuration, finds the function that should run, and launches a background process to execute it. This process runs the same way an API request would, with full access to the database, AI models, email and SMS sending, and every other platform feature.
Behind the scenes, the cron system reads your app's configuration file to find any defined schedules. When the current time matches a schedule pattern, it spawns a new process using the same job runner that handles all platform background work. Your custom app's function receives the account ID and any configured parameters, does its work, and exits. If the job needs to process a large amount of data, it can queue additional jobs that the system picks up on subsequent runs.
Each background job runs independently. If one job takes longer than expected or encounters an error, it does not block other jobs from running. The system is designed to handle many jobs running in parallel across different accounts and apps, so your scheduled tasks do not compete with other users for processing time.
Schedule Options and Timing
You can configure background jobs to run at different intervals depending on what your app needs. The schedule system supports several timing patterns:
- Every minute for real-time monitoring, queue processing, or immediate follow-up tasks
- Every hour for periodic syncing, report generation, or batch processing
- Daily at a specific hour for morning reports, end-of-day summaries, or daily cleanup tasks
- Custom time ranges such as running only during business hours (8 AM to 7 PM) to avoid sending notifications at night
- Specific minutes within an hour for precise timing when a job should run at exactly :15 or :30 past the hour
All schedule times are in Eastern Standard Time. The schedule configuration uses a simple format where you specify the hour (or a range of hours, or a wildcard for every hour) and the minute. For example, a job configured for "9:00" runs once a day at 9 AM EST, while a job configured for "*:00" runs at the top of every hour.
Each app can have multiple scheduled jobs with different timing. A single custom app might have one job that runs every hour to check for new data, another that runs daily at 8 AM to send a summary email, and a third that runs every minute to process a queue. There is no limit to how many scheduled jobs an app can define.
Turning Schedules On and Off
Every app has a schedule status setting that controls whether its background jobs are active. You can turn scheduling on or off from the admin panel without modifying the app's code. This is useful when you need to pause a job temporarily, for example while you update the app's logic or during a maintenance window. The jobs resume exactly where they left off when you turn scheduling back on.
Common Use Cases for Background Jobs
Background jobs are useful any time your app needs to do work that is not triggered by a user action. Here are some of the most common scenarios:
Sending Reminders and Notifications
A booking app can check each morning for appointments scheduled for the next day and send SMS or email reminders to the customers. A membership app can notify users when their subscription is about to expire. A task manager can send daily digest emails listing overdue items. The background job reads the relevant data from the database, identifies which notifications need to go out, and uses the platform's email or SMS features to deliver them.
Processing Queues
When your app needs to handle a large volume of work, background jobs can process items from a queue in manageable batches. For example, an import tool might accept a CSV upload through the API, store the raw data, and then process rows in the background, a few hundred at a time, until the import is complete. This prevents timeouts and keeps the API responsive.
Syncing Data With External Services
A background job can call an external API on a schedule to pull in new data or push updates out. An inventory app might sync stock levels with a supplier's system every hour. A CRM might pull new leads from a form service every five minutes. A reporting app might push daily metrics to a Google Sheet or external dashboard.
Generating Reports and Summaries
Jobs that aggregate data and produce reports work well as scheduled tasks. A daily job might calculate sales totals, count new sign-ups, or compile activity logs into a summary that gets emailed to the account owner. Because the job runs in the background, it can take as long as it needs to process the data without affecting the user experience.
Cleanup and Maintenance
Background jobs can handle routine housekeeping like archiving old records, clearing expired sessions, removing temporary data, or updating calculated fields. These tasks keep the database clean and the app running efficiently without requiring anyone to remember to do them manually.
How to Tell the AI to Add a Scheduled Job
When you are building or updating your custom app, you can ask the AI to add a background job by describing what the job should do and when it should run. The AI understands the scheduling system and will configure everything automatically.
Be specific about the timing and the task. Instead of saying "add a scheduled job," say something like "add a background job that runs every morning at 8 AM and sends an email summary of all orders from the previous day to the account owner." The AI will write the function that queries the database, compiles the summary, sends the email, and configure the schedule to trigger at 8:00 EST.
You can also describe the job in terms of the business outcome: "I want customers to get a reminder text message 24 hours before their appointment." The AI figures out that this means a job needs to run daily (or hourly for more precision), query upcoming appointments, calculate which ones are 24 hours away, and send an SMS to each customer.
Cost and Billing
Background jobs are billed the same way as regular API calls. Each time a scheduled job runs, it counts as one execution and uses credits based on what the job does. A simple job that reads a few database rows and sends one email costs only a few credits. A job that makes AI queries or processes large amounts of data costs more, proportional to the AI models and resources it uses.
The base cost per job execution is between 1 and 10 credits depending on the complexity. If the job calls an AI model, the AI usage is billed at the standard model rates on top of the base cost. Database reads and writes are included in the base cost. Sending emails or SMS through the job uses the same rates as sending them through the API.
Because jobs run automatically, it is worth thinking about frequency and cost together. A job that runs every minute executes 1,440 times per day. If each execution costs 2 credits, that is 2,880 credits per day. A job that runs hourly executes 24 times per day for 48 credits. Choose the frequency that matches your actual needs to keep costs reasonable.
Build a custom app with automated background jobs. Describe what you need and the AI handles the rest.
Start Building Free