Code workflows
445 results — all source-linked n8n references
Handle real estate SMS inquiries with Twilio, Google Sheets, Gemini, and Calendar
Quick overview Youtube Explanation: https://youtu.be/e_07nGFmVs0 This workflow replies to inbound Twilio SMS messages with property details and viewing scheduling help by looking up leads and properties in Google Sheets, using a Google Gemini agent with Redis chat memory, and checking/booking appointments in Google Calendar. How it works Receives an inbound SMS via Twilio. Looks up the sender’s mobile number in a Google Sheets “leads_info” spreadsheet and appends/updates the lead record if it does not exist, extracting a 4-digit property code from the message when available. Splits any saved semicolon-separated property IDs into individual lookups, fetches matching property rows from a Google Sheets “Property details” spreadsheet, and compiles a summary of found vs. missing property codes. Sends the user message, lead context (saved property IDs and email), current time, and the property-lookup results to a Google Gemini chat agent with Redis-backed conversation memory. Lets the agent optionally use tools to fetch additional property info from Google Sheets, update the lead’s email or interested property IDs in Google Sheets, and check or create viewing events in Google Calendar. S
Generate structured drama scripts from webhook requests using OpenAI and Google Sheets
Quick overview This workflow accepts a webhook request with a drama topic, genre, tone, and size constraints, uses Python-based genre classification plus OpenAI GPT‑4.1 to generate a full script as structured JSON, then returns the script to the caller and appends a summary log entry to Google Sheets. How it works Receives a POST webhook request containing the script topic, genre, tone, language, act count, and character count. Normalizes inputs by applying defaults, clamping acts to 1–5 and characters to 2–8, and adding request metadata like a request ID and timestamp. Classifies the genre in Python and prepares genre-specific guidance used to shape the script structure, then filters out requests marked as invalid. Sends the prepared parameters and genre guidance to OpenAI (GPT‑4.1) to generate a complete drama script as a single JSON object. Parses and validates the AI response as JSON, falls back to a safe wrapper if parsing fails, and enriches the result with counts for acts, scenes, and characters. Waits briefly and then returns the structured script to the webhook caller while also appending a summary row to a Google Sheets tab for tracking. Setup Configure the Webhook trigge
Send crowd safety SMS reroute alerts with OpenAI, Twilio, and Google Sheets
Quick overview This workflow ingests crowd density and incident reports via webhook or a 5‑minute schedule, assesses risk with Python thresholds, uses OpenAI to generate a short rerouting recommendation, then sends an SMS via Twilio and logs each alert to a Google Sheets heatmap tracker. How it works Triggers when a POST request hits the n8n webhook or every 5 minutes on a schedule. Normalizes incoming fields (location, crowd density, safety score, incidents, traveler contact, and preferences) and fills in defaults when values are missing. Calculates risk level in Python based on configurable thresholds for high density, incident count, and low safety score. Continues only for high-risk items and pauses briefly before the AI call. Uses OpenAI (via an AI agent) to generate a personalized rerouting suggestion under 150 words from the live data and traveler preferences. Sends the rerouting alert to the traveler via Twilio SMS and appends the alert details and reroute text to a Google Sheets log via the Google Sheets API. Setup Add an OpenAI API credential and select the model in the OpenAI Chat Model connection. Configure Twilio credentials (Account SID and Auth Token), replace YOUR_T
Handle theater ticket bookings with Anthropic, Google Sheets, SendGrid, and Twilio
Quick overview This workflow receives theater ticket booking requests via webhook, validates and normalizes them with Anthropic Claude, assigns seats and calculates pricing from a Google Sheets seat map, then logs the booking, sends confirmation via SendGrid email and Twilio SMS, and returns a confirmation JSON response. How it works Receives a booking request via an HTTP POST webhook and standardizes fields like show details, ticket count, and customer contact info. Uses Anthropic Claude to validate and normalize the booking request, then filters out requests with a low validation score. Retrieves the current SeatMap data from Google Sheets and assigns specific seat numbers if enough seats remain in the requested category. Calculates the final ticket total based on seat category pricing, bulk-discount rules, and tax. Uses Anthropic Claude to generate a personalized confirmation message, upsell line, and arrival instructions. Builds a final booking record (including a QR payload string), appends it to a Google Sheets tracker, sends the confirmation by SendGrid email and Twilio SMS, and responds to the webhook with the booking confirmation JSON. Setup Add an Anthropic API credential
Transcribe WhatsApp voice notes and auto-reply with OpenAI Whisper and GPT-4o
Quick overview This workflow receives WhatsApp Cloud API webhook events, transcribes incoming voice notes with OpenAI Whisper, generates a reply with OpenAI GPT-4o, and sends the response back to the sender via the WhatsApp Graph API while also handling plain text messages. How it works Receives WhatsApp webhook requests for verification (GET) and incoming messages (POST) from the Meta WhatsApp Cloud API. Validates the webhook verify token and returns the hub challenge to complete Meta webhook verification. Parses the inbound webhook payload to extract the sender number, phone number ID, message type, and either text content or an audio media ID. For voice notes, calls the WhatsApp Graph API to resolve the media ID to a temporary download URL, downloads the audio file, and transcribes it to text with OpenAI Whisper. For text messages, uses the incoming text directly as the user prompt. Sends the message text to OpenAI GPT-4o with a system prompt to generate a concise reply in the same language. Posts the generated reply back to the user using the WhatsApp Graph API messages endpoint and returns an OK response to the webhook. Setup Create a Meta app with WhatsApp Cloud API enabled,
Summarize Slack threads into Jira tickets with OpenRouter and Slack approval
Quick Overview This workflow turns a Slack slash-command request into an AI-drafted Jira ticket preview, then creates the Jira issue only after a user approves it in Slack using interactive buttons. How it works Receives a Slack slash command via a webhook and immediately responds with an ephemeral acknowledgement message. Reads configuration values (message count, Jira project key/type, and Slack context) and fetches recent messages from the Slack channel using the Slack conversations.history API. Cleans and formats the Slack messages into a chronological transcript, returning an error payload if no usable messages are found. Sends the transcript to an OpenRouter chat model (via an n8n AI agent) to generate a structured Jira ticket draft JSON. Parses the draft JSON and posts an ephemeral Slack preview containing the proposed title, type, priority, description, acceptance criteria, and Approve/Cancel buttons. Receives the Slack button interaction via a second webhook, parses the interaction payload, and either creates a Jira issue or cancels the request. Updates the Slack preview message to confirm ticket creation or show a cancellation notice. Setup Create a Slack app and configur
Generate sound effects from chat with Groq, ElevenLabs and Google Drive
Quick Overview This workflow turns an n8n Chat message into a generated sound effect using Groq (Llama 3.3) to refine the prompt, calls the ElevenLabs sound-generation API to create an MP3, uploads the file to Google Drive, and replies in chat with a shareable link. How it works Receives a message in an n8n Chat trigger containing the user’s description of a sound. Uses Groq (Llama 3.3) to rewrite the description into a single detailed ElevenLabs sound-effects prompt and choose duration and prompt-influence settings. Parses the model’s JSON response and clamps duration (0.5–30s) and prompt influence (0–1), falling back to the original message if parsing fails. Sends the prompt and settings to the ElevenLabs sound-generation API and downloads the generated MP3. Uploads the MP3 to Google Drive with a timestamped filename based on the prompt text. Responds in chat with the prompt used, the final settings, and a Google Drive link, or returns a friendly error message if generation fails. Setup Create an ElevenLabs API credential using HTTP Header Auth (header name xi-api-key) and select it on the ElevenLabs request. Add a Groq API credential and select it on the Groq Llama model node. C
Assist hospital doctors via Telegram with OpenAI, Google Sheets, Gmail and Slack
Quick overview This workflow combines a Telegram doctor bot, OpenAI, Google Sheets, Gmail, Slack, and a webhook to summarize PDF reports, generate and email discharge summaries, analyze lab values, report bed availability, send daily patient follow-ups, and post error alerts. How it works Runs every day at 9:00 AM to read patient records from Google Sheets, filter those due for follow-up today with a Pending status, send each patient a Telegram check-in, and mark the follow-up as Sent. Triggers when a doctor sends a Telegram message and routes it based on whether it includes a document or a supported command. If a PDF is attached, downloads it from Telegram, extracts the text, uses OpenAI (gpt-4o-mini) to create a short clinical summary, logs the result to a Google Sheets Reports tab, and replies to the doctor on Telegram. If the message starts with "/discharge PATIENTID", extracts the patient ID, looks up the patient in the Google Sheets Patients tab, uses OpenAI (gpt-4o-mini) to generate a discharge summary, saves it back to Google Sheets, emails it to the patient via Gmail, and confirms completion on Telegram. If the message starts with "/labs", sends the provided lab values to
Verify customs shipping documents with GPT-4o-mini, Gmail and Slack
Quick overview This workflow receives shipment document text via a webhook, uses OpenAI (GPT-4o-mini) to extract key fields from the Bill of Lading, cross-checks the extracted data against Invoice and Packing List fields, then emails a compliance verdict via Gmail and sends failure alerts to Slack. How it works Receives a POST request via webhook containing submitterEmail, shipmentRef, and the plain-text Commercial Invoice, Packing List, and Bill of Lading. Uses OpenAI (GPT-4o-mini) to extract structured Bill of Lading fields into JSON, and posts a Slack alert if the extraction fails. Compares key fields across the Invoice, Packing List, and Bill of Lading (for example consignee/shipper names, ports, package counts, gross weight, HS codes, quantities, and shipping marks) and calculates a verdict and discrepancy list. Emails a “READY_TO_FILE” report via Gmail when all checks pass. Emails a “NEEDS_CORRECTION” report via Gmail with detailed mismatch explanations and check IDs when discrepancies are found. Sends a Slack message when any workflow-level error occurs so issues are visible even if the run fails early. Setup Add an OpenAI credential and ensure the OpenAI node is configured
Send ranked freight quote PDFs with GPT-4o, Google Sheets, Gmail and PDFShift
Quick overview This workflow receives shipment requests via webhook, pulls carrier rate data from Google Sheets, uses OpenAI GPT-4o to generate a ranked HTML freight quote, converts it to a PDF with PDFShift, and emails the PDF to the customer via Gmail, with Slack alerts on workflow errors. How it works Receives a POST webhook request containing shipment details like origin, destination, weight, mode, and customer contact information. Reads rate information in parallel from three carrier tabs in a Google Sheets spreadsheet (BlueDart, DTDC, and Delhivery). Combines the carrier results and calculates per-carrier total cost based on the shipment weight. Sends the shipment and carrier data to OpenAI GPT-4o to generate a complete HTML quote page with a ranked comparison table. Converts the generated HTML into an A4 PDF file using the PDFShift API. Emails the PDF quote to the customer using Gmail with a prefilled subject and message. If the workflow fails, posts an error alert message to a Slack channel. Setup Configure the webhook path in n8n and copy the production webhook URL into the system that submits shipment requests. Add Google Sheets OAuth2 credentials and ensure the reference
Send daily short-form video ideas to Discord from Google News RSS with Claude
Quick overview This workflow runs daily, pulls the latest Google News RSS items for a keyword, uses Anthropic Claude to generate five short-form video hooks and scripts, then formats and posts the ideas to a Discord channel via a webhook. How it works Runs once per day on a schedule (default 7:00 AM). Fetches recent articles from a Google News RSS search feed. Deduplicates items, filters to stories published in the last 24 hours, and keeps the 15 newest with title, link, and summary. Sends the curated news list to Anthropic Claude to select five stories and generate a hook, angle, and 30–45 second script for each as strict JSON. Parses the JSON response and formats one or more Discord-ready messages, splitting to stay under Discord’s character limit. Posts the formatted content ideas to Discord using an incoming webhook. Setup Add an Anthropic API credential and select a model your account supports (the template uses claude-sonnet-4-6). Create a Discord incoming webhook for your target channel and replace the webhookUri value with your webhook URL. Update the Google News RSS URL query (q= parameter) to match your niche/keywords. Adjust the schedule time in the Schedule Trigger node
Validate invoice tax compliance from Gmail using Groq, Notion, and Google Sheets
Quick overview This workflow monitors a Gmail inbox for PDF invoices, uses Groq (Llama 3.3) to extract structured invoice fields, validates the invoice against Purchase Orders in Google Sheets and tax rules in Notion, logs an audit entry to Notion, and notifies Slack and the supplier based on pass/fail. How it works Triggers every minute when a new email arrives in Gmail and downloads the attached PDF invoice. Extracts text from the PDF and sends it to Groq (Llama 3.3) to parse invoice fields into a structured JSON schema, including SEZ/LUT detection. Looks up the referenced PO number in Google Sheets and fetches applicable tax rules from a Notion database. Validates the invoice against the PO (existence, approval status, currency, and total amount) and against Notion tax rules (SEZ/import/domestic matching and GST expectations). Writes the compliance result, matched rule, and any violations to a Notion “Compliance Audit Log” database. If the invoice passes, posts an approval message to Slack and archives the PDF to a Google Drive folder. If the invoice fails, posts a blocking alert to Slack and emails the supplier a rejection notice listing the violations. Setup Connect your Gmail
Predict supplier churn and generate retention plans with Notion, Slack, and Groq
Quick overview This workflow runs weekly to pull supplier activity from Notion, engineer churn-risk features, and use Groq-hosted LLM prompts to classify supplier churn risk and generate retention plans. It updates each supplier record in Notion and posts a Slack alert only when a supplier is rated High risk. How it works Runs every week on a schedule. Retrieves all supplier records from a Notion database. Calculates behavioral risk features such as PO trend, engagement score, and delivery/financial/contract-risk flags from the Notion fields. Processes suppliers one at a time and sends the features to a Groq LLM to return structured JSON with churn risk level, risk score, confidence, and key drivers. Sends the churn assessment to a second Groq LLM prompt to generate a structured retention plan with priority, recommended actions, suggested owner, and summary. If the supplier’s churn risk is High, posts a formatted alert with drivers and recommended actions to a Slack channel. Updates the supplier’s Notion page with the churn risk, risk score, key drivers, retention plan, and a “Last Evaluated” timestamp, then continues to the next supplier. Setup Connect your Notion credentials and
Review contract risk and rewrite clauses with Groq, Google Drive, Notion, and Slack
Quick overview This workflow watches a Google Drive folder for newly uploaded contract PDFs, extracts key clauses with Groq-hosted LLMs, compares them to standard clauses stored in Notion, generates a structured risk report and clause rewrites, sends a Slack alert for high-risk contracts, and saves the review to Notion. How it works Triggers when a new file is created in a specific Google Drive folder. Downloads the file and extracts text from it (using PDF text extraction when the uploaded file is a PDF). Uses a Groq-hosted LLM to extract key contract clauses (payment terms, penalties, SLA, termination, renewal, liability, and data protection) into structured JSON. Pulls the company’s standard clause library from Notion and compares each extracted vendor clause to the corresponding standard text. Uses a Groq-hosted LLM to generate a structured legal risk report with an overall risk level, executive summary, clause-by-clause risk review, missing protections, and negotiation recommendations. Rewrites medium- and high-risk clauses with a Groq-hosted LLM to produce negotiation-ready alternative wording aligned to the Notion standards. If the overall risk level is High, posts a formatt
Send weekly Salesforce sales behavior coaching reports with Groq and Gmail
Quick overview This scheduled workflow pulls last week’s Salesforce opportunities, tasks, and events for a specific rep, computes activity and pipeline health metrics, uses Groq (LLM) to generate coaching insights, creates a QuickChart performance chart URL, and emails a weekly behavioral report via Gmail. How it works Runs weekly on a schedule. Retrieves a target Salesforce user and queries that user’s opportunities with activity in the last week. Builds an Opportunity ID list, then pulls related Salesforce Tasks and Events and merges them into a single activity stream alongside the opportunities. Calculates per-opportunity engagement metrics (touches, calls, emails, follow-ups, meetings) and the days since last activity based on activity subjects and dates. Aggregates the opportunity metrics into per-rep totals including revenue, won/lost deals, and a stale-deal count based on activity gaps. Generates a QuickChart URL visualizing weekly activity versus outcomes and sends the rep metrics to Groq to produce structured coaching insights. Combines the chart and AI insights and sends an HTML weekly coaching email through Gmail. Setup Connect Salesforce OAuth2 credentials and set the S
Track meal nutrition from photos with LINE, Google Gemini and Google Sheets
Quick Overview This workflow receives meal photos via LINE, uses Google Gemini to estimate nutrition facts and generate advice, stores the photo in Google Drive, logs the results to Google Sheets, and replies to the user in LINE with a formatted analysis. How it works Receives a POST webhook event from LINE when a user sends a message. Checks whether the incoming LINE message contains an image and stops processing if it does not. Downloads the image content from the LINE Messaging API and sends it to Google Gemini to identify foods, estimate nutrition values, and generate health guidance. If the AI response indicates the image is not food, sends a LINE push message asking the user to submit a clearer meal photo. If the AI response is valid, parses the returned text into structured fields (food items, macros, calories, score, and advice) and calculates remaining calories based on a daily goal. Uploads the meal photo to Google Drive, appends the nutrition log (including the Drive image URL) to Google Sheets, and sends the formatted nutrition summary back to the user via LINE. Setup Create a LINE Messaging API channel, enable the webhook, and add the workflow’s webhook URL (the /MealT
Mask PII in hosted chat with OpenAI, Claude, and Saklam Bridge
Quick overview This workflow provides a public hosted chat that routes messages through the Saklam Bridge to mask PII on-premises before calling models like Claude, GPT, or Mistral, then restores the original values in the response. How it works Exposes a public hosted chat interface and receives each user message. Sends the message to an AI agent that uses an OpenAI-compatible chat model endpoint. Routes the model request through the self-hosted Saklam Bridge, which masks PII locally before forwarding the prompt to your chosen LLM provider. Receives the provider’s response back through Saklam Bridge, which unmasks the placeholders to restore the original PII. Returns the final unmasked answer to the hosted chat user. Setup Deploy the Saklam Bridge container in the same network as n8n and configure it with your Saklam license and your LLM provider API key. Create an OpenAI API credential in n8n that points its Base URL to your Saklam Bridge endpoint (for example, http://saklam-bridge:4000/v1) and uses the Bridge master key as the API key. Select that OpenAI credential in the chat model node and set the model name to the provider model you want to use (for example, claude-haiku-4-5,
Send daily brand mention digests to Slack with ScraperAPI and OpenAI
Quick Overview This workflow runs every morning at 8am, searches Google News for configured brand terms using ScraperAPI, stores previously seen article URLs in an n8n Data Table, summarizes the new coverage with OpenAI, and posts a daily brand-mention digest to a Slack channel. How it works Runs every day at 8am on a schedule. Sets the search terms, Google News country and time-period filters, and the target Slack channel. Creates (if needed) and reads an n8n Data Table of previously seen article URLs. Queries Google News via ScraperAPI for each search term and extracts article details from the responses. Deduplicates results against the seen-articles table and the current run, then stores new article URLs back into the Data Table. Groups new articles by brand, asks OpenAI to write a per-brand Slack-formatted summary, and posts the final digest message to Slack. Setup Add ScraperAPI credentials and ensure your ScraperAPI plan supports the Google News SDE endpoint used by the workflow. Add an OpenAI credential that can access the configured chat model (gpt-5-mini) or change the model selection to one available in your account. Add a Slack credential with permission to post messages
Re-engage dormant real estate leads with Google Sheets, Gemini and Gmail
Quick Overview This workflow runs daily to find dormant real estate leads in Google Sheets, uses Google Gemini to draft personalized winback emails, sends them via Gmail, updates the lead records, and then posts a run summary digest to Gmail and optionally to Slack. How it works Runs every day at 8am on a schedule. Pulls all lead records from a Google Sheets spreadsheet. Filters to leads that have an email address, are not marked “Do Not Contact,” and have not been contacted in at least 30 days. Processes each dormant lead in turn by prompting Google Gemini to generate a short re-engagement email subject and body based on the lead’s name, property interest, and days since last contact. Sends the generated message to the lead via Gmail and updates the corresponding row in Google Sheets (for example, tracking status and re-engagement attempt count). Aggregates the run results and sends a summary digest to a specified Gmail address and to a Slack channel. Setup Connect credentials for Google Sheets, Gmail, and Google Gemini (PaLM) API. Select the Google Sheets document and sheet name for both the lead fetch and lead update steps, and ensure your sheet includes fields like Email, Statu
Schedule weekly social media posts with OpenAI and PostFast
Quick overview This workflow runs every Monday to generate a week of social media posts with OpenAI, then schedules them at preselected high-reach time slots through PostFast for the social accounts you choose. How it works Runs every Monday morning on a schedule trigger. Loads your brand name, voice, topics, number of posts, and a platform filter for which networks to target. Fetches all connected social accounts from PostFast and keeps only accounts that are connected and match the chosen platforms. Uses OpenAI to write the requested number of posts in the defined brand voice and returns them as structured JSON. Assigns each post to the next available “best time” slot (UTC) and expands the plan so each post is scheduled for each selected PostFast account. Creates scheduled posts in PostFast with APPROVED status so they publish automatically at the assigned times. Setup Install and enable the PostFast community node (n8n-nodes-postfast) if your n8n instance does not already allow verified community nodes. Add a PostFast API key credential and connect the social accounts you want to schedule to in your PostFast dashboard. Add an OpenAI credential for the OpenAI node. Update the con
Run a Telegram productivity assistant with OpenRouter, Google Calendar, and Todoist
Quick overview This workflow turns Telegram into a personal assistant that manages your Google Calendar and Todoist, sends daily briefings, and alerts you when meetings are booked or things break. How it works Morning briefing - Every day at a set time, the workflow checks your Google Calendar for today's events and your Todoist for open tasks, then sends you two Telegram messages: a calendar rundown and a task summary grouped by project with priority flags. Cal.com booking alerts - When someone books, reschedules, or cancels a call on Cal.com, or a meeting ends, the workflow catches the webhook and sends you a Telegram notification with the attendee's name, email, meeting title, and time. Talk to your assistant on Telegram - Message the bot with text or a voice note. Voice notes get transcribed automatically. Your message goes to an AI agent that can read, create, update, or delete calendar events, and create, find, update, complete, or delete Todoist tasks, all through natural conversation. The agent replies back in the same chat. Error alerts - If any part of the workflow fails, you get a Telegram message with the failed node, the error, and a link to the execution, so you catch
Review stale Notion docs with Gmail alerts, Slack reports, and OpenAI
Quick overview This workflow runs every Friday to scan a Notion documentation database for pages not edited in 90+ days, marks them as “Needs review,” emails owners of critical stale docs via Gmail, and uses OpenAI to generate a prioritized weekly review plan that it posts to a Slack channel. How it works Runs every Friday at 10:00 on a schedule. Retrieves all pages from a selected Notion database and calculates how many days it has been since each page was last edited, along with its title, URL, owner email, and importance. Filters the list to only documentation pages that have been untouched for 90 days or more. Updates each stale page in Notion by setting its Status to “Needs review.” Sends a Gmail email to the page owner when the stale document is marked as Critical and an owner email is present. Aggregates all stale documents and sends them to OpenAI to draft a short, risk-ranked weekly docs review plan. Posts the generated review plan to a specified Slack channel. Setup Connect credentials for Notion, Gmail, OpenAI (Chat Model), and Slack. Select your target Notion database in the Notion “getAll” step and ensure it contains properties for Owner Email, Importance (Critical/Nor
Match packing list PDFs to purchase orders with docling-serve and Ollama
Quick overview This workflow checks an SFTP “pending” folder for packing list PDFs, converts them to OCR text with docling-serve, and uses Ollama (Gemma) to extract structured line items and match them to a purchase order, logging results and moving files to completed or error folders. How it works Runs every hour and lists files in the SFTP pending folder. Filters for PDFs, downloads each file from SFTP, and logs a PENDING status to an n8n Data Table. Uploads the PDF to docling-serve for OCR conversion (RapidOCR, English) and stops with an error status if conversion fails. Sends the converted Markdown text to an Ollama Gemma chat model to extract a normalized packing-list JSON (PO number, parties, and line items). Loads the matching purchase order data and cross-references PO vs packing-list SKUs and quantities to determine whether the document matches. If SKU count matches but SKU text differs, uses an Ollama-based healing step to detect likely OCR-misread SKUs, applies the corrections, and re-runs the cross-reference. Writes the final status (COMPLETED or ERROR) to the n8n Data Table and moves the PDF in SFTP into a folder named after the status (for example, completed/ or error
Triage and reply to email threads with GPT-5.2, IMAP, Gmail, and ESP suppression
Quick overview Automatically read inbound email replies, use AI to detect intent and sentiment, and send natural in-thread responses. Opt-out requests are confirmed, pushed to your ESP suppression list, and logged. A hands-off reply layer that keeps your sender reputation clean while every conversation gets fast, human-sounding answer. How it works An IMAP trigger watches your inbox and picks up new reply emails as they arrive. A filter keeps only genuine replies, and a code node strips quoted history and signatures, then parses the sender name, email, and threading headers. A code node builds a strict AI prompt with the cleaned message and your trigger-word hints. The OpenAI node classifies intent and sentiment and drafts a reply, returning strict JSON. A code node normalizes the response, enforces a clean email structure, and adds your CTA once. A switch routes on the unsubscribe flag: normal replies go back in-thread through Gmail, opt-outs get a neutral confirmation. Opt-outs are posted to your ESP suppression list, every action is logged to a data table, and Gmail labels are updated to mark the thread handled. Setup (5 steps): Add your IMAP credentials to the email trigger and