references/bulk-operations.md·Markdown·2 KB·View on GitHub
Use this when work repeats across a collection. Many Box operations still require one request per item; a bounded, resumable loop can be the right design.
Inventory: paginate fully and record item IDs, version, size, actor, and intended action. Prefer markers when supported for large or changing collections; do not retain markers as permanent checkpoints. Check search limits before treating search results as complete inventory.
Plan: look for Box-side operations, supported batch endpoints, ZIP downloads, metadata queries, or event-driven changes that reduce requests. Estimate calls per item and total calls against endpoint rates and monthly allocation. Set an initial, configurable concurrency limit.
Pilot: run a representative, safe subset through the intended path. Measure calls per completed item, throughput, bytes, latency, and visible 429s. Verify any mutations, extrapolate full-job cost and duration, and adjust the plan if measurements exceed it.
Execute and resume: use a bounded queue and limiter shared by workers under the same actor. Let the SDK own its configured retries; slow new work when throttling appears. Persist each item’s status, Box ID/version, destination, and error or request ID. Reconcile uncertain writes before retrying; resume only unfinished items.
Reconcile: compare results with the inventory and Box state. Report succeeded, skipped, and failed items separately, plus throughput and API usage against the plan.