# How to set up workflow scheduling for periodic tasks in Bubble.io: Step-by-Step 

- Tool: Bubble
- Difficulty: Intermediate
- Time required: 15-20 min
- Compatibility: Growth plan+ (backend workflows required)
- Last updated: March 2026

## TL;DR

Schedule periodic tasks in Bubble using recursive backend workflows that reschedule themselves. Create a backend workflow, add your task logic, then use the 'Schedule API Workflow' action at the end to schedule itself again at the next interval. Include a termination condition to prevent infinite loops. This pattern handles daily reports, weekly cleanups, hourly data syncs, and more.

## Schedule Periodic Tasks in Bubble Workflows

This tutorial shows you how to implement cron-job-style recurring tasks in Bubble using recursive backend workflows. You will learn to schedule tasks at any frequency, manage them safely, and monitor execution.

## Before you start

- Growth plan or higher (backend workflows require paid plan)
- Backend workflows enabled in Settings → API
- Basic understanding of backend workflows and scheduling

## Step-by-step guide

### 1. Create the Recurring Backend Workflow

Go to Workflow tab → Backend workflows → New workflow. Name it 'daily-report-task'. Add parameters if needed (e.g., report_type text). Add your task logic: search for data, create a report record, send summary emails. At the end, add the 'Schedule API Workflow' action targeting this same workflow with a run date of 'Current date/time +(days):1' for daily execution.

> Pro tip: Always add the self-scheduling action as the LAST step, after all task logic completes. This way, if the task fails, it does not reschedule indefinitely with a broken state.

**Expected result:** A backend workflow that executes its logic and schedules itself to run again tomorrow.

### 2. Add Termination and Safety Conditions

Before the self-scheduling action, add an 'Only when' condition. For example: 'Only when Do a Search for AppSettings:first item's enable_daily_report is yes'. This lets you disable the recurring task from an admin panel without editing the workflow. Also add a check for maximum retries or end date: 'Only when Current date/time < some_end_date'. Without termination conditions, the workflow runs forever.

**Expected result:** The recursive workflow stops when disabled or when an end condition is met.

### 3. Initiate the First Run

Recurring workflows need to be started once. Create a button on an admin page: 'Start Daily Report'. The workflow schedules 'daily-report-task' for the first run time (e.g., tomorrow at 6:00 AM). From then on, it self-reschedules. Alternatively, schedule it from a 'Page is loaded' workflow that checks if no future run is already queued.

**Expected result:** The recurring task is started and will continue running at the specified interval.

### 4. Manage Different Frequencies

Adjust the scheduling interval in the self-scheduling action: Hourly: Current date/time +(hours):1. Daily: +(days):1. Weekly: +(days):7. Monthly: +(months):1. For specific times (e.g., 9 AM daily), calculate the next 9 AM: Current date/time :rounded down to day +(days):1 +(hours):9.

**Expected result:** Tasks run at the desired frequency — hourly, daily, weekly, or monthly.

### 5. Monitor Scheduled Tasks

Go to Logs → Scheduler to see queued workflows and their status. Create a ScheduleLog data type to track executions: log the start time, end time, status (success/failed), and any error messages within the backend workflow. Build an admin dashboard showing recent executions and next scheduled run.

**Expected result:** You can monitor task execution history and upcoming scheduled runs.

## Complete code example

File: `Workflow summary`

```text
BACKEND WORKFLOW: daily-report-task
Params: report_type (text)

Actions:
1. Search for Orders (Created Date > Current date/time +(days):-1)
2. Calculate: total_revenue = search results :each item's amount :sum
3. Create DailyReport (date, total_revenue, order_count)
4. Send email to admin with report summary
5. Create ScheduleLog (workflow='daily-report', status='success', timestamp)
6. Schedule API Workflow: daily-report-task
   Scheduled date: Current date/time :rounded down to day +(days):1 +(hours):9
   Only when: AppSettings's enable_daily_report is yes

INITIATION (admin page button):
When Start Daily Report clicked:
→ Schedule API Workflow: daily-report-task
  Scheduled date: Tomorrow at 9:00 AM

FREQUENCY OPTIONS:
- Hourly: +(hours):1
- Every 6 hours: +(hours):6
- Daily at 9 AM: :rounded down to day +(days):1 +(hours):9
- Weekly (Monday): :rounded down to day +(days):(7 - weekday + 1) +(hours):9
- Monthly: +(months):1
```

## Common mistakes

- **Forgetting the termination condition** — Without a way to stop, the workflow runs forever, consuming workload units even when no longer needed. Fix: Always include an 'Only when' condition on the self-scheduling step that checks an admin-controllable flag.
- **Scheduling at exact intervals instead of fixed times** — Using +(hours):24 drifts over time due to execution duration. A task starting at 9:00 AM may drift to 9:02, then 9:04, etc. Fix: Calculate the next fixed time: :rounded down to day +(days):1 +(hours):9 for daily at 9 AM.
- **Not handling execution failures** — If the task fails mid-execution, it may not reschedule, breaking the recurring pattern. Fix: Move the self-scheduling action before the main logic, or add error handling that reschedules even on failure.

## Best practices

- Add an admin-controllable flag (AppSettings) to enable/disable recurring tasks without editing workflows.
- Schedule at fixed times rather than fixed intervals to prevent time drift.
- Log every execution with timestamp and status for monitoring.
- Include error handling that reschedules even when the task fails.
- Build an admin dashboard showing execution history and next scheduled run.
- Test with short intervals (every 5 minutes) before switching to the production frequency.

## Frequently asked questions

### Can I schedule tasks on the free plan?

No. Backend workflows require Growth plan or higher. Free and Starter plans cannot run server-side scheduled tasks.

### What is the minimum scheduling interval?

You can schedule down to the second, but Bubble does not guarantee exact-second precision. For intervals under 1 minute, consider whether a frontend Do Every X Seconds workflow is more appropriate.

### How do I cancel a scheduled recurring task?

Set the admin flag to false — the next execution will not reschedule itself. To cancel an already-queued run, you can delete it from the Scheduler tab in Logs.

### What happens if my app is down during a scheduled run?

Bubble handles infrastructure; if the platform is operational, queued workflows run. If there is an outage, check if the workflow rescheduled itself afterward.

### Can I have multiple recurring tasks running simultaneously?

Yes. Each recurring workflow is independent. You can have daily reports, weekly cleanups, and hourly syncs all running concurrently. For complex scheduling architectures, RapidDev can help design reliable, efficient task systems.

### Do scheduled workflows consume workload units?

Yes. Each scheduled execution consumes WUs based on the actions it performs. Monitor usage in Settings → Metrics.

---

Source: https://www.rapidevelopers.com/bubble-tutorial/setup-workflow-scheduling-periodic-tasks-bubble
© RapidDev — https://www.rapidevelopers.com/bubble-tutorial/setup-workflow-scheduling-periodic-tasks-bubble
