To get email alerts when an AI agent finishes, deploy a Cloudflare Worker with a send_email binding, verify your team’s inbox as a destination address, and POST to the Worker whenever the agent’s task changes status. On the Workers Free plan, sends to verified destination addresses cost nothing and don’t count toward any quota or daily limit.
A coding agent that finishes at 2 a.m. doesn’t wake anyone up. Its pull request sits until somebody opens the right tab, and the next task waits behind it. This guide wires a finish signal from your task board to your team’s inbox with about 30 lines of JavaScript. If your agents already run as tasks on Sharkly, the status change that marks the work done can send the email for you.
Why agent runs need an email alert
An agent run ends in one of three states: done and waiting for review, blocked on a question, or failed. All three need a person, and none of them announces itself outside the tool that ran the agent.
The usual fixes don’t reach far. A terminal bell only works if you’re at that terminal. A chat ping lands in a channel that scrolls past by morning. Email still reaches the people who don’t live in your agent tooling: the release manager, the on-call engineer, the founder who reads a digest at 8 a.m.
The constraint was always cost and setup. Transactional email meant a third-party API key, a sending domain, and a monthly plan for a few dozen messages a day. That changed on November 24, 2026.
What changed on the Workers Free plan
Cloudflare’s changelog for November 24, 2026 made Email Sending available on Workers Free. You can send from a Worker binding, the REST API, or SMTP. The catch is the recipient list.

| Workers Free | Workers Paid | |
|---|---|---|
| Recipients | Verified destination addresses in your account only | Any recipient, with an onboarded sending domain |
| Included volume | Verified sends are free | 3,000 emails per month, then $0.35 per 1,000 |
| Verified sends count toward quota | No | No |
| Verified sends count toward daily limit | No | No |
Those figures come from the Email Service pricing page and the limits page, read on November 26, 2026. “Verified recipients only” sounds like a restriction, and for a newsletter it is. For agent alerts it’s the exact shape you want: the recipients are your own team, and you control every address.
Build the alert Worker
You need a Cloudflare account, a domain on Cloudflare, and Wrangler, the Workers command-line tool. Five steps get you to a working endpoint.
- Verify the destination address. In the dashboard, open Compute, then Email Service, then Email Routing, then Destination Addresses. Add your team inbox and click the link in the verification email. Addresses are shared across your account, so a list alias such as
eng-alerts@covers everyone on it. - Onboard a sending domain. Under Email Sending, select Onboard Domain and pick a domain from your account. Cloudflare adds MX, SPF, and DKIM records on a
cf-bouncesubdomain, plus a DMARC record if you don’t have one. The domains guide lists each record. - Add the binding to
wrangler.jsonc:
{
"name": "agent-alerts",
"main": "src/index.js",
"compatibility_date": "2026-11-24",
"send_email": [{ "name": "EMAIL" }],
"vars": { "ALERT_TO": "[email protected]" }
}
- Write the Worker. It accepts a JSON POST, checks a shared token, and sends one plain-text email:
// src/index.js
export default {
async fetch(request, env) {
if (request.method !== "POST") {
return new Response("Method not allowed", { status: 405 });
}
if (request.headers.get("Authorization") !== `Bearer ${env.ALERT_TOKEN}`) {
return new Response("Unauthorized", { status: 401 });
}
const { task, title, status, summary, url } = await request.json();
if (!task || !status) {
return new Response("Missing task or status", { status: 400 });
}
try {
const result = await env.EMAIL.send({
from: { email: "[email protected]", name: "Agent alerts" },
to: env.ALERT_TO,
subject: `[${status}] ${task}: ${title ?? ""}`.slice(0, 200),
text: [`${task} moved to ${status}.`, summary ?? "", url ?? ""].join("\n\n"),
});
return Response.json({ sent: true, messageId: result.messageId });
} catch (err) {
// Email Service errors carry a code, e.g. E_RECIPIENT_PLAN_RESTRICTED
return Response.json({ sent: false, code: err.code ?? "UNKNOWN" }, { status: 502 });
}
},
};
- Store the token and deploy. Keep the token out of
wrangler.jsoncand set it as a Worker secret:
npx wrangler secret put ALERT_TOKEN
npx wrangler deploy
curl -X POST https://agent-alerts.your-subdomain.workers.dev \
-H "Authorization: Bearer $ALERT_TOKEN" \
-H "Content-Type: application/json" \
-d '{"task":"ENG-42","title":"Retry webhook on timeout","status":"Ready for Release","summary":"PR #318 open, 14 tests pass.","url":"https://app.sharkly.ai/"}'
A {"sent":true,"messageId":"..."} response means the email left Cloudflare. The send() signature, the address object, and the full error table are in the Workers API reference.
Send the alert when a Sharkly task changes status
The Worker needs a caller, and the cleanest trigger is the status change that already marks the work done. In Sharkly, an Automation is a Space-owned rule that starts an Agent or Crew run when a trigger fires. One of its triggers is a task status change: the run starts when any task moves into the status you pick.

