Short answer: Backfill existing posts and comments with a resumable batch job, not a loop that sends one LLM classification request at a time; persist the source identity, poll job state, then export or fetch results before applying moderation flags in an idempotent database update.
The model call is the easy part. The hard part is proving that every eligible row was classified once, that every result belongs to the exact source revision you intended to inspect, and that a restart cannot silently skip or duplicate work. I design storage layers, so I start with those invariants rather than throughput claims.
This matters for marketplace listings, forum imports, and policy re-checks after rules change. A Node.js worker can implement the same state machine, but the example below is Python because I want the retry and persistence boundaries to remain visible instead of hiding them behind a client library.
How should a bulk job moderate existing posts and comments with LLM classification?
Start by freezing a manifest. Each manifest row should identify the source record and the revision being moderated; it should also carry a stable client-side item identity that survives retries. The exact representation belongs to your database, but the invariant does not: if comment 847 was edited after the snapshot, a result for the old text must not overwrite moderation state for the new text.








