AI Agent workflows
518 results — all source-linked n8n references
Generate personalized email salutations for KlickTipp contacts with OpenAI
Quick Overview This workflow triggers when a contact is tagged in KlickTipp, uses OpenAI to generate an HTML-ready email salutation with a quality score, and updates the KlickTipp subscriber record with the salutation only when it meets a defined confidence threshold. How it works Triggers when a contact is tagged in KlickTipp and receives the contact’s profile fields (name, email, company, and address data). Sends the contact details to OpenAI to generate a JSON response containing an HTML-ready salutation plus language, style, and a salutation quality score. Parses and validates the OpenAI response against a structured JSON schema. Checks whether the generated salutation quality score is greater than 80. Updates the contact in KlickTipp by writing the generated salutation into a configured custom field when the score passes the threshold. Setup Add KlickTipp credentials and ensure the KlickTipp trigger for “contact tagged” is enabled for your account. Add an OpenAI API key for the chat model used to generate the salutation. In KlickTipp, create/identify the tag that should trigger this automation and configure it to call the n8n webhook URL from the trigger. Create a KlickTipp cu
Classify Salesforce deal complexity and notify sales with Groq and Slack
Quick overview This workflow monitors new Salesforce opportunities, enriches them with related contacts and products, uses Groq-hosted LLM analysis to classify deal complexity, then updates Salesforce with a processed flag, creates a follow-up task, and posts the outcome to a Slack channel. How it works Triggers when a new Opportunity is created in Salesforce. Retrieves Opportunity details and checks whether the opportunity has already been marked as processed. If it is already processed, posts a “no new opportunities” message to a Slack channel. If it is unprocessed, fetches related Salesforce Contacts for the Opportunity’s Account and OpportunityLineItem records for the Opportunity. Calculates simple deal metrics (stakeholder count, product count, and total product value) and sends them with Opportunity fields to a Groq LLM to classify complexity as Low/Medium/High with reasons and suggested actions. Parses the LLM’s JSON response, marks the Opportunity as Processed__c = true in Salesforce, creates a Salesforce Task containing the classification details, and sends a success notification to Slack. Setup Add Salesforce OAuth2 credentials and ensure your Opportunity object includes
Generate Salesforce opportunity next steps with Gemini and Slack
Quick Overview This workflow runs daily at 10:00 AM to find open Salesforce Opportunities with no Next Step, generates a recommended next action with Google Gemini, posts it to Slack, and updates the Opportunity’s Next Step field back in Salesforce. How it works Runs every day at 10:00 AM on a schedule trigger. Fetches all Salesforce Opportunities, reverses the list, and processes them in batches of 10. Retrieves key fields, filters to opportunities that are not Closed Won/Lost, have a close date on/after today, and have a blank Next Step. Builds a per-opportunity prompt containing the main deal details for an AI sales assistant. Processes opportunities one at a time and uses Google Gemini to generate a 1–2 sentence next-step recommendation. Posts the AI-generated recommendation to a specified Slack channel and updates the Opportunity’s Next Step field in Salesforce. Setup Connect Salesforce OAuth2 credentials with permission to read Opportunities and update the Opportunity Next Step field. Add Google Gemini (Google PaLM) API credentials for the Gemini chat model used by the agent. Add Slack credentials and select the channel where recommendations should be posted. Confirm your Sal
Schedule and manage pet clinic visits with WhatsApp, Gemini, and HighLevel
Quick overview Youtube Video: https://youtu.be/81QSPEr5Yio?si=4EeaBFVofW0dK2Z_ This workflow handles pet clinic appointment conversations over WhatsApp, using Google Gemini for replies, Redis for chat memory, and GoHighLevel (LeadConnector) to look up or create contacts, save visit notes, and book, cancel, or reschedule calendar appointments. How it works Triggers when a new WhatsApp message is received. Validates the sender and ignores unsupported message types. Searches GoHighLevel for an existing contact that matches the sender’s WhatsApp phone number. Uses Google Gemini with Redis chat history and the contact context to chat with the owner, capture the pet’s issue, and save it as notes in GoHighLevel. Fetches available GoHighLevel calendar free slots for the requested weekday date range and presents times to the user. Creates or updates the GoHighLevel contact if required, then books the selected appointment, or fetches upcoming appointments to cancel or reschedule when explicitly confirmed. Sends the assistant’s formatted response back to the owner via WhatsApp. Setup Connect WhatsApp Cloud API credentials for both the WhatsApp Trigger and WhatsApp send action, and set your Wh
Run a hotel WhatsApp concierge using Google Gemini and Google Sheets
Quick overview Youtube Video: https://youtu.be/q2vPN9eub1o?si=lSo4c0kQMNQd_Aad This workflow acts as a WhatsApp hotel concierge that looks up guest profiles, reservations, and open service requests in Google Sheets, consults a Google Docs amenities guide, and uses Google Gemini with Redis memory to reply and optionally create or update reservations and service requests. How it works Triggers when a WhatsApp message is received and continues only if the incoming message contains text. Looks up the guest by WhatsApp number in a Google Sheets “Guest Details” spreadsheet and checks whether Do Not Disturb (DND) is enabled. If the guest is not in DND, fetches the guest’s reservations and any incomplete service requests from Google Sheets. Determines whether the guest is new, currently checked in (based on today’s date between check-in and check-out), and whether any requests are pending, then packages this context for the assistant. Uses Google Gemini with Redis chat memory to generate a WhatsApp-ready reply, calling a Google Docs amenities document when answering policy/pricing/amenity questions. When appropriate, the assistant writes back to Google Sheets to create or update guest prof
Send multi-carrier shipping quotes via WhatsApp with Gemini and ShipEngine
Quick overview Youtube Video: https://youtu.be/jIGBUW_1Sx0?si=BNXzk95soO0Nefan This workflow responds to incoming WhatsApp messages, validates the sender in HighLevel, uses Google Gemini with Redis memory to collect shipment details, fetches multi-carrier rates from ShipEngine, applies a commission markup, logs the quote to Google Sheets, and sends the best options back via WhatsApp. How it works Triggers when a new WhatsApp message is received. Looks up the sender’s phone number in HighLevel and stops outreach if the contact is marked Do Not Disturb. Uses a Google Gemini-powered agent with Redis chat memory to collect and confirm shipment details, creating the contact in HighLevel if needed or marking them DND if they opt out. If shipment data collection is complete, requests shipping rates from the ShipEngine Rates API for the configured carriers. Calculates a commission markup, filters for valid rates, and selects the cheapest and fastest options to format a quote message. Appends the quote text and metadata to a Google Sheets spreadsheet and sends the quote back to the customer via WhatsApp. Setup Connect WhatsApp Business credentials for both the WhatsApp trigger and send acti
Answer HR policy and benefits questions with BambooHR, OpenAI and Supabase
Quick Overview This workflow ingests company policy PDFs from BambooHR into a Supabase vector database and provides an employee chat interface that answers policy and benefits questions using OpenAI, with an additional employee/department lookup powered by BambooHR employee data. How it works Starts a manual run to fetch files from BambooHR and keep only PDFs in the “Company Files” category. Downloads each selected PDF, splits it into chunks, generates OpenAI embeddings, and inserts the content into a Supabase vector table for retrieval. Exposes a chat trigger where employees submit questions to an HR assistant. Uses OpenAI with conversation memory and retrieves relevant policy content from the Supabase vector store to ground responses. When a question requires a contact person, looks up employee details in BambooHR by exact name or finds the most senior person in a requested department using an OpenAI-assisted department extraction and ranking step. Returns the final answer to the chat, including policy-based guidance and any retrieved employee contact details. Setup Add BambooHR credentials and ensure your policies/benefits PDFs are available in the BambooHR file category named “
Score and advance job applicants with Airtable, Google Workspace and GPT-4o
Quick Overview This workflow collects job applications via an n8n form, stores CVs in Google Drive, logs applicants in Airtable, and uses OpenAI to score CV-to-role fit. Shortlisted candidates receive an AI-generated questionnaire, a personalized Gmail outreach, an auto-booked Google Calendar phone screen, and saved screening questions. How it works Receives a job application through an n8n form submission, including applicant details and a PDF CV upload. Uploads the CV to Google Drive, builds a normalized applicant record (name, email, phone, experience, CV link), and creates an applicant entry in Airtable. Downloads the stored CV from Google Drive, extracts text from the PDF, and uses an OpenAI-powered agent to score the CV against the job description pulled from Airtable. Updates the applicant’s Airtable record as either “Interviewing” (score ≥ 0.7) or “No hire” (score < 0.7), including the numeric score and short reasoning. For shortlisted candidates, generates five interview questions with OpenAI, presents them in a follow-up n8n form, and saves the candidate’s responses back to Airtable. Uses OpenAI plus Airtable job/candidate context to draft a personalized outreach email, s
Answer HR and IT policy questions on Telegram with OpenAI and Postgres PGVector
Quick overview This workflow builds a searchable HR policy knowledge base from a PDF and runs a Telegram helpdesk bot that answers employee questions from that content, handling both text messages and voice notes via OpenAI transcription and retrieval from a Postgres PGVector vector store. How it works Manually runs once to download an HR policy PDF over HTTP and extract its text. Splits the extracted policy text into chunks, generates OpenAI embeddings, and inserts the vectors into a Postgres PGVector store. Triggers on new Telegram messages sent to your bot. Routes incoming Telegram updates by type, sending text directly to the assistant, transcribing voice messages with OpenAI, or replying that other formats are unsupported. Uses an OpenAI chat model with Postgres-backed chat memory and a PGVector retrieval tool to answer questions grounded in the stored policy content. Sends the final answer back to the user in Telegram. Setup Add an OpenAI API key for embeddings, chat completions, and audio transcription. Set up a Postgres database with the PGVector extension enabled and add the Postgres credentials for both the vector store and chat memory. Create a Telegram bot with BotFathe
Review Jira ticket quality with OpenRouter GPT and coaching comments
Quick overview This workflow triggers on new Jira Cloud issues (Story, Bug, or Task), uses OpenRouter (OpenAI model) to score ticket quality across five criteria, and posts an automated coaching comment back to Jira only when the ticket falls below a configurable threshold. How it works Triggers when a new Jira issue is created that matches the selected issue types (Story, Bug, Task). Sets a configurable quality score threshold used to decide whether the ticket needs feedback. Sends the ticket’s type, title, description, and reporter details to an OpenRouter-hosted OpenAI chat model to generate a structured quality evaluation JSON. Parses and validates the model response as JSON and extracts the normalized score, missing criteria, and coaching comment. Checks whether the normalized score is below the configured threshold. If the score is below threshold, adds a formatted coaching comment to the Jira issue; otherwise, it takes no action. Setup Add Jira Software Cloud credentials in n8n and ensure the Jira Trigger can receive issue-created events for your Jira Cloud site. Add an OpenRouter API credential for the OpenRouter chat model used to evaluate ticket quality. Set the SCORE_THR
Generate English–Polish vocabulary quizzes with Google Sheets and Groq
Quick overview Tool useful for any language exams. It is a chat-based workflow that uses Google Sheets in Structure English|your language that using free Groq model (Llama 3.3) generate lists of 10 words that you need to provide answer based on your while model helps How it works Receives a chat message as the trigger input. Checks whether the message contains the word “generate” to decide if it should create a new quiz set or continue the current session. When “generate” is included, reads vocabulary rows (English and your language columns) from a specified Google Sheets range. Randomly shuffles the rows, selects 10 pairs, and formats them as a clean list of {english, your-language} objects. Sends the user message and the selected word pairs to a Groq Llama 3.3 chat model that runs the quiz conversation. Uses a buffer memory window to keep recent chat context so the agent can track which words are answered and which still need guesses. Setup Connect Google Sheets OAuth credentials and set the correct spreadsheet URL, sheet name, and range that contains “English word” and “your language words” columns. Add Groq API credentials and confirm the selected model (llama-3.3-70b-versatile
Create blog drafts, images, and LinkedIn posts with Tavily, Gemini, and OpenAI
Quick overview This workflow receives a blog request via webhook, researches the topic with Tavily, generates a long-form HTML article using Google Gemini, creates two images via the kie.ai API, stores assets in Google Drive, updates a Google Sheets tracker, and notifies a Slack user with links. How it works Receives a POST webhook request containing a Google Sheets row payload with an “AI Blog Title” and related metadata. Searches the web for supporting sources using Tavily and passes the research plus the title to Google Gemini to generate the full article as HTML. Converts the generated content to HTML, creates a temporary HTML file in Google Drive, downloads it to set the correct text/html MIME type, re-uploads it as the final Drive file, and deletes the temporary file. Sends the finished article to OpenAI to generate a short LinkedIn post, then updates the matching row in Google Sheets with a Done flag, the article folder/link value, and the LinkedIn post text. Creates a cover image and an in-article infographic by submitting two text-to-image jobs to the kie.ai API, polling until each job succeeds, downloading each resulting image, and uploading both images to Google Drive. W
Qualify open house leads and send AI follow-ups with Google Sheets and Gmail
Quick overview When a visitor signs in at your open house, this workflow instantly scores their buying intent using Gemini AI, sends a personalized follow-up email via Gmail, logs every visitor to Google Sheets, and alerts the agent for hot leads only. How it works A visitor signs in via your Google Form at the open house. Their details — name, email, phone, budget, timeline, and buying intent — are captured automatically. AI (Gemini) scores them as Hot, Warm, or Cold based on their responses and drafts a personalized follow-up email in the same step. A tailored thank-you and next-step email sends immediately via Gmail. Every visitor is logged to Google Sheets with their score, reasoning, and message sent. If a lead scores Hot, the agent receives an instant notification email — and optionally a Slack alert — so they can prioritize personal outreach right away. Setup Connect credentials for Google Sheets (trigger and append), Google Gemini (PaLM API), and Gmail (to send visitor follow-ups and agent notifications). Set the Google Sheets Trigger document and sheet to your sign-in responses sheet, and map the expected column headers (Full Name, Email Address, Phone Number, property, bu
Scrape Tunisia IT job listings with Groq, Firecrawl, Airtable, and Resend
Quick overview This workflow runs daily or via chat to scrape Tunisia-focused IT job listings from predefined company career pages using Firecrawl, saves results into Airtable tables, and emails a daily digest through Resend, with job parsing and orchestration handled by a Groq-powered AI agent. How it works Triggers either on a daily 7AM schedule or when an n8n Chat message is received. On scheduled runs, rotates through a fixed list of companies, builds a prompt for the chosen company (including pagination rules), and sets the Airtable table name. Uses a Groq (Llama 3.3 70B) AI agent to decide which allowed career-page URLs to scrape and how to extract job listings into structured fields. Scrapes the requested career pages via the Firecrawl API and parses the returned main content into jobs with title, company, location, description, and URL. When saving is requested, uses Airtable’s API to check for the target table, create it if missing, and insert the job records. For scheduled runs, emails the AI-generated job digest to the configured recipient using the Resend API; otherwise it outputs the response for the chat session. Setup Add credentials and values for Firecrawl (API key
Run a multi-agent research and publishing pipeline with GPT-4o, Tavily and Notion
Quick overview Three specialized AI agents: Researcher, Writer, and Reviewer, collaborate autonomously to research a topic, draft content, and quality-check it through a self-correcting review loop with a circuit breaker. Approved content is published directly to Notion with full audit metadata. How it works A form submission captures the research topic, content format (blog post, exec summary, or LinkedIn post), target audience, and maximum revision cycles allowed before the circuit breaker fires. The Researcher Agent uses GPT-4o and Tavily Search to gather authoritative sources, extract key facts and contradictions, and produce a validated research brief. Search depth and result count are automatically scaled to the requested format. The Writer Agent receives the research brief and produces a structured draft in the correct format. On revision cycles it also receives the Reviewer's specific rejection notes and must address them directly. A Circuit Breaker sits between the Writer and Reviewer. If the number of Reviewer rejections reaches the user-defined maximum, the draft is force-approved and the pipeline proceeds to publishing without another LLM call. The Reviewer Agent evalua
Review workflow JSON for risks and best practices with Groq (Llama 3.3)
Quick overview This workflow exposes a webhook that accepts an exported n8n workflow JSON, runs static validation and risk checks, then uses Groq (Llama 3.3 70B) via an AI agent to return a structured JSON review with metrics, risks, and best-practice recommendations. How it works Receives a POST request via a webhook containing a workflow object with exported n8n workflow JSON. Validates the payload structure and analyzes the workflow to generate metrics and findings such as orphan nodes, dead ends, missing error handling, placeholder credentials, deprecated nodes, and documentation gaps. Routes valid analyses to a Groq-powered AI agent that explains each finding (why it matters, risk, business impact, and best-practice fix) and formats the response as structured JSON. Routes invalid or malformed inputs to a formatter that returns a consistent { success: false, error } JSON response. Responds to the original webhook request with the final JSON analysis. Setup Add a Groq API credential in the Groq Chat Model node. You can generate a free API key at console.groq.com if you don't have one yet. Activate the workflow and copy the webhook URL from the Webhook trigger. This is the endpoi
Enrich company records with social media URLs using Supabase and GPT-4o
Quick overview This workflow pulls companies from Supabase, uses an OpenAI (GPT-4o) agent to crawl each company website and collect social media profile URLs via HTTP requests and HTML parsing, and then writes the enriched company record (name, website, and social links) back to Supabase. How it works Runs manually and loads all company records from a Supabase companies_input table. Keeps only each company’s name and website fields and sends the website to an OpenAI (GPT-4o) agent. The agent fetches page text (HTML converted to Markdown) and extracts links from pages (anchor hrefs), following additional URLs as needed to find social profiles. The agent returns a structured JSON object of social media platforms and their profile URLs. The workflow combines the extracted social links with the original company name and website. Inserts the enriched record into the Supabase companies_output table. Setup Add a Supabase credential and set the correct workspace/project so the workflow can read from companies_input and write to companies_output. Add an OpenAI API key in the OpenAI Chat Model node (configured for GPT-4o). Ensure your input table contains name and website fields (or update t
Send portfolio risk reports from Google Sheets with OpenAI and Gmail
Quick overview This workflow collects a portfolio request via an n8n Form, loads holdings from Google Sheets, calculates portfolio risk and concentration metrics, generates an HTML risk narrative with OpenAI, then emails the full report via Gmail and appends an audit record back to Google Sheets. How it works Receives a portfolio analysis request from an n8n Form containing the investor details, base currency, and a Google Sheet ID. Reads all holdings from the provided Google Sheets document (Portfolio tab) and bundles the rows into a single portfolio dataset. Calculates market value, allocations, sector and asset-class breakdowns, P&L, concentration flags, and a 0–100 risk score. Sends the computed portfolio summary, breakdowns, risk flags, and holdings to OpenAI to generate a structured risk report in HTML. Builds a branded HTML email that includes the AI narrative plus sector and top-holdings tables and a concentration alert banner. Sends the HTML risk report to the investor via Gmail and appends a summary row to a Google Sheets “Analysis Log” audit sheet. Setup Create a Google Sheet with a tab named “Portfolio” and headers: ticker, company, sector, asset_class, quantity, avg_bu
Send weekly narrative client reports with Google Sheets, Claude, and Gmail
Quick overview This workflow runs every Friday at 9:00 AM, pulls active client status data from Google Sheets, uses Anthropic Claude to generate a narrative weekly report with structured HTML and plain text output, and sends the finished report to each client via Gmail. How it works Runs every Friday at 9:00 AM on a schedule trigger. Reads all client rows from a specified Google Sheets document. Filters out paused/inactive or incomplete rows, extracts any “Metric:” columns, and builds a reporting week label for each client. Sends each client’s normalized data to Anthropic Claude to write a 3–4 paragraph narrative report and return JSON containing an email subject plus HTML and plain-text bodies. Emails the generated HTML report to each client’s email address using Gmail. Setup Create a Google Sheet with the required columns (at minimum “Client Name” and “Client Email”) and optional “Status” plus any “Metric:” columns you want included. Add Google Sheets OAuth2 credentials in n8n and replace the placeholder Sheet ID in the Google Sheets read step. Add an Anthropic credential for the Claude chat model used to generate the structured report. Add Gmail OAuth2 credentials and confirm th
Score and route inbound leads with Claude, Airtable, Slack, and Gmail
Quick overview This workflow receives inbound form leads via a webhook, normalizes the submission, optionally scrapes the lead’s website with Jina AI Reader, and uses Anthropic Claude to score and summarize the lead. It logs results to Airtable, posts a Slack alert, and creates a Gmail draft for hot leads. How it works Receives a POST webhook when a new lead submission comes in and immediately returns a JSON receipt response. Normalizes the incoming payload (Typeform, Tally, JotForm, or custom JSON) into consistent lead fields like name, email, company, website, and message. If a website is provided, fetches up to 2,000 characters of page content using Jina AI Reader and attaches it to the lead. Sends the lead details and scraped content to Anthropic Claude to produce structured JSON including a score, tier (hot/warm/cold), red flags, an enriched summary, and a first-reply draft. Builds a formatted Slack message and prepares a complete lead record (including routing flags) from the AI output. Creates a new record in Airtable and posts the lead alert to a Slack channel. If the lead is classified as hot, creates a Gmail draft using the generated first-reply text. Setup Copy the webho
Turn Telegram into a French fitness coach with Claude, OpenAI and Google Sheets
Quick overview This workflow turns a Telegram chat into a French-speaking fitness and nutrition coach that can handle text or voice messages, use Anthropic for responses, log and read training/nutrition data in Google Sheets, and schedule workouts in Google Calendar. How it works Triggers when a new Telegram message is received. Detects whether the incoming message is a voice note and, if so, downloads it from Telegram and transcribes it with OpenAI. Normalizes the user message, chat ID, and current date fields for downstream processing. Uses an Anthropic chat model with short-term session memory to generate a coaching response and decide when to call tools. Reads from and writes to Google Sheets to fetch or update the user profile, log workouts and meals, retrieve daily nutrition totals, and create or update weekly training and nutrition plans. Optionally creates a workout event in Google Calendar when the user asks to schedule a session. Sends the generated response back to the user in Telegram. Setup Create and connect credentials for Telegram, Anthropic, OpenAI (for audio transcription), Google Sheets OAuth2, and Google Calendar OAuth2. Replace YOUR_SHEET_ID_HERE and select the
Create vertical AI videos from web articles with OpenAI, Seedance and Blotato
Quick overview This workflow accepts an article URL from Telegram, extracts the page text, uses OpenAI to generate a Seedance 2.0 video prompt plus platform-specific captions, creates a vertical video via the AtlasCloud Seedance API, then publishes it to TikTok, Instagram, and YouTube through Blotato and confirms back on Telegram. How it works Receives a message in Telegram containing a web article URL. Fetches the web page HTML, strips it to plain text, and truncates the extracted content for prompting. Uses OpenAI to turn the URL and extracted text into a Seedance 2.0 text-to-video prompt plus TikTok and Instagram captions and a YouTube title and description. Submits the generated prompt to the AtlasCloud Seedance 2.0 generateVideo API with the configured duration, resolution, and FPS. Polls the AtlasCloud prediction endpoint on a wait interval until the video status returns completed/succeeded. Publishes the resulting video URL to TikTok, Instagram, and YouTube via Blotato using the generated captions and YouTube metadata. Sends a Telegram confirmation message that includes the video title and the final video URL. Setup Create a Telegram bot with @BotFather, add Telegram credent
Triage telehealth appointments with GPT-4o-mini, Telegram, Google Calendar
Quick overview This workflow collects telehealth appointment details via an n8n Form, uses OpenAI (GPT-4o-mini) to score no-show risk, then sends Telegram reminders and confirmations and updates Google Calendar based on the patient’s response, with Slack alerts on workflow errors. How it works Receives a new appointment submission from an n8n Form with patient, appointment, and Telegram chat details. Sends the appointment data to OpenAI (GPT-4o-mini) to generate a 0–100 no-show risk score and explanation. Routes the flow based on the risk score, sending a single friendly Telegram reminder for low-risk patients. For high-risk patients, sends escalating Telegram reminders and a final message that waits for a confirmation or cancellation reply. If the patient cancels, creates a new “rescheduled” time slot in Google Calendar and sends the patient a Telegram reschedule acknowledgement. If the patient confirms, updates the existing Google Calendar event to note the confirmation and sends a Telegram confirmation message. If any step fails, posts an error notification to a Slack channel. Setup Add credentials for OpenAI (Chat), Telegram Bot, Google Calendar OAuth2, and Slack OAuth2 used fo
Score mortgage loan risk from Google Drive PDFs with OpenAI and Gmail
Quick overview This workflow monitors a Google Drive folder for new loan application PDFs, extracts text, and uses OpenAI (GPT-4o-mini) to structure applicant data, score risk, generate a lending summary, and produce an underwriting recommendation, then emails the final report via Gmail and posts Slack alerts on failures. How it works Triggers when a new PDF is created in a specified Google Drive folder. Downloads the PDF from Google Drive and extracts its text content. Uses OpenAI (GPT-4o-mini) to extract key applicant and loan fields into a validated JSON structure. Uses OpenAI (GPT-4o-mini) to calculate a risk score, risk level, approval confidence, and key findings in JSON. Uses OpenAI (GPT-4o-mini) to write a plain-text lending summary and then generate a final underwriting decision (approve/conditional approval/further review/decline) with reasoning and conditions. Assembles a single report from the extracted data, risk analysis, summary, and decision, and sends it to the loan officer via Gmail. If extraction or risk scoring fails, sends a Slack alert and retries by re-downloading the application PDF. Setup Connect Google Drive OAuth2 credentials and replace YOUR_GOOGLE_DRIVE