Set it up in three parts.
Create a notifier Agent. Give it two secret environment variables, ALERT_URL and ALERT_TOKEN. Agents in Sharkly carry plain and secret variables per the Agents guide, so the token never appears in a task or comment.
Create the Automation. Pick the Task status change trigger and the status that means “a person should look now.” Ready for Release works for finished work. Add a second Automation on a Blocked status if your workflow has one. The trigger matches that status across the whole Organization, so use the optional task filters to narrow it.
Write instructions the Agent can’t misread:
A task moved to Ready for Release. Confirm the task belongs to the ENG Space; if not, stop.
POST JSON to $ALERT_URL with header "Authorization: Bearer $ALERT_TOKEN":
task (the task key), title, status, url (the task link),
summary (two sentences: what changed and what the reviewer should check).
Do not edit the task. If the POST does not return sent:true, comment the HTTP status on the task.

Use Run now on the Automation before you rely on it, then check the run history. The Automations docs recommend testing each trigger separately and reviewing several runs before you widen the scope. Each notifier run uses your Runtime’s model quota, so keep its instructions short. We cover the trigger model in more depth in how Sharkly task statuses start agent runs.
Add a daily report with a schedule trigger
The same Worker handles a morning digest. Create a second Automation with a schedule trigger, a standard five-field cron expression such as 0 8 * * 1-5 with your timezone. Tell the Agent to list tasks that changed status in the last 24 hours, group them by Done, Ready for Release, and Blocked, and POST the list as one summary.
One email at 8 a.m. beats twelve during the night for most teams. Keep the per-status alert for Blocked work, since that’s the state where waiting costs the most.
Email, Inbox, or Slack: pick by recipient
Sharkly already notifies people inside the app. The Automation editor has a Send notifications field that delivers an Inbox notification when a run finishes, and task subscriptions send status changes to the Inbox and, if a member connects Slack, as Slack DMs.
Use the Inbox or Slack when the person works in Sharkly every day. Use the email Worker when the recipient is a shared address, an on-call rotation, or someone who reviews outcomes without opening the board. If you need an outside system to start agent work instead of receiving it, that’s the inbound direction covered in Sharkly webhook automations.
Errors you will hit first
| Error | Where | What it means | Fix |
|---|---|---|---|
E_RECIPIENT_PLAN_RESTRICTED |
Binding | Free plan, recipient not verified | Verify the address, or move to Workers Paid |
E_RECIPIENT_NOT_ALLOWED |
Binding | Unverified recipient and no sending domain onboarded | Onboard a sending domain |
E_SENDER_DOMAIN_NOT_AVAILABLE |
Binding | from domain not onboarded or not active |
Use an address on your onboarded domain |
E_DAILY_LIMIT_EXCEEDED |
Binding | Daily quota reached (REST returns 429, SMTP 451 4.7.1) |
Wait for the reset; verified sends don’t count |
New accounts start with a conservative daily quota that grows over time. Team alerts to verified addresses skip that quota entirely, which is one more reason to keep them on verified inboxes.
Start with one status
Pick the status your team checks most often by hand and wire only that one. Run it for a week and read every email it sends. If an alert never changed what someone did, delete it. Then add Blocked. To put your agents’ work on one board with status-driven Automations, start a workspace at Sharkly and connect your first Computer.
FAQ
Is Cloudflare Email Sending free on Workers Free?
Yes, for verified destination addresses in your account. Sends to any other recipient fail with E_RECIPIENT_PLAN_RESTRICTED. Workers Paid allows any recipient and includes 3,000 emails a month, then $0.35 per 1,000.
Do I need a domain on Cloudflare?
For the Worker binding with an onboarded sending domain, yes: the onboarding flow only lists domains in your Cloudflare account. Cloudflare calls the Email Routing-only path for verified sends a legacy option and recommends onboarding a domain.
How many people can one alert reach?
One email can carry 50 recipients across to, cc, and bcc. A list alias you verify once is simpler than verifying each teammate.
Can a coding agent call the Worker itself?
Yes. Any process that can send an HTTP POST works, including the last step of the coding agent’s own instructions. A separate Automation keeps the alert working when the coding agent’s run fails partway.
Why did my sent email show as dropped?
Emails sent from a Worker’s send_email binding appear as dropped in the Email Routing summary even when delivered. Check Email Sending metrics and the Activity log instead.



