What is Tail Worker?
A Cloudflare Workers feature that watches your main Worker from the outside.
In plain English
A Tail Worker is a special type of Cloudflare Worker that runs AFTER your main Worker finishes — whether it succeeded or crashed. It receives the execution outcome: the response, any exceptions, CPU time, memory usage, and request details. Think of it like a security camera that watches your app from outside — it records what happened even if your app's internal logging fails. Regular logging SDKs (Sentry, console.log) run INSIDE your Worker — if the Worker crashes before they fire, they capture nothing. Tail Workers run OUTSIDE — they always capture the outcome. FlareLog's Tail Worker template ships this data to your dashboard.
Why it matters
This is the only way to capture crashes that happen before your code runs. If your Worker hits a CPU timeout, runs out of memory, or fails during startup, your internal SDK never fires. The Tail Worker sees it anyway. For vibe-coded apps where you didn't write (or fully understand) the code, this is critical — you can't add error handling to code you don't understand, but the Tail Worker catches errors regardless.
How FlareLog handles it
FlareLog provides an open-source Tail Worker template (github.com/flarelog-dev/tail-worker) that you clone, configure, and deploy in 5 minutes. It captures execution outcomes, estimates Cloudflare costs, and ships everything to your FlareLog dashboard. It also sends Slack/Discord alerts when cost burn or error rates spike.
FAQ
Does the Tail Worker slow down my app?
No. Tail Workers run asynchronously, after your response is sent to the user. They have zero impact on your app's latency. Cloudflare doesn't even charge for Tail Worker invocations on most plans.
Do I need to change my app's code to use a Tail Worker?
No. The Tail Worker is a separate Worker that you deploy alongside your app. It watches from the outside. Your app keeps running as-is. You just need to add your app's Worker name to the Tail Worker's wrangler.toml so Cloudflare knows which Worker to watch.