Gmail workflows
2,590 results — 304 downloadable workflow files, 2,286 source-linked n8n references
Answer customer questions on WhatsApp with OpenAI, Gmail, and Google Sheets
Quick overview This workflow answers incoming WhatsApp customer questions using an OpenAI-powered agent that reads your live website via HTTP requests, escalates unclear or sensitive cases to your support team via Gmail, and logs each conversation to Google Sheets. How it works Triggers when a new WhatsApp message is received. Loads configuration values (company name, website root URL, AI model, language rules, escalation email, and WhatsApp phone number ID) and extracts the customer phone number and message text. Ignores non-text WhatsApp updates (such as images, audio, and status messages). Uses OpenAI with conversation memory to navigate your website by listing links and fetching relevant pages, then generates a structured result containing an answer, escalation flag, sentiment, topic, and source URLs. If the agent marks the request as needing a human, sends an escalation email via Gmail to your support address with the customer details and the drafted reply. Sends the final plain-text reply back to the customer on WhatsApp. Appends the conversation details to a Google Sheets log. Setup Connect credentials for WhatsApp Trigger/WhatsApp Cloud API, OpenAI, Gmail, and Google Sheets
Send daily AI news digests from RSS feeds with OpenAI, Telegram and Gmail
Quick overview This workflow runs every morning at 8 AM, pulls articles from multiple RSS feeds, deduplicates and trims the list, uses OpenAI (GPT-5 Mini) to write a short plain-text news digest, and delivers the same digest to a Telegram chat and a Gmail inbox. How it works Runs daily at 8:00 AM on a schedule. Splits your configured RSS feed URL list into individual feeds and fetches the latest articles from each one, continuing even if a feed fails. Removes duplicate articles by link, keeps only the newest items up to your maxArticles limit, and trims each item to title, link, publish date, and a short snippet. Combines all cleaned articles into a single JSON list and sends it to OpenAI (GPT-5 Mini) to select 5–8 top stories and generate a single plain-text digest under 3,500 characters. Sends the generated digest to your specified Telegram chat. Emails the same digest as a plain-text message through Gmail. Setup Add an OpenAI credential and ensure the GPT-5 Mini model is available in your account. Create a Telegram bot with @BotFather, add the Telegram credential in n8n, and set your target telegramChatId (for example by using @get_id_bot). Connect a Gmail account in n8n and set
Screen LinkedIn jobs and send tailored applications with Apify and OpenAI
Quick overview This workflow collects your job preferences via an n8n form, uses Apify to scrape LinkedIn job listings, and has OpenAI screen and rank them. After you approve a shortlist by Gmail, it generates tailored resume and cover-letter PDFs with DocRaptor, emails them to you, and logs matches to Sheets How it works Receives your job preferences and resume text through an n8n form submission. Sends the preferences to Apify to scrape recent LinkedIn jobs, then removes duplicates and obvious mismatches (seniority, years of experience, and location). Uses OpenAI to score each job’s relevance and eligibility and returns a JSON verdict with a fit score and short reason. Keeps the top matches above the configured threshold and emails you a shortlist in Gmail with approve/decline buttons. If you approve, uses OpenAI to draft a job-specific resume and cover letter from only the provided profile text and generates HTML interview prep questions. Converts the resume and cover letter HTML into PDFs via DocRaptor, emails the tailored application package to you in Gmail, and appends the match details to a Google Sheets tracker. Setup Add credentials for OpenAI, Gmail OAuth2, Google Sheets
Create human-reviewed personalized PDFs from Stripe payments using OpenAI
Quick overview This workflow receives Stripe payment webhooks, looks up the customer’s order in Google Sheets, generates personalized HTML content with OpenAI, converts it to a PDF using PDFShift, then queues the request for human approval and delivers the final document via Gmail with Slack notifications. How it works Receives a Stripe payment notification via a webhook endpoint. Extracts payment details (event type, payment ID, customer email, amount, currency) and stops the main flow if the email is missing. Pulls order rows from Google Sheets and matches the order to the payer’s email. Sends the combined payment and order data to the OpenAI Chat Completions API to generate structured personalized content, then renders it into an HTML document. Converts the HTML to a PDF with PDFShift and sends the customer an acknowledgement email via Gmail. Appends the request to a Google Sheets “ReviewQueue” and notifies staff in Slack with instructions to approve via a separate webhook. When an approval webhook is received and marked approved, emails the final message to the customer via Gmail and updates the “ReviewQueue” status in Google Sheets. Setup Create and configure two webhook URLs
Send CRM lead outreach emails with Notion, Gmail, Google Drive and OpenAI
Quick Overview This workflow watches a Notion CRM for leads ready to contact, checks Gmail to avoid duplicate outreach, then sends or drafts an email with Google Drive PDF attachments and updates the lead status in Notion, with bounce detection that marks invalid emails (using OpenAI to extract addresses). How it works Triggers when a lead page is updated in a selected Notion CRM database. Validates that the lead’s Email field looks like an email address and searches Gmail Sent for recent messages to that recipient to detect prior outreach. If the lead was already emailed and the current status is safe to overwrite, it updates the Notion lead status to “Emailed.” If the lead was not previously emailed, it downloads two PDF attachments from Google Drive, converts them to Gmail attachments, and either creates a Gmail draft for specific domains (optionally sending a Twilio SMS to a rep) or sends a generic vs personalized Gmail email based on whether a contact name exists. After sending, it waits briefly, searches Gmail for bounce messages mentioning “Address not found,” and updates the Notion record to “INVALID EMAIL” (or sets “Emailed” when the status indicates the lead is in an acti
Analyze compliant documents with PromptLock Guard, Claude, and Google Sheets
Quick overview Screen contracts, intake forms, and reports for HIPAA, GDPR, and PCI data — plus always-on prompt-injection detection — before Claude summarizes them. Clean documents pass through, risky ones get flagged for review or blocked, and every document gets an audit row in a Google Sheet. How it works Receives a POST request to a webhook containing either a PDF upload or a JSON body with a text field. Extracts text from PDFs or uses the provided JSON text as-is. Sends the document text to PromptLock Guard to screen for regulated-data and prompt-injection risk, failing closed on screening errors. If the document is allowed or redacted, sends the cleaned text to Anthropic Claude and returns a structured JSON analysis in the webhook response. If the document is flagged, sends a Gmail notification email for human review instead of sending the content to the AI model. If the document is blocked (or screening is unavailable), returns a JSON webhook response indicating the block/unverified reason. Appends a per-document audit row (timestamp, action taken, risk score, and compliance status) to a DocAuditLog tab in Google Sheets. Setup Install the n8n-nodes-promptlock-guard communit
Save starred Gmail emails as Markdown notes to an Obsidian Google Drive folder
Quick overview This workflow runs daily, finds starred Gmail emails that are not yet labeled as saved, converts each email into a Markdown note with YAML frontmatter, uploads the note to a Google Drive folder synced with your Obsidian vault, and then labels the email to prevent duplicates. How it works Runs every day at 7am on a schedule trigger. Searches Gmail for emails matching your query (default: starred) while excluding messages already labeled obsidian-saved. Converts each matching email into a Markdown file with YAML frontmatter (title, from, date, tags) and the email body, using a date-prefixed, filesystem-safe filename. Processes emails one at a time to avoid rate limits and ensure reliable saves. Creates a .md file in the selected Google Drive folder using the generated filename and Markdown content. Adds the obsidian-saved label to the original Gmail message so it is skipped in future runs. Setup Add Gmail OAuth credentials and ensure your account has access to read messages and apply labels. Add Google Drive OAuth credentials and select the destination Drive and folder ID where your Obsidian vault syncs (for example, a folder inside your vault). Create a Gmail label na
Recover Shopify abandoned carts and send weekly reports via Gmail and Sheets
Quick overview This template automates Shopify abandoned cart recovery with a 3-email Gmail sequence, tracks recoveries in Google Sheets via Shopify “order paid” webhooks, and sends a weekly HTML performance report every Monday using data aggregated from the same spreadsheet. How it works Receives a Shopify “checkout created” webhook, verifies the checkout includes an email address, and skips customers who already have an active recovery sequence logged in Google Sheets. Logs the abandoned checkout details to Google Sheets and waits one hour before checking Shopify Orders for a paid purchase by the same email. If no paid order exists, sends the first recovery email via Gmail and updates the Google Sheets row to mark Email 1 as sent. After another 23 hours, checks Shopify Orders again and, if still unpaid, sends the second recovery email via Gmail and updates Google Sheets. After another 48 hours, checks Shopify Orders again and, if still unpaid, creates a unique one-time Shopify discount (price rule + discount code) and sends the third email via Gmail, then stores the discount code and Email 3 status in Google Sheets. Receives a Shopify “order paid” webhook, looks up the customer i
Send and track Slack invoice requests with Gemini, Google Sheets and Gmail
Quick overview Youtube Video: https://youtu.be/42-oHh9w9Eo This workflow listens for Slack @mentions, uses Google Gemini to classify the request and extract invoice details, then reads and updates Google Sheets, generates invoice PDFs with PdfBro, sends invoices or reminders via Gmail, and posts confirmations or errors back to Slack. How it works Triggers when the workflow’s Slack app is mentioned in a specified Slack channel. Uses Google Gemini to classify the message intent (send invoice, remind invoice, or check status) and extract the recipient email and invoice due date. Routes the request based on the extracted intent and stops if the intent cannot be determined. For SEND_INVOICE, looks up the client in a Google Sheets “Client Bill” spreadsheet and posts a Slack error if no matching email is found. If a client is found, generates an invoice PDF with PdfBro, emails it to the client via Gmail, appends/updates the invoice record in a Google Sheets “Client Invoices” spreadsheet, and posts a Slack confirmation. For REMIND_INVOICE, finds an UNPAID invoice for the email in the “Client Invoices” Google Sheet, regenerates the invoice PDF with PdfBro, emails a reminder via Gmail, and p
Export Google Sheets to CSV or Excel and email files with Gmail
Quick Overview This workflow collects a Google Sheet ID and export preferences via an n8n Form, reads the selected tab from Google Sheets, converts the rows to CSV or Excel (XLSX), and sends the generated file as a Gmail attachment to the requester. How it works Receives a request through an n8n Form that asks for an email address, Google Sheet ID, optional tab name, export format (CSV or XLSX), and an optional file name. Reads the rows from the specified Google Sheets document and tab. Validates the email and Sheet ID, checks that the sheet contains data, and attaches export metadata (format, filename, MIME type, row count) to the items. Routes the run based on the selected format to generate either an XLSX file or a CSV file. Sends an email via Gmail to the provided address with the exported file attached. Setup Connect a Google Sheets OAuth2 credential with access to the spreadsheets you want to export. Connect a Gmail OAuth2 credential for the account that sends the export emails. Activate the workflow and share the form URL, then ensure requesters provide the correct Sheet ID and (if used) the exact tab name.
Export Google Sheets data to CSV or Excel and send via Gmail
Quick Overview This workflow collects a Google Sheet export request via an n8n Form, reads the requested tab from Google Sheets, converts the data to CSV or Excel, and emails the generated file to the requester using Gmail. How it works Receives a sheet export request through an n8n Form that captures the Google Sheet ID, optional tab name, desired format (CSV or XLSX), output file name, and recipient email address. Reads the rows from the specified Google Sheets document and tab. Validates the inputs, stops with an error if the email or Sheet ID is invalid, and aborts if the sheet is empty or the tab name is incorrect. Routes the data to either a CSV or XLSX conversion based on the selected export format. Generates the file (CSV or Excel) from the sheet rows and attaches it to an email. Sends the exported file to the user via Gmail, including basic details like file name, format, row count, and the source Sheet ID. Setup Connect a Google Sheets OAuth2 credential with access to the spreadsheets you want to export. Connect a Gmail OAuth2 credential for sending emails and confirm the sender name and email settings. Activate the workflow and share the source Google Sheets with the con
Generate and email invoice PDFs from Google Sheets with PDFMunk and Gmail
Quick overview This workflow watches a Google Sheets order sheet for new invoice rows, generates a unique invoice number, appends the normalized record to another sheet, converts an HTML invoice into a PDF via PDFMunk, and emails the PDF to the client using Gmail. How it works Triggers when a new row is added to a specified Google Sheets worksheet. Maps the incoming columns (client details, item, quantity, price, due date, and status) into a standardized structure and generates an invoice number. Appends the invoice data, including the generated invoice number, into a second worksheet in Google Sheets. Builds an HTML invoice template and calculates totals from quantity and unit price. Sends the HTML to the PDFMunk API to generate a PDF link, then downloads the PDF file. Sends the invoice to the client via Gmail with the PDF attached. Setup Connect your Google Sheets OAuth credentials and select the correct spreadsheet and source/target worksheets for the trigger and append actions. Create a PDFMunk API key (or equivalent header auth) and add it as HTTP Header Auth credentials for the PDF generation request. Connect your Gmail OAuth2 credentials and confirm the email subject/body an
Monitor crypto news risk with CoinDesk RSS, OpenAI, Gmail, and Google Sheets
Quick overview This workflow polls the CoinDesk RSS feed every 10 minutes, filters for crypto-related stories, checks Google Sheets to avoid duplicates, uses OpenAI to score and summarize risk, logs results to Google Sheets, and sends Gmail alerts when the risk priority is HIGH or MEDIUM. How it works Polls the CoinDesk RSS feed every 10 minutes and retrieves the latest articles. Extracts each article’s title, description, link, and publish date, generates an article ID, and filters to only crypto-relevant items using a keyword match. Checks a Google Sheets “Seen Articles” tab to skip any article IDs that have already been processed. Sends the article text to the OpenAI Chat Completions API to return a JSON risk assessment including summary, coins, risk level, score, and recommended action. Parses the OpenAI response, normalizes the risk level into a HIGH/MEDIUM/LOW priority, and appends the article ID to the “Seen Articles” tab and the full analysis to a “Risk Log” tab in Google Sheets. Sends a formatted Gmail alert email for articles marked HIGH or MEDIUM priority. Setup Add an OpenAI API credential (OpenAI API) for the HTTP request to the Chat Completions endpoint. Create a Goog
Screen, score and route job applicants with Gemini, Gmail, Sheets and Slack
Quick Overview This workflow runs daily to pull job applicants from Google Sheets, score each candidate against role requirements using the Google Gemini API, log results back to Google Sheets, and notify a Slack channel when an applicant meets or exceeds a minimum score. How it works Runs every day at 08:00 on a schedule. Reads applicant records from an “Applicants” tab in Google Sheets. Combines the job title, requirements, and each applicant’s resume text into a screening prompt. Sends the prompt to the Google Gemini API and requests a JSON response with score, verdict, strengths, gaps, and summary. Parses the returned JSON and normalizes the screening fields (score, verdict, strengths, gaps, and summary). Appends the screening result for every applicant to a “Screening” tab in Google Sheets. Posts a formatted message to a Slack channel when the applicant’s score is greater than or equal to the configured minimum score. Setup Connect credentials for Google Sheets OAuth, Google Gemini (PaLM) API, and Slack OAuth. Select your Google Sheets spreadsheet and ensure it has an “Applicants” sheet with fields like Name, Email, and Resume/ResumeText, plus a “Screening” sheet to store resu
Triage and route support emails with Gemini, Gmail, Sheets and Slack
Quick Overview This workflow monitors unread Gmail support emails, uses Google Gemini to classify and summarize each message and draft a reply, logs the ticket details to Google Sheets, creates a Gmail draft response, and sends a Slack alert when the ticket is marked high priority. How it works Triggers every minute when a new unread email arrives in Gmail. Adds brand context and support guidelines, then builds a prompt that asks Google Gemini to return a JSON classification, priority, summary, and suggested reply. Sends the prompt to the Google Gemini API and parses the returned JSON into structured ticket fields. Appends the ticket details (sender, subject, category, priority, summary, and suggested reply) to a Google Sheets tab. Creates a Gmail draft reply in the original thread using the suggested response text. Sends a Slack message to a chosen channel when the ticket priority is high. Setup Connect credentials for Gmail, Google Gemini (PaLM) API, Google Sheets, and Slack. Update the brand name and support guidelines values used to guide Gemini’s response. Select the target Google Sheets spreadsheet and the “Tickets” sheet (and ensure your header columns match the fields you w
Deliver workflows after Stripe checkout with Gmail and Google Sheets
Quick overview This workflow listens for completed Stripe Checkout sessions, validates payment status, fetches the purchased workflow from your n8n instance, exports it as a JSON file, emails it to the buyer via Gmail, and logs the sale details to Google Sheets. How it works Triggers when Stripe sends a checkout.session.completed event for a Checkout session. Normalizes key fields from the Stripe event (buyer email, payment status, amount, session ID, and the workflow ID from client_reference_id). Verifies the event is a completed checkout session and the payment status is not unpaid. Retrieves the purchased workflow from the n8n API using the workflow ID passed through Stripe. Appends a sales record to Google Sheets with the timestamp, buyer email, amount, session ID, and workflow details. Exports the fetched workflow to a formatted JSON file and sends it to the buyer as a Gmail attachment with import instructions. Setup Add credentials for Stripe, n8n API, Gmail OAuth2, and Google Sheets OAuth2 used by the workflow. Create or select a Google Sheets spreadsheet and a Sales sheet tab, and ensure the column headers match the fields being appended (Timestamp, Workflow ID, Workflow Na
Handle NPS survey responses with OpenAI, Gmail, and Google Sheets
Quick Overview This workflow runs every 6 hours to read new NPS survey responses from Google Sheets, generates a personalized reply with OpenAI, and sends the email via Gmail. It then routes promoters, passives, and detractors for follow-up actions and marks each response as processed. How it works Runs on a schedule every 6 hours. Reads NPS responses from a Google Sheets tab and keeps only rows where Status equals "new". Validates required fields, parses the 0–10 NPS score, and classifies each response as Promoter, Passive, or Detractor. Sends the response context to OpenAI (Chat Completions) to generate a concise, personalized email body and builds a segment-specific subject line. Sends the personalized reply to the respondent using Gmail. For promoters, appends the comment as a quote to a separate Google Sheets testimonials tab and updates the original row’s Status to "Processed". For passives, updates the original Google Sheets row’s Status to "Processed", and for detractors, emails an alert to a support inbox via Gmail and then updates Status to "Processed". Setup Add credentials for Google Sheets, Gmail, and OpenAI in n8n. Replace YOUR_NPS_SHEET_ID with your Google Sheets doc
Handle NPS survey replies and routing with OpenAI, Gmail, and Google Sheets
Quick Overview This workflow runs every 6 hours to read new NPS responses from Google Sheets, uses OpenAI to draft a personalized reply, sends it via Gmail, routes respondents by NPS segment, logs promoter quotes back to Google Sheets, alerts support on detractors, and marks each row as processed. How it works Runs on a schedule every 6 hours and reads NPS response rows from a Google Sheets document. Filters the sheet to keep only rows where Status equals “new” to avoid reprocessing. Validates required fields, parses the 0–10 NPS score, and classifies each response as Promoter, Passive, or Detractor. Calls the OpenAI Chat Completions API to generate a warm, personalized email body based on the score segment and the customer’s comment. Sends the generated reply to the customer via Gmail and then routes the workflow by segment. For promoters, appends the customer comment as a quote to a “promoter-quotes” tab in Google Sheets and marks the original row as Processed; for passives, it marks the row as Processed. For detractors, sends an alert email to your support team via Gmail and then updates the original Google Sheets row status to Processed. Setup Create credentials for Google Shee
Tailor ATS-ready resumes and cover letters with Gemini, Google Drive, Notion, and Gmail
Quick overview Transform any resume into a professional, ATS-compliant document with AI. Supports Global ATS, German, and Japanese resume formats, generates personalized cover letters, and automates PDF creation and delivery for every job application. How it works Receives an n8n form submission with the company name, job description, selected ATS type, and an optional request to generate a cover letter. Lists resume PDF files from a specified Google Drive folder, downloads each file, extracts the PDF text, and cleans it into a single plain-text resume input. Uses Google Gemini to rewrite the resume into pure-HTML output tailored to the job description, choosing Global ATS, German Lebenslauf, or Japanese Rirekisho formatting based on the selected ATS type. Converts the generated HTML resume into a PDF using the PDF.co HTML-to-PDF API and retrieves the resulting PDF from the returned URL. Uploads the generated resume PDF to a Google Drive output folder, then reads the existing Notion database entries to compute the next serial number and creates a new Notion database page linking to the uploaded file. If cover letter generation is requested, uses Google Gemini to write a localized c
Create personalized videos from Google Sheets with iLoveVideoEditor and Gmail
Quick overview This workflow watches Google Sheets for new rows, renders a personalized video with iLoveVideoEditor using the row data, uploads the finished MP4 to Google Drive, writes the Drive link back to the same sheet row, and emails the link to the recipient via Gmail. How it works Triggers on a schedule when a new row is added to a specified Google Sheets worksheet. Skips rows where the Title field is empty. Starts a video render in iLoveVideoEditor from the cinematic-title template using the row’s Title and Subtitle as template variables. Polls iLoveVideoEditor every 60 seconds (up to 20 attempts) until the render status becomes completed, or stops early if the status becomes failed. When completed, downloads the MP4 from the render URL, uploads it to a specified Google Drive folder, and generates a shareable Drive view link. Updates the original Google Sheets row (matched by ID) with the Video URL and sends the Drive link to the row’s Email address via Gmail. If the render fails, times out, or errors, sends a failure alert email via Gmail with the row details. Setup Install the community node n8n-nodes-ilovevideoeditor (required for self-hosted n8n) and add your iLoveVideo
Find and verify business emails with ScraperCity, OpenAI, Google Sheets, and Gmail
Quick overview This workflow reads contacts from Google Sheets, finds and verifies their business emails via the ScraperCity Email Finder API, generates a short personalized icebreaker with OpenAI, appends the enriched leads to another Google Sheet, and emails a run summary via Gmail. How it works Starts manually to run an email enrichment job. Reads contacts (first name, last name, domain) from an input Google Sheets worksheet and aggregates them into a single payload. Submits the contacts to the ScraperCity Email Finder API, then waits and repeatedly checks the job status until it succeeds or fails/times out. When the job succeeds, downloads the result CSV from ScraperCity, parses it, normalizes key fields (name, domain, email, verification status, provider), and keeps only rows with an email. For each verified contact, prompts OpenAI to generate one short, company-referencing cold-email opening line in the configured language. Appends the enriched lead (including email, status, and icebreaker) to an output Google Sheets worksheet and sends a summary email via Gmail. Setup Create a ScraperCity account with Email Finder credits and add an HTTP Header Auth credential that sends you
Turn support emails into FAQ drafts with Gmail, OpenAI, Sheets and Docs
Quick overview This workflow monitors a Gmail inbox for new support-style emails, uses OpenAI to extract a reusable FAQ question and safe draft answer, logs results to Google Sheets, and then creates a Google Docs draft and/or Gmail review drafts for a human reviewer. How it works Polls Gmail every 5 minutes for unread emails matching the configured support-related search query. Cleans the email content by stripping quoted replies, signatures, and HTML to produce a concise plain-text body. Sends the cleaned email and product context to OpenAI to extract a structured FAQ candidate (question, draft answer, category, score, sensitivity flag, tags, and recommended action). Calculates a routing status based on the FAQ score threshold and sensitivity/recommended action, and prepares draft text for a Google Doc and reviewer email. Appends every processed email and extracted fields to a Google Sheets tab for tracking and reporting. If the candidate is strong, creates a Google Docs FAQ draft, inserts the draft content, and creates a Gmail draft notification to the reviewer with the document link. If the candidate needs manual handling, creates a Gmail draft to the reviewer with the review n
Send quote PDFs from form submissions with Acrewity and Gmail
Quick overview This workflow collects quote requests via an n8n Form, generates a styled PDF quote using Acrewity, emails it to the prospect through Gmail, and automatically sends a follow-up email after a configurable delay. How it works Receives a new quote request submission through the built-in n8n Form. Applies your company and follow-up settings (company name, sender name, quote validity, and delay) to the submission data. Builds an HTML quote that includes a generated quote number, validity date, and the requester’s details. Converts the HTML into a PDF using Acrewity and prepares it as an email attachment. Sends the quote PDF to the requester via Gmail with the quote number and validity date in the subject and body. Waits the configured number of days and then sends a Gmail follow-up email referencing the same quote. Setup Install the community node @acrewity/n8n-nodes-acrewity and add an Acrewity API credential. Add a Gmail credential with permission to send email from the account you want to use. Update the workflow configuration values (company name, sender name, quote validity days, follow-up delay days, and any notes) to match your business. Activate the workflow and s
Route procurement helpdesk tickets from Gmail with Groq and Slack
Quick Overview This workflow monitors a Gmail inbox for procurement requests, uses Groq (Llama 3.1) to classify and route each ticket with SLA logic, escalates high-risk items to Slack, creates a ticket via HTTP, sends an auto-reply from Gmail, and logs the full record to Google Sheets. How it works Triggers every minute when a new email arrives in a Gmail inbox. Extracts the sender, subject, body, timestamps, and Gmail thread/message IDs, and generates a procurement ticket ID. Looks up the email thread ID in Google Sheets to identify whether the request already exists. Uses Groq (Llama 3.1) to classify the request (category, urgency, sentiment, risk, team) and applies routing rules to set SLA deadlines, queues, and escalation flags. If escalation is required, posts a detailed alert to a Slack channel and creates an escalated ticket via an HTTP request; otherwise, creates a standard ticket via an HTTP request. Generates a short agent-facing status summary with Groq, emails the customer an acknowledgement and suggested reply via Gmail, and appends the full ticket and AI outputs to Google Sheets. Setup Connect your Gmail OAuth2 credential for both the inbox trigger and the customer a