Posthook + Next.js + AI
Schedule Delayed Tasks in Next.js Without Cron, Queues, or Workflow Engines
Posthook gives your Next.js app durable per-event timers. Schedule a reminder, expiration, or follow-up with one API call — your route handler runs when the time comes.
Webhook handlers
app/api/webhooks/remind/route.ts
One route per hook type. Each handler verifies the HMAC signature, checks task state, and acts or no-ops.
Task state machine
lib/tasks.ts
Schedule-first ordering, conditional updates, and epoch-based snooze.
Scheduling patterns
PATTERNS.md
Seven copy-pasteable patterns including per-event timers, state verification, epoch snooze, conditional updates, and idempotency keys.
Posthook SDK setup
lib/posthook.ts
Lazy singleton for Next.js build safety. Works with any Postgres instance and any deployment platform.
Scheduling template
A simpler reminder-only starter you can deploy with one click.
AI review app
The full source for this app. Deploy your own with one click.
Built with Next.js, Postgres, Drizzle ORM, OpenAI, and Posthook. No cron to maintain. No workflow engine to learn.