๐ซ Automated email replies with GPT-4o, Outlook, and GoToHuman approval
โก 1,801 views ยท ๐ซ Ticket Management & Triage
Description
This n8n workflow reads emails from your Outlook inbox, drafts AI-powered replies using OpenAI, and routes them through the gotoHuman node for human approval before replying automatically.
โ Key Features
- Reads Outlook emails from today only (excluding those from your own address).
- AI-generated replies crafted using OpenAI based on the subject and body of the email.
- Community node integration: Uses the
gotoHumannode for human review and approval of replies before sending. - Safe sending: Only approved responses are automatically sent back via Outlook.
- Expandable: Can be easily modified to:
- Send drafts instead of full replies
- Include additional email filters
- Trigger at intervals or via webhook
๐ง Nodes Used
Microsoft Outlookโ Fetch and reply to emailsOpenAIโ Generates smart reply textgotoHumanโ Human-in-the-loop approval systemLoop Over Items,IF,Code, andSetnodes for processing logicManual Triggerโ For testing
๐ง Setup Instructions
1. Connect APIs
-
Outlook OAuth2:
- Go to Azure Portal
- Register an app
- Add Mail.Read, Mail.Send scopes
- Set redirect URI:
https://api.n8n.cloud/oauth2-credential/callback - Paste credentials in n8n credential manager
-
OpenAI API:
- Create account at OpenAI
- Create an API Key
- Add it to n8n credentials
-
gotoHuman API:
- Go to https://gotoHuman.ai and sign in
- Create a review template (e.g., โEmail Responsesโ)
- Copy the Template ID and API key into n8n credentials
๐ช Workflow Steps Overview
1. Trigger
Use the Manual Trigger to test or schedule execution with a cron node.
2. Filter Emails from Today
A Code node outputs todayโs date in the proper yyyy-mm-dd format.
const today = new Date();
today.setHours(0, 0, 0, 0);
return [{ json: { searchQuery: `received:${today.toISOString().split('T')[0]}` } }];
3. Search and Filter Outlook Messages
- Uses the Outlook node with a search query like:
received:2025-08-06 -from:rbreen@ynteractive.com(Update to your email)
4. Generate AI Response
-
Text prompt to OpenAI:
subject: {{ $json.subject }} body: {{ $json.body.content }} -
System prompt:
> You are a personal assistant helping respond to emails. I am an AI automation expert specializing in helping small and medium-size businesses automate processes. Create a short response to the email. Sign the email as Robert Breen.
5. Review with gotoHuman
- Submit AI output for human approval using the
gotoHumannode. - The output schema should match the Review Template fields (e.g., โemailโ, โOriginalEmailโ).
6. IF Node Decision
- If status is
approved, send reply - If not, return to loop for revision or skip
โ๏ธ Customization Ideas
- โ๏ธ Send only drafts by skipping the โreplyโ step and storing results.
- ๐ Schedule the workflow with a Cron trigger for automation.
- ๐ Add label filters or subject keywords for advanced targeting.
๐ External Links
๐ฌ Need More Help?
If youโd like help customizing this or building similar automations, reach out:
Robert Breen
AI & Automation Consultant
๐ https://ynteractive.com
๐ง robert.j.breen@gmail.com
๐ LinkedIn
๐ Nodes Used
Microsoft Outlook, AI Agent, OpenAI Chat Model, Structured Output Parser, Think Tool
๐ฅ Import
Download workflow.json and import into n8n:
Workflow menu โ Import from File