Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Email Automation

Email Automation

Draft Fastmail Email Replies With OpenAI GPT-4 via IMAP

Reads email from an IMAP inbox, drafts personalized replies with GPT-4, and connects to Fastmail for session and mailbox data. Runs when triggered manually.

What it does

## 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.

The steps

  1. Manual Trigger
  2. Session
  3. Get Mailbox IDs
  4. Split Out
  5. Email Trigger (IMAP)
  6. Get fields from source email
  7. OpenAI
  8. Filter for drafts folder
  9. upload draft email
  10. gather data for draft email

Similar automations