DEV Community

Cover image for Why most Instagram DM automation tools get accounts banned (and the timing model we built instead)
Youssef Bezza
Youssef Bezza

Posted on Edited on

Why most Instagram DM automation tools get accounts banned (and the timing model we built instead)

I've been building FollowToDM, a tool that auto-DMs new Instagram followers, and the single biggest lesson from running it in production has nothing to do with message copy or targeting. It's timing.

Almost every DM automation tool, ours included, in an earlier version, follows the same pattern: detect a trigger, queue a message, send it after some delay. The problem is that "some delay" is almost always a single fixed number. Wait 2 minutes, send. Wait 2 minutes, send. That's not a delay, it's a metronome, and a metronome is trivially easy to fingerprint. No real person replies to things on a perfectly even interval.

The naive version

Here's roughly what the first version looked like:

async function dispatch(job) {
  await sleep(FIXED_DELAY_MS);
  await sendDm(job);
}
Enter fullscreen mode Exit fullscreen mode

Works fine in a demo. Falls apart in production the moment you have more than one follower to message, because every send after the first is spaced identically. Over a few hundred messages, that interval shows up as a flat line if you plot time-between-sends. That's the pattern that gets flagged, not the automation itself, the regularity of it.

Layer one: delays that stack instead of repeat

The fix we run now: when a new follower is detected, the message gets a randomized delay somewhere in a 5–15 minute window and critically, that delay stacks on top of whatever's already queued for that same account, instead of resetting to a flat interval each time.

async function enqueueDispatch(integrationId, targetUserId) {
  const delayMs = randomBetween(5 * 60_000, 15 * 60_000);
  await dispatchQueue.add('dispatch-dm', { integrationId, targetUserId }, { delay: delayMs });
}
Enter fullscreen mode Exit fullscreen mode

If three people follow the same account in a ten-minute window, they don't all fire in a burst, each one lands with its own randomized offset from the one before it. Plotted over time, it looks like a person checking notifications on their own schedule, not a queue draining.

Layer two: the check that catches everything the first layer can't

Randomizing at queue-time solves the common case, but not the failure case: what happens when the worker goes offline for a few hours (deploy, crash, restart)? Every queued job becomes overdue the instant the worker comes back, and without a second check they'd all fire back-to-back, which is a far worse signal than a fixed delay ever was.

So there's a second, independent check that runs right before anything actually sends, not at queue time, at send time:

async function process(job) {
  const lastSent = await getLastSentTime(job.integrationId);
  const requiredGapMs = randomBetween(5 * 60_000, 15 * 60_000);

  if (lastSent && Date.now() - lastSent < requiredGapMs) {
    const remaining = requiredGapMs - (Date.now() - lastSent);
    await dispatchQueue.add('dispatch-dm', job.data, { delay: remaining });
    return;
  }

  await sendDm(job.data);
}
Enter fullscreen mode Exit fullscreen mode

This is the part that actually controls pacing once a backlog exists. It doesn't care when the job was originally queued, only when that specific account last actually sent something for real. A fresh random gap gets recalculated on every check, so even a fully backlogged queue drains at an irregular pace instead of settling into "one every N minutes."

Why you need both, not just one

  • Queue-time randomization alone breaks down the moment a backlog forms (offline worker, crash, restart).
  • A send-time floor alone works, but without queue-time randomization every message clusters right at the boundary of the minimum gap — which is its own detectable pattern.
  • Together, a message's timing depends on two clocks that have nothing to do with each other: when it was queued, and when that account last actually sent something. That combination is much closer to how a person behaves than either check alone.

What we deliberately didn't build

No fake read receipts, no device fingerprint spoofing, no attempt to reverse-engineer Instagram's actual detection thresholds. Those are arms races you lose the moment the platform changes something server-side and they're the kind of shortcut that gets an account banned overnight the day it stops working silently. Randomized, stacking delays and a real last-sent check aren't clever evasion, they're just what sending messages on human timing actually requires.


If you're building anything that sends automated messages on someone's behalf, email, DMs, notifications, I'd genuinely be curious how you're handling pacing. Happy to compare notes in the comments.

(We build this stuff at FollowToDM if you want to see it running.)

Top comments (0)