n8n community node for AgentMail - Email API for AI Agents
npm install n8n-nodes-agentmailThis is an n8n community node for AgentMail - the Email API for AI Agents.
Example: AI-powered email triage workflow with AgentMail
AgentMail lets you create email inboxes programmatically for your AI agents, so they can send, receive, and act upon emails autonomously.
n8n is a fair-code licensed workflow automation platform.
This node provides two components:
n8n-nodes-agentmailbash
npm install n8n-nodes-agentmail
`Credentials
You need an AgentMail API key:
1. Sign up at agentmail.to
2. Go to your dashboard
3. Copy your API key
4. In n8n, create new AgentMail API credentials
Example Workflows
We provide detailed, ready-to-use workflow examples. Each includes step-by-step instructions, workflow JSON for easy import, and customization tips.
| Example | Description | Integrations |
|---------|-------------|--------------|
| Smart Inbox Filter | AI-powered email triage with promo digests | OpenAI, Google Sheets |
More examples (archived)
| Example | Description | Integrations |
|---------|-------------|--------------|
| AI Auto-Reply | Automatically respond to emails using GPT-4 | OpenAI |
| Email Classification | Route emails based on AI-detected categories | OpenAI |
| Lead Capture | Extract contact info and save to spreadsheet | OpenAI, Google Sheets |
| Slack Notifications | Get notified of important emails in Slack | Slack |
| Daily Summary | AI-generated daily email digest | OpenAI, Slack |
| Support Tickets | Auto-create tickets and send confirmations | OpenAI, HTTP/Webhooks |
$3
Example workflows are available as importable JSON files in the
examples/ directory:`
examples/
└── smart-inbox-filter.json # AI email triage with promo digests
`Additional example workflows are available in
examples/archive/.To import a workflow:
1. Download the JSON file from the
examples/ folder
2. In n8n, go to Workflows → Import from File
3. Select the downloaded JSON file
4. Configure your credentials (AgentMail, OpenAI, Slack, etc.)
5. Update placeholder values (inbox IDs, channel names, etc.)$3
Use AgentMail as your primary inbox with AI-powered email triage:
`
PATH 1: Real-time Email Processing
┌─────────────────┐ ┌─────────────┐ ┌─────────────┐
│ AgentMail │───▶│ OpenAI │───▶│ Switch │
│ Trigger │ │ (Classify) │ │ (Route) │
└─────────────────┘ └─────────────┘ └──────┬──────┘
┌──┴──┐
▼ ▼
Forward Store
Important PromoPATH 2: Scheduled Digest (every 5 hours)
┌─────────────────┐ ┌─────────────┐ ┌─────────────┐
│ Schedule │───▶│ Read Promos │───▶│ Summarize │───▶ Send Digest
│ Trigger │ │ (Sheets) │ │ (OpenAI) │
└─────────────────┘ └─────────────┘ └─────────────┘
`1. Important emails → Forwarded immediately to your personal inbox
2. Promotional emails → Stored and summarized every 5 hours
See full documentation for complete setup instructions.
Node Reference
$3
| Operation | Description |
|-----------|-------------|
| Create | Create a new inbox with a unique email address |
| Get | Retrieve inbox details by ID |
| List | List all inboxes in your account |
| Delete | Delete an inbox permanently |
$3
| Operation | Description |
|-----------|-------------|
| Send | Send a new email from an inbox |
| Reply | Reply to an existing message thread |
| Get | Retrieve a specific message |
| List | List messages in an inbox |
$3
| Operation | Description |
|-----------|-------------|
| Get | Retrieve a thread with all messages |
| List | List threads in an inbox |
$3
| Operation | Description |
|-----------|-------------|
| Create | Register a new webhook URL |
| List | List all registered webhooks |
| Delete | Remove a webhook |
Trigger Data
When the trigger fires, you receive:
`json
{
"event": "message.received",
"eventId": "evt_123",
"timestamp": "2024-01-25T10:30:00Z",
"messageId": "msg_456",
"inboxId": "inbox_789",
"threadId": "thread_012",
"from": "sender@example.com",
"to": ["agent@agentmail.to"],
"subject": "Hello Agent",
"text": "Plain text content",
"html": "HTML content
",
"labels": ["received"],
"attachments": []
}
``- Getting Started Guide - Setup and configuration
- Example Workflows - Detailed workflow tutorials
- AgentMail Documentation
- AgentMail API Reference
- n8n Community Forum
Created by Joseph Maregn
---
Note: This is a community node and is not officially supported by AgentMail or n8n.