Skip to content
BEHIND THE SCENES#comment to DM#Instagram bot#Instagram leads

I Built a SaaS That Turns Instagram Comments into Leads, and the Bug I Found After It Was Already Live

A new system of mine went live and handled eighteen comments on the first day. Five of them, I found out later, never reached anyone. This story is not about the product. It is about the difference between automation that runs and automation that works.

Yaakov Tzedek
Yaakov Tzedek · AI expert·8 min read
An Instagram post comment turning into a public reply, a private message with a link, and a lead saved in the system
THE BOTTOM LINE
  • A system that turns an Instagram comment into a public reply, a DM, and a saved lead. How it was built, why five messages never arrived without anyone noticing, and what that means for every automation running in your business.
DID YOU KNOW?

According to Socialinsider's benchmarks study, which examined 35 million posts across 447,613 active pages between January and December 2025, the average Instagram engagement rate stands at 0.48% and has dropped 24% within a single year. In other words, a comment has become a rare action, and therefore a valuable one.

This week I launched a system that turns every Instagram comment into a lead. On day one, it handled eighteen comments. That is not the interesting part.

The interesting part is that five of those messages never reached anyone, and the system reported everything was fine.

What the system does

Three things, in under a minute. Someone comments a keyword on a post, the system replies publicly under that comment, and sends them a private message with the link. At the same time, they are saved as a lead.

That order is not accidental. The public reply is what makes other people see there is something to get here, and the private message is what delivers the link without sending everyone to the bio.

Why chase comments at all? Because a comment is the most valuable action a user takes, and it is rare. According to Socialinsider's benchmarks study, which analyzed 35 million posts, the average Instagram engagement rate stands at 0.48% and fell 24% in a year.

How it was built, step by step

  1. Official Meta connection. The account owner connects, selects a page and a linked Instagram account, and grants permissions to read comments, reply, and send direct messages. No passwords, no scripts simulating a human.
  2. A scanner that runs every two minutes. Meta does not send comment notifications in development mode, so the system scans on its own and catches every new comment.
  3. Lock before sending. Before anything is sent, the comment is marked as handled. Two scanners running in parallel cannot reply twice to the same person.
  4. A log that records every run. Who commented, on which post, which word triggered it, and what happened with the reply and the message.

Up to this point everything sounds orderly. Then I looked at the log.

The moment I realized something was broken

Of the eighteen runs, every public reply went out. Five direct messages failed.

The error that was logged was a technical sentence about JSON decoding, something that looked like noise. Only when I fixed how the response was read did it become clear that Meta was returning a real server error, and my code crashed while trying to read an empty response body and logged a meaningless message instead.

And that was the small problem. The big one was this: the comment had already been marked as handled before the message was sent. Meaning one momentary Meta failure erased that person from the system forever. Nobody ever followed up with them.

Five people commented, got a public reply, and got nothing in their DMs. From their perspective, the business made a promise and did not keep it.

Three things that were broken, and what I fixed

The error was reported incorrectly. Code that decodes a response without checking what it received hides the real cause. Now it reads the body as text, parses carefully, and reports Meta's actual error code.

A successful-looking response with no message ID was counted as a success. This is the truly dangerous one, because it produces false reporting. Now a send is recorded as successful only when Meta returns a message ID, and the ID is saved as proof.

There was no retry. A pass was added that retries momentary failures within the time window Meta allows. All five failures recovered on their own within a few minutes, and the counter moved to eighteen sent and zero failed.

What this means for your business

This story is not about Instagram. It is about any automation running in the background for you, whether that is a form passing leads, an automated email, or a connection between two systems.

Ask yourself three questions about every automation you have:

  1. What does it log as a success? If it marks success simply because no error occurred, it is measuring nothing. Success is a confirmation from the other side, not the absence of a complaint.
  2. What happens when it fails once? If there is no retry, every momentary outage at the vendor is a customer who gets deleted.
  3. Who is reading the log? An automation with no log that someone actually reads is a promise you have no way of knowing you kept.

This check takes ten minutes and surfaces unpleasant things. For me it surfaced five people.

What came out of it in the end

The system launched in nine languages, with English as the default and full right-to-left Hebrew. It has a connection to ChatGPT and Claude via MCP, so you can ask in plain language for it to read the latest post and build an automation around it.

And the part I like most: a screen that reads the full post history of the account and tells you what to publish next. Not a guess, a count. Which format drives comments, at what hour, on which day, and which post collected comments without having an automation on it.

You can see the system at isocialflow.com. It is in closed beta right now. And anyone who wants an AI agent to manage it for them, the full guide is here: Grok bot as an agent that recruits leads from Instagram with SocialFlow.

The bottom line

Anyone can launch an automation. The difference between an automation that runs and an automation that works is not in the code, it is in whether anyone bothered to verify that what it reports actually happened.

I found that out after five people. Better to find it out before.


Yaakov Tzedek, AI lecturer, consultant and implementer in organizations, and leader of the largest Claude Code community in Israel.

Frequently asked questions

Was this article helpful?
Share:WhatsAppLinkedInX
Yaakov Tzedek
WRITTEN BY

Yaakov Tzedek

An Israeli AI lecturer, consultant and implementer who has supported 100+ organizations in AI implementation and lectured for 200+. Official content partner of Meta, Google, Canva and TikTok, featured on Israel's Channel 13.

More about Yaakov →