Skip to main content

Draft personalized Outlook support email replies with Supabase RAG and OpenAI

Workflow preview

Workflow preview
100%
Draft personalized Outlook support email replies with Supabase RAG and OpenAI preview
Open on n8n.io

1. Workflow Overview

Description This workflow automates the first line of customer support by intelligently drafting email replies. It bridges the gap between your CRM (Supabase), your technical documentation (Vector ...

Best for

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

Tools used

n8n-nodes-base.stickynote, n8n-nodes-base.microsoftoutlooktrigger, n8n-nodes-base.set, n8n-nodes-base.microsoftoutlook, n8n-nodes-base.googlesheets, @n8n/n8n-nodes-langchain.agent, @n8n/n8n-nodes-langchain.lmchatopenai, @n8n/n8n-nodes-langchain.vectorstoresupabase

Source and attribution

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

Original n8n.io source

1.1 Workflow description

Title
Draft personalized Outlook support email replies with Supabase RAG and OpenAI
Workflow name
Draft personalized Outlook support email replies with Supabase RAG and OpenAI

Description

This workflow automates the first line of customer support by intelligently drafting email replies. It bridges the gap between your CRM (Supabase), your technical documentation (Vector Store), and your inbox (Outlook). By analyzing the sender's identity and the technical content of the query, it ensures that every draft reply is personalized, accurate, and follows strict business rules.

How It Works

  1. Trigger: Monitors a Microsoft Outlook inbox for new incoming messages.
  2. Contact Enrichment: Queries a Supabase contacts table using the sender's email to retrieve their name, organization, and department.
  3. Context Construction: A Code node prepares a "Chat Input" that includes the email body, sender metadata, and specific brand "Business Rules."
  4. AI Intelligence (RAG):
  • An AI Agent (GPT-4o) analyzes the request.
  • If technical details are required, the Agent uses a Supabase Vector Store tool to retrieve semantic matches from your product manuals.
  1. Draft Creation: The AI generates an HTML-formatted reply which is saved as a Draft in Outlook for manual review.
  2. Audit Trail: Logs the intent, urgency, and outcome into a Google Sheet for performance tracking.

Requirements

  • Microsoft Outlook: Business/Office 365 account.
  • Supabase: * A table for contact lookups.
  • A vector-enabled database containing document embeddings.
  • OpenAI API: For the GPT-4o model and embeddings.
  • Google Sheets: To maintain an execution summary log.

Setup Instructions

  1. Import: Paste the workflow JSON into your n8n canvas.
  2. Credentials: Set up and select credentials for Outlook, OpenAI, Supabase, and Google Sheets.
  3. Placeholder Updates:
  • Fetch Contact Info: Set the table name to your specific CRM table.
  • Vector Store: Update the table name and query function to match your Supabase Vector Store setup.
  • Log to Google Sheets: Replace the Document ID and Sheet Name with your specific spreadsheet details.
  1. Persona Tuning: Open the AI Support Agent node and the Build AI Prompt code node to replace the [YOUR_COMPANY] and [YOUR_NAME] placeholders with your actual brand identity.

Customization Ideas

  • Urgency Routing: Add an If node after the Agent to send a Slack or Teams notification if the AI detects the urgency is "high."
  • Attachments: Modify the Outlook node to include specific PDF brochures based on the primary_product_codes identified by the AI.
  • Human-in-the-loop: Use n8n "Wait for Webhook" or "Manual Approval" nodes if you want to approve the draft within the n8n UI before it hits the Outlook drafts folder.

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 - Template Header

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

Block 2 - Context Sticky Note

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

Block 3 - AI Sticky Note

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

Block 4 - On Email Received

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

Block 5 - Config Variables

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

Block 6 - Draft Outlook Reply

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

Block 7 - Log to Google Sheets

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.7

Block 8 - AI Support Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 3

Block 9 - GPT-4o Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.3

Block 10 - Vector Store (Supabase)

Type / Role
@n8n/n8n-nodes-langchain.vectorStoreSupabase - vectorStoreSupabase
Config choices
Version 1.3

Block 11 - OpenAI Embeddings

Type / Role
@n8n/n8n-nodes-langchain.embeddingsOpenAi - embeddingsOpenAi
Config choices
Version 1.2

Block 12 - Build AI Prompt

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

Block 13 - Fetch Contact Info

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

3. Summary Table

Workflow Draft personalized Outlook support email replies with Supabase RAG and OpenAI
Complexity intermediate
Nodes 13
Categories Ticket Management, AI RAG
Author Matthew
Published 20 Jan 2026

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/12839/12839.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 Draft personalized Outlook support email replies with Supabase RAG and OpenAI do?

Description This workflow automates the first line of customer support by intelligently drafting email replies. It bridges the gap between your CRM (Supabase), your technical documentation (Vector ...

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, AI RAG use case.