# How to batch API requests for efficiency in Bubble.io: Step-by-Step Guide

- Tool: Bubble
- Difficulty: Intermediate
- Time required: 20-25 min
- Compatibility: All Bubble plans (Growth plan+ for Schedule on a List)
- Last updated: March 2026

## TL;DR

Batching API requests in Bubble reduces the total number of external API calls by combining multiple operations into single requests or processing them sequentially with Schedule on a List. This tutorial covers grouping related data into single API calls, using backend workflows to process lists sequentially, implementing retry logic for partial failures, and monitoring batch job progress to ensure all records are processed reliably.

## Overview: Batching API Requests for Efficiency in Bubble

This tutorial shows you how to batch API requests in Bubble to reduce call count, stay within rate limits, and process large data sets efficiently using backend workflows.

## Before you start

- A Bubble app making multiple external API calls
- Backend workflows enabled (Growth plan+ for Schedule on a List)
- Understanding of Bubble backend workflows and API Connector
- Familiarity with the external API's batch endpoints (if available)

## Step-by-step guide

### 1. Identify batch opportunities in your API calls

Review your workflows for patterns where multiple API calls are made for related data. Common examples: sending notifications to multiple users, updating multiple records in an external system, or fetching data for multiple IDs. Check if the external API supports batch endpoints (e.g., POST /batch or arrays in request bodies). If it does, you can send multiple operations in a single HTTP request. If not, you will need to process items sequentially using Schedule on a List.

**Expected result:** You have identified which API calls can be batched and whether the external API supports batch endpoints.

### 2. Use batch API endpoints when available

If the external API supports batch operations, create an API Connector call that sends an array of items in the request body. Build the array in your Bubble workflow by constructing a JSON text string containing all items. For example, to send emails to 50 users, build a JSON array of recipient objects and send it as a single API call instead of 50 individual calls. Parse the batch response to identify which items succeeded and which failed.

```
{
  "batch": [
    {"method": "POST", "url": "/users/123/notify", "body": {"message": "Hello"}},
    {"method": "POST", "url": "/users/456/notify", "body": {"message": "Hello"}},
    {"method": "POST", "url": "/users/789/notify", "body": {"message": "Hello"}}
  ]
}
```

**Expected result:** Multiple operations are sent in a single API call using the batch endpoint.

### 3. Process lists sequentially with Schedule on a List

When the API does not support batch endpoints, use Bubble's Schedule API Workflow on a List action. Create a backend workflow that processes a single item (e.g., sends one notification). In your trigger workflow, use 'Schedule API Workflow on a List' passing the list of items. Bubble automatically processes each item sequentially, calling the backend workflow once per item. Add a delay between items if needed to respect rate limits. This pattern handles any list size reliably.

> Pro tip: For large lists, RapidDev can help optimize batch processing with parallel execution, intelligent retry logic, and progress tracking dashboards.

**Expected result:** Large lists of items are processed one by one through backend workflows without overwhelming the API.

### 4. Handle partial failures and implement retry logic

In batch operations, some items may succeed while others fail. Track the status of each item: add a processing_status field (Pending/Success/Failed) to your records. After each API call, update the status based on the response. For failed items, create a retry workflow that searches for records with status = Failed and reprocesses them. Add a maximum retry count to prevent infinite retry loops. Log failure reasons for debugging.

**Expected result:** Failed items are tracked and retried automatically, with logging for debugging.

## Complete code example

File: `Workflow summary`

```text
BATCH API PROCESSING PATTERNS
===============================

PATTERN 1: BATCH ENDPOINT (if API supports it)
  Build JSON array of operations
  Single POST to /batch endpoint
  Parse response for per-item results
  Mark items as Success or Failed

PATTERN 2: SCHEDULE ON A LIST (universal)
  Backend workflow: process_single_item
    - Call API for one item
    - Update item status (Success/Failed)
    - Log any errors

  Trigger workflow:
    - Schedule API Workflow on a List
    - List: items to process
    - Delay: rate_limit / items_per_second

RETRY LOGIC:
  Scheduled (every 30 min):
    Search items where status = Failed AND retry_count < 3
    Schedule on a List → process_single_item
    Increment retry_count

PROGRESS TRACKING:
  BatchJob Data Type:
    total_items, processed_count, success_count, failure_count
    status (Running/Completed/CompletedWithErrors)
  Update counts after each item processed
  Display on admin dashboard
```

## Common mistakes

- **Making individual API calls in a frontend workflow loop** — Frontend loops block the UI and stop if the user navigates away, leaving items partially processed Fix: Use Schedule API Workflow on a List in a backend workflow for reliable batch processing
- **Not respecting API rate limits in batch processing** — Processing items too fast triggers rate limit errors (429), causing failures and potential temporary blocks Fix: Add appropriate delays between items using the delay parameter in Schedule on a List
- **Not tracking which items have been processed** — Without status tracking, you cannot identify failed items for retry or verify that all items were processed Fix: Add a processing_status field to each record and update it after each API call

## Best practices

- Use batch API endpoints when the external API supports them
- Use Schedule on a List for sequential processing of large lists
- Track processing status on each record for monitoring and retry
- Add retry logic with a maximum retry count to handle temporary failures
- Respect API rate limits with appropriate delays between calls
- Monitor batch job progress on an admin dashboard

## Frequently asked questions

### What is the maximum list size for Schedule on a List?

There is no hard limit, but very large lists (10,000+) may take significant time. For massive batches, chunk the list into groups of 1,000 and schedule each chunk separately.

### Can I process items in parallel instead of sequentially?

Bubble's Schedule on a List processes items sequentially. For parallel processing, split your list into chunks and schedule separate backend workflows for each chunk simultaneously.

### How do I know when a batch job is complete?

Track total items and processed count on a BatchJob record. When processed_count equals total_items, the job is complete. Check this with a scheduled workflow or Do when condition is true.

### What delay should I use between API calls?

Check the external API's rate limit documentation. If the limit is 100 requests per minute, set a delay of at least 600 milliseconds between calls. Add buffer for safety.

### Can RapidDev help optimize batch API processing in Bubble?

Yes. RapidDev can implement efficient batch processing systems with parallel execution, retry logic, progress tracking, and rate limit management for your Bubble app.

---

Source: https://www.rapidevelopers.com/bubble-tutorial/batch-api-requests-efficiency-bubble
© RapidDev — https://www.rapidevelopers.com/bubble-tutorial/batch-api-requests-efficiency-bubble
