Generate Lookio RAG-backed Gmail drafts from incoming emails

Workflow automation
Open Template

Stop wasting time searching for information to reply to routine emails. This n8n workflow template automatically generates professional email drafts in your Gmail account by retrieving precise answers from your private knowledge base using Lookio’s RAG engine.

By combining the reasoning power of GPT-4 with the factual grounding of Lookio, you can ensure every draft is accurate, personalized, and consistent with your company policies or technical documentation.

Watch the full walkthrough

In this video, we explain the concept of “Premium RAG” and show you exactly how to set up this workflow to automate your inbox without losing the human touch.

Key benefits of this workflow

This template is designed for teams that receive a high volume of inquiries where the answers already exist in internal documentation (FAQs, manuals, policy docs).

  • Prevent AI Hallucinations: By using Lookio to retrieve relevant context before drafting, the AI relies on your actual data rather than “guessing.”
  • Human-in-the-Loop: The workflow creates a Draft in Gmail instead of sending the email automatically. You maintain full control and can perform a final check before hitting send.
  • Massive Time Savings: Your team no longer needs to hunt for technical specs or policy details—the first draft is already waiting with the correct information included.
  • Token Efficiency: Lookio performs the complex RAG operations and sends only the most relevant text chunks to GPT-4, reducing your API costs and increasing response speed.

How it works

The workflow automates the transition from “Incoming Email” to “Ready-to-Send Draft” in four steps:

  1. Gmail Trigger: The workflow monitors your inbox for new emails.
  2. Intent Extraction: GPT-4 analyzes the incoming email to identify the core question or request.
  3. Knowledge Retrieval: The HTTP node queries your Lookio Assistant to find the specific answer in your uploaded resources (PDFs, URLs, sitemaps).
  4. Draft Creation: A second LLM step drafts the response using the retrieved facts and calls the Gmail node to create a draft in your account.

Setup guide

You can get this automated drafting system running in under 10 minutes.

  • Requirements:
    • An n8n instance.
    • A Lookio account (Sign up free here).
    • A Google/Gmail account with OAuth2 enabled.
  • Instructions:
    1. Import the template: Grab the JSON from the n8n template library.
    2. Connect Gmail: Authorize the Gmail nodes via OAuth2.
    3. Configure Lookio: Enter your API Key and the Assistant ID of the knowledge base you want to use.
    4. Test and Activate: Run a test email through the workflow and check your Gmail “Drafts” folder.

Taking it further

This workflow is a powerful starting point for any business automation:

  • Multilingual Support: Lookio assistants are multilingual. You can receive an email in Spanish and have the assistant retrieve facts to draft a response in the same language automatically.
  • CRM Integration: Add a step to fetch customer data from HubSpot or Salesforce to further personalize the draft.
  • Custom Styles: Update the “Drafter” node instructions to match your brand’s specific tone of voice (e.g., “Always be friendly and use bullet points for technical steps”).

More templates

n8n template to automate the generation of high-quality sourced SEO articles

Workflow automation

AI Automation for RFPs and Security Questionnaires

Assistant prompt

Build an intelligent Q&A chatbot in n8n in Lookio

Workflow automation

100 welcome credits - no credit card required

Ready to unlock your company's knowledge?