---
description: You can now use Email Workers to send multiple replies to the same email thread.
title: Threaded replies now possible in Email Workers
image: https://developers.cloudflare.com/changelog/post/2025-03-12-reply-limits/og.png?v=c5862550383aa102
---

[Skip to content](#main-content)

[View RSS feeds](https://developers.cloudflare.com/fundamentals/new-features/available-rss-feeds/) [ Subscribe to RSS](https://developers.cloudflare.com/changelog/rss/index.xml)

[Back to all posts](https://developers.cloudflare.com/changelog)

March 12, 2025

## Threaded replies now possible in Email Workers

[Email Service](https://developers.cloudflare.com/email-service/)

Copy as Markdown| [View as Markdown](https://developers.cloudflare.com/changelog/post/2025-03-12-reply-limits/index.md)| [Agent setup](https://developers.cloudflare.com/agent-setup/)

We’re removing some of the restrictions in Email Routing so that AI Agents and task automation can better handle email workflows, including how Workers can [reply](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/#reply-to-emails) to incoming emails.

It's now possible to keep a threaded email conversation with an [Email Worker](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/) script as long as:

- The incoming email has to have valid [DMARC ↗︎](https://www.cloudflare.com/learning/dns/dns-records/dns-dmarc-record/).
- The email can only be replied to once in the same `EmailMessage` event.
- The recipient in the reply must match the incoming sender.
- The outgoing sender domain must match the same domain that received the email.
- Every time an email passes through Email Routing or another MTA, an entry is added to the `References` list. We stop accepting replies to emails with more than 100 `References` entries to prevent abuse or accidental loops.

Here's an example of a Worker responding to Emails using a Workers AI model:

*AI model responding to emailsts*

```ts
import PostalMime from "postal-mime";
import { createMimeMessage } from "mimetext";
import { EmailMessage } from "cloudflare:email";

export default {
	async email(message, env, ctx) {
		const email = await PostalMime.parse(message.raw);
		const res = await env.AI.run("@cf/meta/llama-2-7b-chat-fp16", {
			messages: [
				{
					role: "user",
					content: email.text ?? "",
				},
			],
		});

		// message-id is generated by mimetext
		const response = createMimeMessage();
		response.setHeader("In-Reply-To", message.headers.get("Message-ID")!);
		response.setSender("agent@example.com");
		response.setRecipient(message.from);
		response.setSubject("Llama response");
		response.addMessage({
			contentType: "text/plain",
			data:
				res instanceof ReadableStream
					? await new Response(res).text()
					: res.response!,
		});

		const replyMessage = new EmailMessage(
			"<email>",
			message.from,
			response.asRaw(),
		);
		await message.reply(replyMessage);
	},
} satisfies ExportedHandler<Env>;
```

See [Reply to emails from Workers](https://developers.cloudflare.com/email-service/api/route-emails/email-handler/#reply-to-emails) for more information.

```json
{"@context":"https://schema.org","@type":"BlogPosting","@id":"https://developers.cloudflare.com/changelog/post/2025-03-12-reply-limits/#page","headline":"Threaded replies now possible in Email Workers","description":"You can now use Email Workers to send multiple replies to the same email thread.","url":"https://developers.cloudflare.com/changelog/post/2025-03-12-reply-limits/","inLanguage":"en","image":"https://developers.cloudflare.com/changelog/post/2025-03-12-reply-limits/og.png?v=c5862550383aa102","dateModified":"2025-03-12","datePublished":"2025-03-12","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"}}
```
