Workflows/Reel 12

TUTORIAL · COMMENT A WORD, GET THE LINK IN DMS · $0 / MONTH

Your Own Free DM Robot

The ManyChat trick, built by you, for free: someone comments a word under your post and your own robot sends them the link in DMs. No coding: Claude or ChatGPT writes it all.

REC00:00:00:00REEL 12
Stack
Claude or ChatGPT, a free Meta app, Cloudflare Workers (free plan)
Workflow
7 steps · 4 prompts
Models
Claude or ChatGPT
Keyword
Comment BOT under the reel ↗
Price
Free
FIGThe robot that sent you this guide is the one in the reel: a free Meta app plugged into Instagram, and a tiny program on Cloudflare's free plan.

How it works, in one sentence

Someone comments BIKE under your post → Instagram tells your robot → the robot answers under the comment and sends a DM with a Send me the link button → they tap it → the robot sends the link. That's exactly what ManyChat sells you every month.

What you need

An Instagram professional account (Creator or Business: Settings → Account type, it's free) · a free Meta for Developers account (developers.facebook.com, log in with Facebook) · a free Cloudflare account (cloudflare.com, the Workers free plan: 100,000 requests a day) · Claude or ChatGPT (the free versions work, a paid one is faster) · a computer, about one evening. You never pay anything.

07 stepsThe workflow

  1. 01

    Turn your Instagram into a pro account

    Settings → Account type and tools → Switch to professional account → Creator. Free, and you keep everything. The robot only works on professional accounts.

  2. 02

    Create the Meta app

    On developers.facebook.com: My Apps → Create app, use case “Manage messaging & content on Instagram”. In the app, open API setup with Instagram login, add your Instagram account and generate an access token. Copy the token and the Instagram app secret into a private note: they are your keys, never share them or put them on screen.

  3. 03

    Let Claude or ChatGPT write the robot

    Paste prompt 1 with your own words and links. It gives you every file and every step. Paste prompt 2 next to it if you're lost: it becomes your coach, one step at a time, and waits for you to say “done”.

  4. 04

    Put the robot on Cloudflare (free)

    Follow what the AI tells you: install Node, run npx wrangler login, create the small database, add your 3 secrets with wrangler secret put (never inside the code), then deploy. You get an address like your-robot.your-name.workers.dev: that's your robot, online 24/7.

  5. 05

    Plug the robot into Instagram

    Back in your Meta app, Webhooks: paste your robot's address as the callback URL, type the same verify token you gave the robot, then subscribe to comments, messages and messaging_postbacks. Meta says no App Review is needed when the app only works for an account you own.

  6. 06

    Test with a second account

    Comment your word from another account (a friend's, or a second one). You should see the public reply, then the DM. If that account doesn't follow you, the DM lands in Message requests: that's normal. Nothing happens? Use prompt 4 with the error from Cloudflare.

  7. 07

    One word per reel

    New reel = a new word and a new link. Prompt 3 adds it in one minute. Write the word in your caption and say it in the reel: “Comment BOT…”.

!Avoid this

Two DM tools at once: remove ManyChat (or any other) first, in Instagram → Settings → Apps and websites. Conversations it already handled stay locked to it for about 24 h. Secrets in the code or in a screenshot: anyone could post as you. A private Google Drive link: people land on “Request access”, share it as “Anyone with the link”. Sending links without the button: Instagram only lets a robot send its first DM as a reply to the comment, the button is what opens the conversation.

Good to know

Instagram allows one private reply per comment, within 7 days. After someone taps the button, you have 24 h to send them messages. Your Instagram token lasts 60 days: the robot renews it by itself (that's in prompt 1). Free plan limits are far above what a creator needs: Kloe's robot sent 198 links in its first 18 days and used a tiny part of it.

READY TO COPY · CLAUDE OR CHATGPT

The prompts

Paste them in a new chat, in this order. Replace the words in [BRACKETS] with your own.

01

Build the robot

Claude or ChatGPTthe whole project
Inputsyour words + links
You are a senior developer and a patient teacher. I am not a coder. Build me my own free Instagram comment-to-DM robot (like ManyChat) that runs on a Cloudflare Worker (free plan) with a Cloudflare D1 database, using the Instagram API with Instagram Login (graph.instagram.com) and a Meta app I already created.

What the robot must do:
1. When someone comments one of my keywords under one of my posts, reply publicly under the comment with: "[PUBLIC REPLY, e.g. Sent! Check your DMs]", and send the commenter a private reply (DM) with: "[FIRST DM, e.g. Hey there! Here's what you asked for]" and one button "Send me the link".
2. When they tap the button, send the link for that keyword as a card (title, image, button that opens the link). If Instagram refuses the card, send the link as plain text.
3. Keywords are not case sensitive and match whole words only ("bot", "BOT" and "Bot!" all work). My keywords: [WORD 1] → [LINK 1], [WORD 2] → [LINK 2].
4. Never answer the same comment twice, and never send the same link twice to the same person for the same word: save everything in D1.
5. Ignore my own comments and every other DM.
6. Verify the webhook (hub.mode, hub.verify_token, hub.challenge) and check every incoming POST with the X-Hub-Signature-256 header and my Instagram app secret.
7. Run a cron every 5 minutes that retries failed sends and renews my long-lived Instagram token before it expires (it lasts 60 days), saving the new token in D1.
8. Keep every secret (app secret, access token, verify token) in Wrangler secrets, never in the code.

What I need from you:
- The complete code, file by file (wrangler.toml, package.json, schema.sql, src/index.js), with nothing left as TODO, and short comments in plain English.
- Then the exact steps for someone who has never opened a terminal, on [Windows / Mac]: install Node, log in to Cloudflare, create the D1 database, add the secrets, deploy, paste the webhook URL in my Meta app, subscribe to the comments, messages and messaging_postbacks fields, and test with a second account.
- Ask me what you need before you start. Then go one step at a time and wait until I say "done".
2149 chars376 words7 to replace
02

Your coach

Claude or ChatGPTsame chat, when you're lost
I'm stuck at this step: [WHAT YOU'RE TRYING TO DO, e.g. paste the webhook in my Meta app]. Here is a screenshot of my screen. Tell me exactly where to click and what to type, like you're sitting next to me. One action at a time, and wait for me to say "done". If my screenshot shows a token, a secret or a password, tell me to hide it and never repeat it.
355 chars73 words1 to replace
03

Add a word for a new reel

Claude or ChatGPTsame chat
Add a new keyword to my robot: [NEW WORD] → [NEW LINK], card title "[TITLE, e.g. Your free guide]", card image [IMAGE LINK, or ask me for one]. Give me only what changes (the command or the lines of code) and the command to run to put it online. Then tell me how to test it with my second account.
297 chars60 words4 to replace
04

Fix a problem

Claude or ChatGPTsame chat
Inputsthe error
My robot doesn't work as expected. What I did: [e.g. I commented BOT from my second account]. What I expected: [e.g. a public reply and a DM]. What happened: [e.g. nothing / only the public reply]. Here is what Cloudflare shows (Workers → my robot → Logs, or npx wrangler tail): [PASTE THE ERROR, WITHOUT ANY TOKEN]. Find the cause, explain it in one sentence, then give me the exact fix and how to check it worked.
415 chars77 words4 to replace

Why it's free

ManyChat is a robot you rent. Here, the Meta app is free, Cloudflare's free plan runs the robot and its little database, and the AI wrote the code. You own it: no monthly bill, no contact limit, and you can change anything by asking Claude or ChatGPT.

@LEARNWITHKLOE · TUTORIAL · Claude or ChatGPT, a free Meta app, Cloudflare Workers (free plan)