An automation that can update hundreds of records needs a way to show intended effects without performing them. Dry runs help identify unexpected matches and incorrect transformations.
Implementation approach
Separate planning from execution. The planning step should read current state, validate proposed changes and report differences; only the execution step should mutate records.
Example
const plan = await buildPlan(input);
if (dryRun) return plan;
await applyValidatedPlan(plan);
Validation and edge cases
Ensure dry-run paths do not send emails, trigger webhooks or write business data. Revalidate preconditions before execution because underlying records may change after the preview.
Key takeaway
Use explicit approval and limited batches for high-impact updates, with a recovery plan when reversal is possible.




