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

Answer Gmail support emails from your docs with Gemini and Slack

When you run it, it handles email with Google Gemini using Data Table, Gmail, Slack.

What it does

## Answer support email from your own docs, and escalate what they miss A retrieval workflow with no floor under it always answers, because the nearest paragraph is always something. This one measures how close your docs got, and refuses rather than improvises. ### How it works The indexing branch runs when you run it. It reads your sitemap - including the shape, where every is another sitemap - fetches each page, cuts the article body into overlapping passages, embeds them with Gemini and stores them in a Data Table. Vectors are normalised first: gemini-embedding-001 returns a unit vector at 3072 dimensions and an unnormalised one at 768, so a floor set on the raw numbers would reject everything. The answering branch starts on a Gmail label. It strips the quoted history, embeds what is left, and scores it against every stored passage. Below min_score it stops there. Above it, one model drafts a reply from those passages only and a second audits that draft claim by claim. A reply survives both or it does not go. What survives becomes a Gmail draft in the customer's own thread. What does not becomes a Slack message naming the gap, and a row that turns into your docs backlog. ### Setup 1. A Header Auth credential holding x-goog-api-key and a Google AI Studio key, on both embedding nodes. A Gemini credential on the model node - the same key works. 2. Gmail and Slack credentials, and a Gmail label the questions land on. 3. A Data Table called docs_index with columns chunk_key, url, title, text, vec and run_id. 4. A Data Table called support_questions with columns asked_on, question, status, best_score and note. 5. Put your sitemap in Indexing Settings, run that branch once, then send yourself a question.

The steps

  1. Index The Docs When You Say So
  2. Indexing Settings
  3. Fetch The Sitemap
  4. Read The Sitemap
  5. Is It An Index Of Sitemaps?
  6. Fetch Each Child Sitemap
  7. Read The Child Sitemaps
  8. Gather Every Page URL
  9. Pick The Pages Worth Indexing
  10. Fetch Each Page
  11. Turn Each Page Into Passages
  12. Embed Every Passage
  13. Normalise The Vectors
  14. Store The Passages

33 steps in total.

Similar automations