Library / Social Media Publishing
Social Media Publishing
Reply to Instagram comments and send DMs with Facebook Graph API and Gemini
Triggers on Meta comment webhooks, drafts AI replies after a randomized delay, posts them via the Graph API, and sends a personal DM with details when buying intent is detected.
What it does
## 📸 Instagram Comment & DM Automation Replies to Instagram comments with AI — and when buying intent is detected, it automatically sends the user a personal DM with prices and details. ### How it works 1. A Meta webhook receives comment events 2. Your own comments are filtered out (loop protection) 3. The post caption is fetched as product context 4. AI Agent 1 writes the public reply (or no_answer) 5. A random 3–6 min delay makes replies look human 6. The reply is posted via the Graph API and logged to Slack 7. If the reply contains the keyword DM, AI Agent 2 writes and sends a private DM 8. Story mentions trigger a Slack alert ### ⚙️ Setup checklist - Webhook: set your own path and register the URL in your Meta App (Webhooks → Instagram) - Code node: set VERIFY_TOKEN (must match the token in the Meta App) - If node: enter your own Instagram username (loop protection) - AI Agents: fill in all [PLACEHOLDERS] (brand, tone, products, prices, links) - Graph API3: enter your Facebook Page ID - Credentials: connect Facebook Graph API, Google Gemini, Slack, Google Sheets - Slack: create/adjust the channels #ai-kommentare and #mentions - Google Sheets (optional): heartbeat sheet with columns Id and Letzter_Run
The steps
- Webhook
- AI Agent
- Google Gemini Chat Model
- Simple Memory
- Facebook Graph API
- If1
- If
- Send a message
- Wait
- If2
- If3
- Story Mention
- Facebook Graph API2
- Update row in sheet
23 steps in total.
Similar automations
Social Media PublishingReply to Instagram Comments with Direct Messages12 stepsSocial Media PublishingGet Comments from a Facebook Page10 stepsEmail AutomationReply to WhatsApp and Instagram booking DMs using OpenAI and Google Sheets25 stepsSocial Media PublishingPublish All Instagram Content Types via the Facebook Graph API22 steps