Scheduled and recurring tasks

Aha! Builder

Aha! Builder applications can run code on a schedule. A cron function executes automatically at a time you define — every five minutes, every hour, every Monday afternoon — to do recurring work such as sending reminder emails or refreshing data. Elle adds one when you describe something that should happen on a repeating schedule.

This reference documents how scheduled functions are defined and how the schedule itself is expressed. Read it to see what your applications can automate, to review what Elle generated, or to ground an AI assistant in the specifics — reference this article with Elle or any LLM so it knows exactly how scheduled functions work in Aha! Builder.

Click any of the following links to skip ahead:

Overview

A "cron function" is a type of server function which executes on a schedule. This example will run once an hour (on the hour) to send emails to customers needing a reminder.

import { server } from '@aha-app/builder-core';

server.cron('sendReminderEmail', {
schedule: '0 * * * *',
}, async () => {
// Send email.
});

Top

Schedule

The schedule option accepts a standard cron expression.

{ schedule: '*/5 * * * *' }   // Every 5 minutes
{ schedule: '0 * * * *' } // Every hour
{ schedule: '0 14 * * 1' } // Monday at 2pm

Top

Build it with Elle

Describe the capability you want in plain language, and Elle, the Aha! Builder AI assistant, builds it into your application using the framework above.

New to this? Open Elle, ask what it can do, and try a capability in your application today.

Top

Feedback received!

Error submitting feedback, please try again later