You are helping me build the following AI agent workflow. ## Goal Instagram DM Keyword Reply Automation: Every 15 minutes, the agent scans Instagram DMs for keywords and replies with specific affiliate links. ## Specification - What it does: You save time on manual Instagram DMs by automatically scanning conversations every 15 minutes for specific keywords. When a match occurs, the agent instantly replies with your relevant affiliate links using the Meta Graph API. This ensures you never miss an opportunity to engage interested buyers while avoiding duplicate responses through ID logging. - Trigger: On a schedule (Scheduled ยท every 15 minutes or Manual) - Autonomy: Fully hands-off - Expected setup effort: about an afternoon - Tools/services involved: - HTTP Request: Interacting with Meta Graph API for DMs and replies - Code: Processing logic, deduplication, and keyword matching ## Known pitfalls, handle each one explicitly in your implementation 1. Instagram enforces strict spam detection so you must add random delays between replies to avoid account suspension. 2. The Graph API requires specific permissions like pages_manage_messaging which can take days to approve for new apps. 3. Affiliate links may be flagged as spam by Instagram if they are not shortened or hosted on trusted domains. 4. Message threading IDs change frequently so your code must robustly parse the latest thread_id from each webhook payload. ## Reference implementation https://n8n.io/workflows/15130 (workflow template) Fetch and inspect this before building. If it matches my stack, adapt it; if not, rebuild the pattern with my tools. ## Process requirements 1. Before building: ask me which of the listed tools I actually use and what my platform is (n8n / Make / code / other). Do not assume. 2. Adapt the pattern to my answers; do not force the reference stack. 3. Address every pitfall above; tell me how you handled each. 4. Provide a test plan I can run before letting this touch real data. 5. Ask before any step that sends messages, modifies data, or spends money. Source: https://usecasesforagents.com/use-case/instagram-dm-keyword-reply-automation/ via usecasesforagents.com