Package Information
Documentation
n8n-nodes-aws-workmail-ews
This is an n8n community node that allows you to interact with AWS WorkMail using the Exchange Web Services (EWS) protocol.
AWS WorkMail is compatible with Microsoft Exchange, which means it supports EWS for programmatic access. This node provides comprehensive integration with AWS WorkMail, including email management, calendar operations, contacts, folders, and attachments.
n8n is a fair-code licensed workflow automation platform.
Installation
Follow the installation guide in the n8n community nodes documentation.
Manual Installation
- Navigate to your n8n installation directory
- Install the package:
npm install n8n-nodes-aws-workmail-ews
- Restart n8n
Using npm
npm install n8n-nodes-aws-workmail-ews
Configuration
Prerequisites
You need the following information from your AWS WorkMail setup:
- EWS Endpoint URL: Your AWS WorkMail EWS endpoint (e.g.,
https://ews.mail.eu-west-1.awsapps.com/EWS/Exchange.asmx) - Email Address: Your AWS WorkMail email address
- Password: Your AWS WorkMail password
Finding Your EWS Endpoint
The EWS endpoint URL follows this pattern:
https://ews.mail.[region].awsapps.com/EWS/Exchange.asmx
Common regions:
us-east-1(US East - N. Virginia)us-west-2(US West - Oregon)eu-west-1(Europe - Ireland)ap-southeast-2(Asia Pacific - Sydney)
Setting Up Credentials in n8n
- Go to Credentials in n8n
- Click Create New Credential
- Search for "AWS WorkMail EWS API"
- Enter your credentials:
- EWS Endpoint URL: Your full EWS endpoint URL
- Email Address: Your AWS WorkMail email
- Password: Your AWS WorkMail password
- Click Save
Operations
This node supports the following resources and operations:
Message (Email)
- Send: Send a new email message
- Send and Wait for Response: Send email and wait for reply (coming soon)
- Reply: Reply to an existing message
- Move: Move a message to a different folder
- Delete: Delete a message
- Get: Retrieve a single message by ID
- Get Many: Retrieve multiple messages from a folder
- Update: Update message properties (e.g., mark as read)
Folder
- Create: Create a new mail folder
- Delete: Delete a folder
- Get: Get folder information
- Get Many: List all folders
- Get Many Folder Messages: Get all messages from a specific folder
- Update: Update folder properties
Calendar
- Create: Create a new calendar
- Delete: Delete a calendar
- Get: Get calendar information
- Get Many: List all calendars
- Update: Update calendar properties
Event (Calendar Items)
- Create: Create a new calendar event/appointment
- Delete: Delete an event
- Get: Get event details
- Get Many: List events from a calendar
- Update: Update event properties
Contact
- Create: Create a new contact
- Delete: Delete a contact
- Get: Get contact information
- Get Many: List all contacts
- Update: Update contact properties
Attachment
- Add: Add an attachment to a message
- Download: Download an attachment as binary data
- Get: Get attachment metadata
- Get Many: List all attachments of a message
Trigger
- On Message Received: Trigger workflow when new emails are received (polling)
Usage Examples
Example 1: Send an Email
- Add the AWS WorkMail (EWS) node to your workflow
- Select Message as the resource
- Select Send as the operation
- Configure:
- To Recipients:
recipient@example.com - Subject:
Hello from n8n - Body:
This is a test email sent via n8n and AWS WorkMail - Body Type:
HTMLorText
- To Recipients:
Example 2: Poll for New Emails
- Add the AWS WorkMail Trigger (EWS) node to start your workflow
- Configure:
- Folder:
inbox(or specific folder ID) - Max Items:
10(number of messages to fetch per poll) - Download Attachments: Enable if you want to download attachments
- Folder:
Example 3: Create Calendar Event
- Add the AWS WorkMail (EWS) node
- Select Event as the resource
- Select Create as the operation
- Configure:
- Calendar ID:
calendar(default calendar) - Subject:
Team Meeting - Start Time:
2024-02-15T10:00:00Z - End Time:
2024-02-15T11:00:00Z - Location:
Conference Room A - Required Attendees:
user1@example.com, user2@example.com
- Calendar ID:
Example 4: Download Email Attachments
- Add the AWS WorkMail (EWS) node
- Select Attachment as the resource
- Select Download as the operation
- Configure:
- Attachment ID: Use from previous message retrieval
- Binary Property:
data(name for binary data storage)
Example 5: Move Message to Folder
- Add the AWS WorkMail (EWS) node
- Select Message as the resource
- Select Move as the operation
- Configure:
- Message ID: ID of the message to move
- Target Folder ID: ID of the destination folder
Example 6: Create Reply Draft with AI Agent
This example shows how to use an AI agent to prepare email replies that can be reviewed before sending.
- Add the AWS WorkMail Trigger (EWS) to start workflow on new emails
- Add an AI Agent node to generate a reply
- Add the AWS WorkMail (EWS) node:
- Select Message as the resource
- Select Create Reply Draft as the operation
- Configure:
- Message ID:
{{ $('Trigger').item.json.ItemId.Id }} - Reply Body:
{{ $('AI Agent').item.json.response }} - Body Type:
HTMLorText - Reply All: Enable if needed
- Message ID:
The draft will be saved in your Drafts folder where you can review and edit it before sending manually.
Distinguished Folder IDs
AWS WorkMail EWS supports these standard folder identifiers:
inbox- Inbox foldersentitems- Sent Items folderdeleteditems- Deleted Items folderdrafts- Drafts folderjunkemail- Junk Email foldermsgfolderroot- Root of the mailbox folder hierarchycalendar- Default calendar foldercontacts- Default contacts folder
Timezone Handling
When working with calendar events, dates and times should be provided in ISO 8601 format:
2024-02-15T10:00:00Z (UTC)
2024-02-15T10:00:00+01:00 (with timezone offset)
Error Handling
The node implements comprehensive error handling:
- 401 Unauthorized: Check your credentials (email/password)
- 404 Not Found: Invalid message/folder/item ID
- 500 Server Error: AWS WorkMail service issue
Enable "Continue On Fail" in the node settings to handle errors gracefully in your workflow.
Limitations
- Maximum 500 items can be retrieved per request (EWS limitation)
- Polling trigger checks for new messages based on timestamp (may miss messages in rare clock skew scenarios)
- Large attachments may impact performance
- Cannot reply to own messages: Exchange/MAPI does not allow replying to messages sent by the same account (error code 0x80040607)
Testing
This node has been extensively tested with real AWS WorkMail:
- ✅ 100% Success Rate: All 26 operations tested and working (26/26)
- ✅ Real Environment: Tested with AWS WorkMail EU-WEST-1
- ✅ All Resources: Messages, Folders, Events, Contacts, Attachments
- ✅ All Operations: Create, Read, Update, Delete (CRUD) for each resource
Test Results
Messages: 7/7 operations ✅
Folders: 5/5 operations ✅
Events: 5/5 operations ✅
Contacts: 5/5 operations ✅
Attachments: 4/4 operations ✅
───────────────────────────────
Total: 26/26 operations ✅
Success Rate: 100%
Compatibility
- n8n version: 1.0.0 or higher
- AWS WorkMail: All regions
- EWS Protocol: Exchange 2010 SP2 (AWS WorkMail uses this version)
Resources
Development
Building
npm install
npm run build
Testing
Interactive Test Suite
An interactive test suite is included for testing all operations:
Copy
.env.exampleto.env:cp .env.example .envEdit
.envand fill in your AWS WorkMail credentials:EWS_USERNAME=your-email@example.com EWS_PASSWORD=your-password EWS_URL=https://ews.mail.{region}.awsapps.com/EWS/Exchange.asmxRun the interactive test suite:
node test.js
The test suite provides an interactive menu to:
- Test individual operations (Get Messages, Send Message, etc.)
- Run all tests at once
- Verify connection and credentials
Local n8n Testing
Link the package locally for testing in n8n:
npm link
cd ~/.n8n/nodes
npm link n8n-nodes-aws-workmail-ews
License
Support
For issues, questions, or contributions, please visit the GitHub repository.