Skip to main content

Create e-mail responses with Fastmail and OpenAI

Workflow preview

Workflow preview
100%
Create e-mail responses with Fastmail and OpenAI preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Workflow Description: This n8n workflow automates the drafting of email replies for Fastmail using OpenAI's GPT 4 model. Here’s the overall process: 1. Email Monitoring : The workflow continuously ...

Best for

  • Ticket Management automation workflows
  • Multimodal AI automation workflows
  • intermediate n8n builders looking for reusable templates

Tools used

n8n-nodes-base.httprequest, n8n-nodes-base.splitout, n8n-nodes-base.emailreadimap, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.openai, n8n-nodes-base.filter, n8n-nodes-base.stickynote

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Vitali.

Original n8n.io source

1.1 Workflow description

Title
Create e-mail responses with Fastmail and OpenAI
Workflow name
Create e-mail responses with Fastmail and OpenAI

Workflow Description:

This n8n workflow automates the drafting of email replies for Fastmail using OpenAI's GPT-4 model. Here’s the overall process:

  1. Email Monitoring: The workflow continuously monitors a specified IMAP inbox for new, unread emails.
  2. Email Data Extraction: When a new email is detected, it extracts relevant details such as the sender, subject, email body, and metadata.
  3. AI Response Generation: The extracted email content is sent to OpenAI's GPT-4, which generates a personalized draft response.
  4. Get Fastmail Session and Mailbox IDs: Connects to the Fastmail API to retrieve necessary session details and mailbox IDs.
  5. Draft Identification: Identifies the "Drafts" folder in the mailbox.
  6. Draft Preparation: Compiles all the necessary information to create the draft, including the generated response, original email details, and specified recipient.
  7. Draft Uploading: Uploads the prepared draft email to the "Drafts" folder in the Fastmail mailbox.

Prerequisites:

  1. IMAP Email Account: You need to configure an IMAP email account in n8n to monitor incoming emails.
  2. Fastmail API Credentials: A Fastmail account with JMAP API enabled. You should set up HTTP Header authentication in n8n with your Fastmail API credentials.
  3. OpenAI API Key: An API key from OpenAI to access GPT-4. Make sure to configure the OpenAI credentials in n8n.

Configuration Steps:

  1. Email Trigger (IMAP) Node:

    • Provide your email server settings and credentials to monitor emails.
  2. HTTP Request Nodes for Fastmail:

    • Set up HTTP Header authentication in n8n using your Fastmail API credentials.
    • Replace the httpHeaderAuth credential IDs with your configured credential IDs.
  3. OpenAI Node:

    • Configure the OpenAI API key in n8n.
    • Replace the openAiApi credential ID with your configured credential ID.

By following these steps and setting up the necessary credentials, you can seamlessly automate the creation of email drafts in response to new emails using AI-generated content. This workflow helps improve productivity and ensures timely, personalized communication.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Session

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 2 - Get Mailbox IDs

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 3 - Split Out

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 4 - Email Trigger (IMAP)

Type / Role
n8n-nodes-base.emailReadImap - emailReadImap
Config choices
Version 2

Block 5 - Get fields from source email

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 6 - OpenAI

Type / Role
@n8n/n8n-nodes-langchain.openAi - openAi
Config choices
Version 1.5

Block 7 - Filter for drafts folder

Type / Role
n8n-nodes-base.filter - filter
Config choices
Version 2.2

Block 8 - upload draft email

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - gather data for draft email

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 10 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 11 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow Create e-mail responses with Fastmail and OpenAI
Complexity intermediate
Nodes 11
Categories Ticket Management, Multimodal AI
Author Vitali
Published 28 Sept 2024

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/2441/2441.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does Create e-mail responses with Fastmail and OpenAI do?

Workflow Description: This n8n workflow automates the drafting of email replies for Fastmail using OpenAI's GPT 4 model. Here’s the overall process: 1. Email Monitoring : The workflow continuously ...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Ticket Management, Multimodal AI use case.