Cron Jobs

> Run flows on a timer -- every minute, every hour, or on a custom schedule.

Cron jobs let you schedule a route to execute automatically at regular intervals. Use them for background tasks like cleanup jobs, report generation, data syncing, or periodic notifications.

How cron jobs work

1. You create a route with a Cron trigger. 2. You define a schedule using a cron expression. 3. Brickr runs the route automatically at the specified times. 4. The flow executes as if it received a normal request, but without any external caller.

Setting up a cron job

1. Create or open a route

Create a new route or open an existing one in the Builder.

2. Add a cron trigger

Click on the Start Node and look for the Triggers section. Add a Cron trigger.

3. Define the schedule

Enter a cron expression to define when the route should run.

Cron expression format

A cron expression has five fields:

* * * * *
| | | | |
| | | | +-- Day of week (0-6, Sunday=0)
| | | +---- Month (1-12)
| | +------ Day of month (1-31)
| +-------- Hour (0-23)
+---------- Minute (0-59)

Common schedules

| Expression | Schedule | |-----------|----------| | * * * * * | Every minute | | */5 * * * * | Every 5 minutes | | 0 * * * * | Every hour (at minute 0) | | 0 0 * * * | Every day at midnight | | 0 9 * * 1 | Every Monday at 9:00 AM | | 0 0 1 * * | First day of every month | | 0 */6 * * * | Every 6 hours |

All cron times are in UTC. Plan your schedules accordingly if you are in a different timezone.

If you are not familiar with cron syntax, search for "cron expression generator" online. Many free tools let you build expressions visually.

4. Save and deploy

Save and deploy the route. The cron trigger becomes active immediately after deployment.

Use cases

| Use Case | Schedule | Description | |----------|----------|-------------| | Database cleanup | 0 3 * * * | Delete expired records nightly | | Report generation | 0 8 * * 1 | Generate weekly report every Monday | | Data sync | */15 * * * * | Sync external data every 15 minutes | | Health check | */5 * * * * | Ping external services every 5 minutes | | Email digest | 0 18 * * * | Send daily summary email at 6 PM |

Cron flow design

Since cron flows have no incoming request, the Start Node does not provide request data (no body, no path params, no headers). Design your flow to:

1. Fetch data from the database or external sources. 2. Process the data. 3. Take action -- update records, send emails, call external APIs.

Cron routes do not return a response to a caller. Any Return JSON nodes in the flow will be ignored. Focus on side effects like database writes and external API calls.

Limits

| Plan | Cron jobs allowed | |------|-------------------| | Free | -- | | Pro | 5 | | Ultra | Unlimited |

Monitoring

Check the route's execution logs in the dashboard to verify that your cron job is running as expected. Look for:

  • Execution timestamps
  • Success/failure status
  • Error messages if something went wrong

Cron jobs that take longer than 30 seconds to execute may be terminated. For long-running tasks, consider breaking them into smaller steps.

What's next?

| Topic | Description | |-------|-------------| | Webhooks | Trigger flows from external services | | Email | Send emails from your flows | | Form Triggers | Trigger flows from form submissions |