n8n

How to Automate Gmail Document Analysis Delivery?

Collect files, turn them into clear insights, and send a summary by email with a link to an AI chat for follow up questions. Great for teams that need fast document reviews for clients, staff, or stakeholders.

Incoming files arrive through a form. Each file is split and sent to a parsing API that turns it into markdown. The flow checks parsing status, pulls the result, and merges all markdown. An AI model translates and analyzes the content, then the text becomes HTML and a clean attachment. A copy is stored in a vector database using Mistral embeddings and Pinecone so the chat assistant can answer questions with context. A second trigger listens for chat messages and uses a retriever and Q and A chain with Gemini to reply based on the uploaded content. Gmail sends the report and link so the user can keep the conversation going.

Setup needs accounts for email, AI, parsing, and vector storage. Expect hours of manual reading to drop to minutes. This is useful for policy reviews, onboarding packs, proposals, and research summaries where users still want a chat to clarify details.

What are the key features?

  • Form intake with required and optional file fields plus email capture
  • Batch loop to process multiple files and keep runs stable
  • Document parsing via external API to produce clean markdown
  • Status check logic to wait for parsing to finish before moving on
  • AI translation and analysis using Gemini for clear summaries
  • Markdown to HTML conversion and formatted text generation
  • Email delivery through Gmail with the report attached and a chat link
  • Vector store build with Mistral embeddings and Pinecone for chat answers
  • Chat trigger that retrieves facts and runs a Q and A chain on demand

What are the benefits?

  • Reduce manual review from 3 hours to 10 minutes
  • Streamline document intake by 80 percent with one form
  • Improve answer accuracy by 30 percent using vector search
  • Handle 10 times more documents per day with the batch loop
  • Connect email, parsing, AI, and vector storage in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Gmail, Google Gemini, LlamaIndex Cloud, Pinecone and Mistral AI. See the Tools Required section above for links to create accounts with these services.
  3. In the n8n credentials manager, open the Gmail node, choose Create new credential, and follow the on screen steps to connect your Google account with OAuth2. Name the credential clearly, for example Gmail Document Reports.
  4. For Google Gemini, double click any Gemini node, choose Create new credential, and paste your API key from the Google AI Studio API page. Save with a clear name.
  5. For Mistral AI embeddings, open the Embeddings Mistral Cloud nodes, create a new API Key credential, and paste your Mistral key from the Mistral account page. Name it so you can recognize it later.
  6. For Pinecone, open the Pinecone Vector Store nodes, click Create new credential, and add your Pinecone API key and environment. In the node, set the index name that exists in your Pinecone project.
  7. For LlamaIndex Cloud parsing, open each HTTP Request node that calls the parsing API and replace the Authorization header value with your real bearer token from the LlamaIndex Cloud API page.
  8. Open the Form Trigger node and confirm the field labels match your form: file1 and file2 for files, and provide your mail Id for the email. Save and copy the public form URL.
  9. Check the If and status check nodes to ensure the flow waits for parsing to complete before fetching the markdown. Keep the job status URL pattern exactly as shown.
  10. Open the Gmail node and confirm the To field references the email from the form. Update the subject and message text if needed. Attachments are already mapped from the Convert to File node.
  11. Open the Pinecone and embeddings section and confirm the splitter size and overlap fit your documents. Larger chunks give more context, smaller chunks give more precise matches.
  12. Test end to end: submit the form with two sample files and your email. In n8n, watch the execution to see upload, status checks, analysis, and email send. Then open the chat link from the email and ask a few questions.
  13. Troubleshoot common issues: if parsing never completes, verify the bearer token and file format. If email fails, recheck Gmail OAuth. If chat answers are off topic, confirm the index name and that embeddings ran without errors.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Gmail

Sign up

No cost: Personal Gmail (Gmail API has no usage-based pricing; quotas apply)

Google Gemini

Sign up

Free tier: $0 via Gemini API; e.g., Gemini 2.5 Flash-Lite free limits 1,000 requests/day (15 RPM, 250k TPM). Paid from $0.10/1M input tokens and $0.40/1M output tokens.

LlamaIndex Cloud

Sign up

Free plan: $0 / mo, includes 10,000 credits; API access available

Mistral AI

Sign up

Free API tier: $0 (usage-limited). Lowest paid usage: Mistral Embed at $0.10 per 1M tokens.

Pinecone

Sign up

Starter (Free): $0 / mo; includes 2 GB storage, 2M write units / mo, 1M read units / mo, up to 5 indexes; API access.

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.