Cloudflare Worker template

Instagram Campaign Worker

A self-hosted TypeScript/Cloudflare Worker template for Meta API Instagram comment campaigns, automated message steps, and an admin UI.

Overview

Comment event to admin flow

This worker lets a creator configure a specific Instagram post and trigger word. When someone comments that word, it records the event, runs the next message step, and keeps the campaign visible in the admin UI.

Scope
Meta API-based comment campaign worker
Stack
TypeScript, Cloudflare Workers, D1, Queues, Meta API
Flow
Watched post, trigger word, webhook/poller intake, database storage, message step, and admin UI
Outcome
Public Cloudflare Worker example for an Instagram campaign admin tool, with tests and deployment notes
API model
Built around Meta API webhook and response steps
Status
Public MIT repo with docs, tests, and deployment notes

Backend

How it works

I built the backend around campaign rules, webhook intake, database storage, queued delivery, and admin actions for draft, activate, pause, and edit states.

Architecture
Meta webhook, signature verification, database storage, queued delivery, Meta API message step, and admin action log
Safeguards
Signature verification, duplicate event checks, queue retry behavior, admin pause/edit controls, and tests around the campaign flow
Inspect
Webhook handling, trigger matching, storage code, campaign editor, preview UI, test suite, and deployment docs

Campaign flow

What the user sees

The UI keeps the practical setup visible: watched post, trigger word, message copy, setup checklist, comment preview, and message preview.

Admin UI
Campaign list, post picker, trigger field, message editor, readiness checklist, comment preview, and message preview

Demo

Flow and UI

Instagram Campaign Worker diagram from comment trigger to webhook intake, storage, delivery, Meta API message step, and admin UI
Flow: comment trigger, webhook intake, storage, delivery, Meta API message step, and admin UI.
Instagram Campaign Worker admin UI demo showing campaign list, campaign editor, checklist, comment preview, and message preview
UI demo: campaign list, post/trigger editor, setup checklist, comment preview, and message preview.