How mrwhitehat-coder/instagram-dm-automation-free works
AutoDM is a self-hosted Instagram comment-to-DM automation running on a Cloudflare Worker. A commenter triggers a verified webhook; the worker dispatches events to automation logic, which matches rules, sends private/public replies, handles button taps and optional follow checks, then delivers the configured link. The dashboard configures automations and presents activity, analytics, setup, and approval guidance. D1 stores rules, settings, pending conversations, and activity. Edges reflect shown calls or README-documented behavior; dashboard/API wiring and some routing details are not fully visible in the excerpts, so those links are marked unverified.
Main entry points: api.ts Admin API · index.ts Worker entry · flow.ts Webhook automation · instagram.ts Instagram client
Components 15
Dashboard and setup
- Dashboard
public/app.js - Privacy policy
src/privacy.ts
Worker and API
- Worker entry
src/index.ts - Admin API
src/api.ts
Automation workflow
- Webhook automation
src/flow.ts - Rule matching
src/rules.ts
Security and integrations
- Dashboard auth
src/auth.ts - Instagram client
src/instagram.ts - Token lifecycle
src/token.ts - Signature checks
src/signature.ts
Persistence
- Data access
src/store.ts - Cloudflare D1
Other components
- Account owner
- Meta Instagram API
- Instagram commenter
Connections 21
- Account owner → Dashboard: configures
README.md - Dashboard → Admin API: uses API
- Worker entry → Admin API: routes requests
src/index.ts - Worker entry → Signature checks: verifies webhook
src/index.ts - Worker entry → Webhook automation: dispatches events
src/index.ts - Instagram commenter → Meta Instagram API: comments or taps
README.md - Meta Instagram API → Worker entry: delivers webhook
README.md - Webhook automation → Rule matching: matches rules
src/flow.ts - Webhook automation → Instagram client: sends messages
src/flow.ts - Webhook automation → Data access: reads and writes
src/flow.ts - Admin API → Dashboard auth: checks sessions
src/api.ts - Admin API → Rule matching: validates rules
src/api.ts - Admin API → Data access: reads and writes
src/api.ts - Admin API → Token lifecycle: gets or refreshes
src/api.ts - Admin API → Instagram client: creates client
src/api.ts - Dashboard auth → Signature checks: uses HMAC
src/auth.ts - Token lifecycle → Instagram client: refreshes token
src/token.ts - Token lifecycle → Data access: persists token
src/token.ts - Data access → Cloudflare D1: queries
src/store.ts - Instagram client → Meta Instagram API: calls API
README.md - Worker entry → Privacy policy: serves policy
src/index.ts