Use this powerful n8n workflow to poll unread emails from JMAP compliant providers like Fastmail. Learn how to construct complex JMAP queries using the n8n HTTP Request node.
Download this n8n workflow template and start using it instantly.
While many email providers rely on standard protocols, modern services like Fastmail utilize the robust JMAP (JSON Mail Access Protocol) standard. This advanced n8n workflow provides a blueprint for integrating directly with JMAP APIs. By chaining multiple HTTP requests, this specific n8n workflow first retrieves necessary session and account IDs, then dynamically finds the Inbox ID, and finally executes a combined query/get operation to fetch the details of the top 3 unread messages. This highly customizable approach ensures that you can implement sophisticated email filtering and processing within any n8n automation.
This n8n automation uses a manual n8n trigger for immediate execution, suitable for scheduled polling or testing.
Mailbox/get method, identifying the unique mailboxid for the Inbox.accountid and mailbox_id for the final step.Email/query to find the IDs of the top 3 unread emails in the Inbox (notKeyword: "$seen"). It then uses those IDs in a subsequent Email/get call within the same request to retrieve the full details (sender, subject, date) of those messages. This detailed setup showcases powerful logic within a single n8n node, making this a useful n8n template for complex API interactions.To use this n8n template, follow these steps:
Authorization.Bearer $apiToken (replacing $apiToken with your actual token from the service provider).Fetch API details, Get mailboxes, Get unread messages) are linked to these new credentials. When clicking "Execute Workflow" (n8n trigger): A manual n8n trigger used for immediate execution or for testing the workflow logic before setting up a Schedule trigger.
Fetch API details (HTTP Request n8n node): Fetches the primary JMAP session details from /jmap/session. Key function: Retrieves the required accountId for mail operations.
Get mailboxes (HTTP Request n8n node): Uses the JMAP /api/ endpoint to execute the Mailbox/get method call. Key Configuration: Dynamic pathing using expressions to pull the account ID from the previous n8n node output.
Format results (Set n8n node): Essential n8n node for data preparation. Key Configuration: Uses expressions to extract the specific Mail account ID and searches the mailbox list to find the ID of the 'inbox' role, ensuring the subsequent query targets the correct mailbox.
Email/query followed by Email/get) to efficiently locate and fetch the top 3 unread emails based on the provided accountid and mailboxid.Use this advanced n8n workflow to poll multiple Gmail accounts hourly, normalize incoming messages, store unified email data in n8n Data Tables, and send immediate Discord alerts for new activity.

Use this n8n workflow to automate plant care reminders using Google Sheets for scheduling, OpenWeather for smart rain delay checks, and Telegram notifications with click-to-confirm buttons.

Use this powerful n8n workflow to generate dynamic travel itineraries. Integrates Google Gemini (Vertex AI), live flight searches, and custom logic via n8n templates.

Use this powerful n8n workflow to instantly look up caller details in Google Sheets and populate dynamic variables for Retell AI voice agents. This n8n template ensures personalized voice interactions.

Automate hourly crypto price summaries (Bitcoin) using an n8n workflow. Fetch data via HTTP Request, format the message, and post to X/Twitter and Gmail using this ready-to-use n8n template.

Use this robust n8n workflow template to monitor multiple RSS feeds, manage post history using Google Sheets for de-duplication, and automatically share only new articles to a Slack channel. Learn how to implement this practical n8n solution.








































