All Docs
FeaturesagentOS Direct DebitUpdated March 13, 2026

BACS Collection Scheduler & Submission Job

BACS Collection Scheduler & Submission Job

Overview

The BACS Collection Scheduler is the automated engine that drives Direct Debit collections through the BACS payment cycle. Running as a daily background job on every BACS working day, it identifies mandates due for collection, creates collection records, and submits payment requests to Modulr — all without manual intervention.


How It Works

1. Daily Cron Trigger

The scheduler is implemented as an Inngest cron job that fires once per day, but only on valid BACS working days (i.e. Monday–Friday, excluding UK bank holidays). This ensures that no collection attempts are made on non-processing days.

2. Mandate Query

On each run, the job queries the database for all mandates that meet the following criteria:

  • Status is active
  • Collection date falls within the next 3 working days

The 3-working-day lookahead window is aligned with the BACS submission cycle, which requires collections to be submitted in advance of the intended settlement date.

3. Collection Record Creation

For each qualifying mandate, the scheduler creates a new collection record in the database. This record is initially set to a status of scheduled and acts as the authoritative audit trail for the collection attempt.

4. BACS Submission to Modulr

The scheduler submits a BACS collection request to Modulr for each mandate. Modulr handles the downstream BACS submission and interfaces with the tenant's bank to debit the agreed amount.


Webhook Handling

Modulr processes BACS collections asynchronously. The service listens for two webhook events from Modulr to track the outcome of each submission:

Settlement Confirmation

When Modulr confirms that funds have successfully settled from the tenant's account, the service:

  • Transitions the collection record from scheduledcollected
  • Makes funds available for the downstream sweep-to-holding flow

Failure / Return

When Modulr reports that a collection has failed or been returned (e.g. insufficient funds, cancelled mandate, bank rejection), the service:

  • Transitions the collection record from scheduledfailed
  • Triggers clawback logic to protect the holding account reserve

Collection Status Reference

StatusTriggered ByDescription
scheduledCron jobCollection record created and BACS request submitted to Modulr
collectedModulr settlement webhookFunds successfully debited from the tenant's account
failedModulr failure/return webhookCollection failed; clawback logic initiated

Key Design Notes

  • BACS working days only — the cron job is aware of UK bank holidays and will not run on non-processing days.
  • 3-working-day window — mandates are picked up in advance of their collection date to comply with BACS submission lead times.
  • Async by design — collection outcomes are not known immediately; they are resolved via Modulr webhooks, keeping the submission flow non-blocking.
  • Idempotency — each mandate/collection date combination should only produce one collection record, preventing duplicate submissions on re-runs.
  • Clawback integration — failed collections automatically feed into the clawback reserve logic to ensure the holding account remains adequately protected.

Related