SfSkills Domains Docs GitHub

Home / flow / flow-batch-processing-alternatives

flow-batch-processing-alternatives

Use when a Scheduled Flow or Record-Triggered Flow needs to process more records than Flow can safely handle in a single run. Covers Flow limit realities, scheduled-path chunking, Data Cloud batch transforms, and Apex. NOT for choosing async across a general workflow (see async-selection decision tree) — use flow/flow-large-data-volume-patterns.

Open the skill folder on GitHub


Flow Batch Processing Alternatives

Purpose

Flow can process a lot of records — until it can't. Admin teams often build a Scheduled Flow expecting it to handle "whatever comes," then hit a CPU or DML limit silently, with no retry. This skill lays out the real limits, chunking patterns that extend Flow's reach, and the clean escalation path to Apex Queueable or Batch when the workload outgrows Flow.

  1. Compute the real cost: per-interview cost × batch size. Count the Get

    Records and DML elements on the path a single interview takes, multiply by the batch size (200 unless you changed it), and compare that to the per-transaction limits. This number, not the record count, is what fails.

  2. Hoist first, size second. If the per-interview cost is a query or a DML

    that could live outside the per-record path, fix that — it is free. flow/flow-bulkification owns the technique.

  3. Lower the batch size only for irreducible per-interview work. Set it on

    the Start element, 1–200, on runtime version 63.0 or later. It buys governor headroom at a proportional cost in throughput. The lever only moves down; 200 is already the default and the maximum.

  4. Check the org-wide daily ceiling. Schedule-triggered flow interviews are

    capped at 250,000 per 24 hours, or user licenses × 200, whichever is greater — shared across every scheduled flow in the org.

  5. Add per-chunk observability before you add scale. A log row per chunk

    (id, count, outcome, timestamp), an alert on rate change, and an off switch that does not require deactivating the flow.

  6. Escalate to Apex for a capability, never for a record count. See the

    table below, and cite the branch of standards/decision-trees/async-selection.md that resolved the choice.

Real Flow Limits That Bite

Chunking Patterns Inside Flow

When To Move To Apex

Escalate for a capability Flow does not have, not for a record count.

ReasonWhat Flow cannot do
Retry with a known outcomeFlow has no finalizer. System.Finalizer sees SUCCESS or UNHANDLED_EXCEPTION and can re-enqueue a failed Queueable up to five times
Per-record calloutsCallouts cannot follow DML in the same transaction; Flow's sequencing options are narrower
State across transactionsDatabase.Stateful retains instance member variables between transactions (statics still reset)
Multi-million-record scansDatabase.QueryLocator streams; a Flow Get Records is bounded by 50,000 rows per transaction
Chained steps surviving partial failureQueueable chaining plus a finalizer gives explicit control

What escalation does not buy: headroom against the daily ceiling. Batch Apex method executions are capped at 250,000 per 24 hours or user licenses × 200 — the same number and formula as flow interviews. It also does not buy unbounded concurrency: 5 batch jobs queued or active, with up to 100 more Holding in the flex queue, org-wide and shared with managed packages.

If the daily ceiling is the binding constraint, the fix is to process fewer records — tighter filters, incremental rather than full scans — not a different engine.

Target Apex Patterns

Link the Apex implementation back to Flow through an Invocable Action so admins keep an orchestration view they can read and disable.

Monitoring Plan

Anti-Patterns (see references/llm-anti-patterns.md)

Official Sources Used

The full annotated list is in references/well-architected.md.

Package files