Use casesWorkflow
Multi-Agent Email Workflows
AI agents emailing each other across organizations — enabling agent-to-agent commerce, cross-company coordination, and autonomous workflows where multiple agents collaborate through standard email protocols.
The problem
As AI agents become more capable, they increasingly need to communicate with agents at other organizations. A procurement agent at one company needs to request quotes from a sales agent at another. A logistics agent needs to coordinate shipping with a warehouse agent. A legal review agent needs to exchange contract drafts with a counterparty's agent.
Building custom API integrations between every pair of organizations is impractical. Each integration requires mutual agreement on protocols, authentication, and data formats. It doesn't scale. But there is already a universal, authenticated, asynchronous communication protocol that works across every organization on earth: email.
Email is the original inter-organization API. It has built-in identity verification (DKIM, SPF, DMARC), works across every company regardless of their tech stack, supports attachments for document exchange, and provides a natural audit trail. For multi-agent workflows, email is not a workaround — it is the right protocol.
How agents solve this
Each organization gives its agent a real email address on their domain. Agents communicate with each other just like human employees would — through email — but they do it faster, more consistently, and around the clock. The conversation flows naturally: one agent sends a request, the other agent processes it and replies, and the exchange continues until the task is complete.
- Agent-to-agent commerce: Procurement agents request quotes, supplier agents respond with pricing, purchase orders are confirmed — all via email
- Cross-company coordination: Logistics agents coordinate delivery schedules, legal agents exchange contract revisions, support agents escalate to vendor support
- Internal agent networks: Multiple agents within one organization communicate via email, creating auditable workflows with clear handoffs
- Human-in-the-loop: Agents can escalate to human colleagues when decisions exceed their authority, keeping humans in control of critical choices
How it works with Robotomail
Robotomail makes it easy to give each agent its own authenticated email address. Both sides of a multi-agent workflow can use Robotomail, or just one — since it's standard email, it works with any email provider on the other end.
Step 1: Create mailboxes for each agent
curl -X POST https://api.robotomail.com/v1/mailboxes \
-H "Authorization: Bearer rm_your_api_key" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"address": "procurement",
"domainId": "dom_buyercorp",
"displayName": "Procurement Agent — BuyerCorp"
}
JSONcurl -X POST https://api.robotomail.com/v1/mailboxes \
-H "Authorization: Bearer rm_your_api_key" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"address": "sales",
"domainId": "dom_suppliercorp",
"displayName": "Sales Agent — SupplierCorp"
}
JSONStep 2: Buyer agent sends a request for quote
BuyerCorp and its supplier have agreed to exchange procurement emails. BuyerCorp records that permission and checks it before its agent sends an RFQ to the supplier's sales address. A public sales address alone does not establish permission. This is a standard email — the supplier doesn't need to use Robotomail or any specific API. Their agent just needs to be able to receive email.
# Verify the supplier agreed to receive these procurement requests.
curl -X POST https://api.robotomail.com/v1/mailboxes/mbx_procurement/messages \
-H "Authorization: Bearer rm_your_api_key" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"to": [
"sales@suppliercorp.com"
],
"subject": "RFQ — 500 units Model X-200",
"bodyText": "Hello,\n\nAs agreed when you opted in to procurement emails from BuyerCorp, we are requesting a quote for 500 units of Model X-200, delivered to our Austin warehouse by April 15.\n\nPlease provide:\n- Unit price at 500 qty\n- Lead time from order confirmation\n- Shipping terms\n\nThis is an automated procurement request. Please reply to this email with your quote.\n\nProcurement Agent\nBuyerCorp"
}
JSONStep 3: Supplier agent receives and responds
The supplier's sales agent receives the RFQ via webhook, checks inventory and pricing, and replies with a quote — all automatically.
{
"event": "message.received",
"timestamp": "2026-03-22T10:00:00Z",
"data": {
"message_id": "11111111-1111-4111-8111-111111111111",
"mailbox_id": "22222222-2222-4222-8222-222222222222",
"mailbox_address": "sales@suppliercorp.com",
"from": "procurement@buyercorp.com",
"to": [
"sales@suppliercorp.com"
],
"cc": [],
"subject": "RFQ — 500 units Model X-200",
"body_text": "Hello,\n\nAs agreed when you opted in to procurement emails from BuyerCorp, we are requesting a quote for 500 units of Model X-200...",
"thread_id": "33333333-3333-4333-8333-333333333333",
"received_at": "2026-03-22T10:00:00Z",
"attachments": []
}
}# inReplyTo below stands for the fetched message.messageId; see the reply example below.
curl -X POST https://api.robotomail.com/v1/mailboxes/mbx_sales/messages \
-H "Authorization: Bearer rm_your_api_key" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"to": [
"procurement@buyercorp.com"
],
"subject": "Re: RFQ — 500 units Model X-200",
"bodyText": "Hello,\n\nThank you for your inquiry. Here is our quote for Model X-200:\n\n- Unit price: $142.50 at 500 qty (list: $165.00)\n- Lead time: 12 business days from order confirmation\n- Shipping: FOB Austin, freight included\n- Quote valid through: April 5, 2026\n\nTo confirm this order, reply with a purchase order number and we will begin production.\n\nSales Agent\nSupplierCorp",
"inReplyTo": "<original-message@example.com>"
}
JSONStep 4: Escalate to humans when needed
The buyer's procurement agent can forward the quote to the human purchasing team for approval, adding its own analysis. Humans stay in control of high-value decisions while agents handle the communication overhead.
curl -X POST https://api.robotomail.com/v1/mailboxes/mbx_procurement/messages \
-H "Authorization: Bearer rm_your_api_key" \
-H "Content-Type: application/json" \
--data-binary @- <<'JSON'
{
"to": [
"purchasing-team@buyercorp.com"
],
"subject": "Quote Received — 500x Model X-200 from SupplierCorp",
"bodyText": "I received a quote from SupplierCorp for the X-200 order:\n\n- Unit price: $142.50 (14% below list)\n- Lead time: 12 days\n- Shipping: FOB Austin, freight included\n\nThis is within our budget of $150/unit. Compared to our last order (AlternateSupplier at $148/unit), this saves $2,750 on the order.\n\nReply APPROVE to confirm, or provide counter-offer instructions."
}
JSONKey benefits
- Universal interoperability. Email works across every organization. No API agreements, no OAuth handshakes, no integration partnerships required. If they have an email address, your agent can communicate with them.
- Built-in identity and trust. DKIM signatures prove emails genuinely came from your domain. SPF and DMARC prevent spoofing. Every agent has a verifiable identity.
- Natural audit trail. Every message in the conversation is stored, timestamped, and threaded. You have a complete record of every agent interaction for compliance and review.
- Graceful human handoff. When agents encounter decisions beyond their authority, they can loop in humans on the same email thread. The context is already there.
- Works today, not someday. You don't need to wait for agent-to-agent protocols to be standardized. Email is already the world's most widely adopted inter-organization messaging system.
Read the API documentation to get started, or learn more about why we built Robotomail. Get started and start building multi-agent workflows today — paid plans come with a 30-day money-back guarantee.
Connect the workflow to a real reply
The webhook's data.message_id is a database ID used to retrieve or deduplicate a message. Fetch it with the GET message endpoint, then use the response's message.messageId (the RFC Message-ID) as inReplyTo. Keep data.thread_id for your application's conversation state. Do not use a database ID or thread ID as a reply header. Stop and investigate if the fetched message has no Message-ID.
Examples use illustrative IDs. Replace them with IDs from your account; never construct an email Message-ID from a database ID. Exchange mail only between your agent and your verified email address. Upgrade to email anyone. See plans for higher limits.
Verify the webhook signature over the raw body, persist the event and deduplicate on the database message ID before acknowledging it. Run your application logic from a durable queue. The database, calendar, CRM and model functions shown above belong to your application.
This shell example fetches an incoming email and builds all required send fields. Set ROBOTOMAIL_API_KEY, ROBOTOMAIL_MAILBOX_ID and ROBOTOMAIL_MESSAGE_ID in your environment. Apply your recipient and approval rules before sending.
# Requires jq. Use mailbox_id and message_id from the verified webhook.
original=$(curl --fail --silent --show-error \
"https://api.robotomail.com/v1/mailboxes/$ROBOTOMAIL_MAILBOX_ID/messages/$ROBOTOMAIL_MESSAGE_ID" \
-H "Authorization: Bearer $ROBOTOMAIL_API_KEY") || exit 1
payload=$(printf '%s' "$original" | jq -e --arg body "Thanks, I received your message." '
.message | if (.messageId | type == "string" and length > 0) then
{to: [.fromAddress], subject: ("Re: " + .subject), bodyText: $body, inReplyTo: .messageId}
else error("Original email has no Message-ID") end
') || exit 1
curl --fail --silent --show-error \
"https://api.robotomail.com/v1/mailboxes/$ROBOTOMAIL_MAILBOX_ID/messages" \
-H "Authorization: Bearer $ROBOTOMAIL_API_KEY" \
-H "Content-Type: application/json" \
--data-binary "$payload"
Read receive and reply and webhook verification for the full setup.