AI agents can browse the web, query databases, and call APIs, but most of them can't send or receive email. That's a gap worth closing. Onboarding sequences, support threads, vendor negotiations, scheduling, and deal flow all still run through the inbox.
AgentMail is now natively integrated into Sim Studio, the open-source AI agent builder with 27,000+ GitHub stars. Any workflow you build in Sim can create inboxes, send messages, receive replies, and manage full email threads with 21 built-in AgentMail operations on the canvas.
No OAuth. No separate integration layer. Drag an AgentMail block into your workflow, paste your API key, and go.
Why AgentMail in Sim Studio
Sim Studio lets you build agent workflows by dragging blocks onto a canvas and connecting them visually. Over 100,000 builders use it, with 1,000+ integrations across AI providers, databases, and business tools.
AgentMail adds a dedicated agent email layer. Each agent gets its own address (like newsletter-agent@agentmail.to or on your custom domain) and manages everything in that inbox from within the visual canvas.
Give agents their own identity. Each agent gets a real email address with its own threads and history.
Receive and act on inbound email. Monitor an inbox for new messages, parse content and attachments, classify intent, trigger downstream actions.
Carry on threaded conversations. Replies stay in-thread. An agent can receive a customer email, draft a response, send it, wait for the reply, and continue the conversation.
Send transactional messages. Confirmations, reports, daily digests, alerts with HTML support, attachments, and proper deliverability.
Coordinate between agents. Multiple agents, multiple inboxes. They email each other to hand off tasks or escalate issues. Loosely coupled, fully auditable.
All 21 Operations
Messages: Send Message, Reply to Message, Forward Message, List Messages, Get Message, Update Message Labels
Threads: List Threads, Get Thread, Update Thread Labels, Delete Thread
Inboxes: Create Inbox, List Inboxes, Get Inbox, Update Inbox, Delete Inbox
Drafts: Create Draft, List Drafts, Get Draft, Update Draft, Delete Draft, Send Draft
What You Can Build
Newsletter Intelligence Agent. Create an inbox, subscribe it to newsletters, run a daily workflow that reads everything, extracts key points, and sends you one morning briefing. Full tutorial below.
Inbound Support Triage. Receive customer emails, classify intent, draft a contextual reply in-thread. Escalate to a human when confidence is low.
Vendor Negotiation. Handle back-and-forth email threads with vendors, reading replies and managing the conversation until resolution.
Lead Qualification. Receive inbound inquiries, enrich leads with CRM data, score them, respond with a meeting link or route to a human rep.
Applicant Screening. Screen candidates via email, send follow-up questions, evaluate responses, book interviews.
Document Processing. Receive documents as attachments, extract content with an LLM, store structured data, email a confirmation back.
Tutorial: Build a Newsletter Intelligence Agent
This workflow gives an agent its own inbox, subscribes it to newsletters, and sends you one briefing every morning.
What You Need
- A Sim Studio account (free Community tier works) at sim.ai
- An AgentMail account with an API key at agentmail.to
- An LLM API key for Sim Studio (OpenAI, Anthropic, or any supported provider)
To connect: open a workflow, drag an AgentMail block onto the canvas, and paste your API key. For full integration docs, see AgentMail + Sim Studio.
How the Workflow Runs
Schedule trigger (7:00am daily)
-> InitVars (allInsights = [], messageCount = 0)
-> ComputeDate (today's date for subject line)
-> FetchEmails (AgentMail List Messages, limit 50)
-> GuardCheck (messages.length > 0?)
|— false -> stop
|— true -> ProcessLoop (forEach message):
GetMessage -> CleanHTML -> ExtractPoints -> Accumulate -> UpdateVars
After ProcessLoop finishes (once, not per message):
-> SynthesisAgent (LLM -> 300-400 word briefing from all accumulated points)
-> SendBriefing (AgentMail Send Message -> your email)
AgentMail handles receiving. Sim Studio handles processing. You get the briefing in your personal inbox.
Step 1: Create the Agent Inbox
In your AgentMail dashboard, create an inbox with a username like morning-briefing or newsletter-agent. This gives you an address like morning-briefing@agentmail.to.
In AgentMail, the Inbox ID is the full email address (e.g., morning-briefing@agentmail.to). You'll use this as the Inbox ID throughout the tutorial.
Subscribe it to the newsletters, publications, and competitor blogs you want to follow.
Step 2: Set Up Environment Variables
In Sim Studio, go to Settings -> Environment Variables and add:
| Variable | Value |
|---|---|
| AGENTMAIL_API_KEY | Your AgentMail API key |
| AGENTMAIL_INBOX_ID | Your inbox's email address (e.g. |
| BRIEFING_RECIPIENT_EMAIL | Your personal email for the briefing |
Reference these anywhere in your workflow with double curly braces: {{AGENTMAIL_INBOX_ID}}.
Step 3: Build the Workflow
Before you start: Sim Studio auto-names blocks ("AgentMail 1", "Function 1", etc.), but the code inside Function blocks references other blocks by name using <BlockName.field> syntax. Rename each block to match the names in this tutorial, or the references will break.
Also: Sim Studio pre-creates a Start block on every canvas for manual runs (the Run button). The Schedule block you add handles automatic runs. Connect both into InitVars—they are parallel triggers, not a continuation after ComputeDate:
Start ──────►
InitVars → ComputeDate → …
Schedule ──────►
Schedule
Add a Schedule block. Set it to daily at 7:00am in your timezone. Connect it to InitVars. Connect the existing Start block to InitVars as well.
InitVars
Add a Variables block. Name it InitVars. Add two variables:
| Variable | Type | Value |
|---|---|---|
| allInsights | Array | [] |
| messageCount | Number | 0 |
ComputeDate
Add a Function block. Name it ComputeDate. Language: JavaScript.
const now = new Date();
const offsetMinutes = -420; // Your UTC offset in minutes (e.g., 300 for EST, 420 for PDT, -60 for CET, -330 for IST, -420 for ICT/Vietnam)
const localNow = new Date(now.getTime() - offsetMinutes * 60 * 1000);
return { today: localNow.toISOString().split('T')[0] };
Change offsetMinutes to match your timezone. Without this, the date in your briefing subject line may be off by a day.
FetchEmails
Add an AgentMail block. Name it FetchEmails. Operation: List Messages. Set Inbox ID to {{AGENTMAIL_INBOX_ID}}. Under "Show additional fields", set Limit to 50.
Tip: For your first test, set Limit to 5. The workflow finishes in ~15 seconds instead of ~90, so you can verify everything works before scaling up.
GuardCheck
Add a Condition block. Name it GuardCheck. Set the condition to:
<FetchEmails.messages.length> > 0
Route true to ProcessLoop. Route false to nothing (workflow stops).
ProcessLoop
Add a Loop block. Name it ProcessLoop. Type: forEach. Collection Items: <FetchEmails.messages>.
Inside the loop, add these five blocks:
GetMessage — AgentMail block. Operation: Get Message. Inbox ID: {{AGENTMAIL_INBOX_ID}}. Message ID: <loop.currentItem.messageId>.
List Messages only returns a short preview. This fetches the full body.
CleanHTML — Function block. Language: JavaScript.
const html = <GetMessage.html> || "";
const cleaned = html
.replace(/<style[^>]*>[\s\S]*?<\/style>/gi, '')
.replace(/<script[^>]*>[\s\S]*?<\/script>/gi, '')
.replace(/<[^>]+>/g, ' ')
.replace(/\s{2,}/g, ' ')
.trim();
return { text: cleaned.slice(0, 3000) };
ExtractPoints — Agent block. Use a smaller model (gpt-4.1-mini or claude-haiku-4-5) to keep costs low. Prompt:
Read this newsletter excerpt and extract the three most important points.
Each point should be one sentence. Be specific: include names, numbers,
and products where they appear. Skip calls-to-action, sponsorships, and filler.
Newsletter from: <loop.currentItem.from>
Subject: <loop.currentItem.subject>
Content:
<CleanHTML.result.text>
Return as a JSON array of three strings.
Accumulate — Function block. Language: JavaScript.
const insights = <variable.allInsights> || [];
const newPoints = <ExtractPoints.content>;
return {
allInsights: insights.concat(newPoints),
messageCount: (<variable.messageCount> || 0) + 1
};
UpdateVars — Variables block. Set:
| Variable | Value |
|---|---|
| allInsights | <Accumulate.result.allInsights> |
| messageCount | <Accumulate.result.messageCount> |
SynthesisAgent
After the loop, add an Agent block. Name it SynthesisAgent. Use a stronger model (claude-sonnet-4-6 or gpt-4.1). Prompt:
You are an editor writing a morning briefing for a technical founder.
Below are key points extracted from <variable.messageCount> newsletters
received overnight. Write a 300-400 word briefing that:
- Identifies themes appearing across multiple sources
- Flags anything time-sensitive or actionable
- Notes anything surprising or contradicting conventional wisdom
- Uses plain, direct language with no filler transitions
Source material:
<variable.allInsights>
SendBriefing
Add a final AgentMail block. Name it SendBriefing. Operation: Send Message.
| Field | Value |
|---|---|
| Inbox ID | {{AGENTMAIL_INBOX_ID}} |
| To | {{BRIEFING_RECIPIENT_EMAIL}} |
| Subject | Morning Briefing - <ComputeDate.result.today> |
| Text | <SynthesisAgent.content> |
Step 4: Connect the Blocks
Connect blocks in this order (both Start and Schedule feed InitVars; do not chain Schedule after GuardCheck):
Start ──────►
InitVars → ComputeDate → FetchEmails → GuardCheck
Schedule ──────►
GuardCheck (true) -> ProcessLoop:
GetMessage -> CleanHTML -> ExtractPoints -> Accumulate -> UpdateVars
Then: ProcessLoop (after loop completes) -> SynthesisAgent -> SendBriefing
Step 5: Test It
Click Run to trigger the workflow immediately. Each block shows a green checkmark on success or a red error on failure. Click any block to inspect its output.
With 50 messages, the workflow extracts 150 key points, generates a ~400-word briefing, and sends one email. About 90 seconds, roughly $0.035.
AgentMail gives your agents real inboxes. Create inboxes via API. Send and receive Emails with 0 complexity. Free to start.
Getting Started
The integration is live today.
- Sign up for AgentMail at agentmail.to and generate an API key
- Open Sim Studio at sim.ai (free Community plan works)
- Add an AgentMail block to any workflow and paste your API key
- Build your first workflow using the tutorial above, or start from scratch with any of the 21 operations
Sim Studio gives your agents the ability to think. AgentMail gives them the ability to communicate. Together, your agents can handle real business processes end-to-end, over the protocol that business already runs on.
More Reading
- How to Give Your Hermes Agent Its Own Email Inbox
- How to Give Your Openclaw Agent Its Own Email Inbox
- Build an Email Agent with Google ADK and AgentMail
See the full integration docs here. Questions? Reach out at support@agentmail.cc.


