Send prescription PDFs to patients via WhatsApp with Google Gemini and Supabase
Quick overview This workflow listens for incoming WhatsApp messages from clinic staff, uses Google Gemini to extract prescription details, generates a prescription PDF via an HTML-to-PDF API, uploads it to a public URL, sends the document back over WhatsApp, and logs outcomes to Supabase. How it works Triggers whenever a new WhatsApp message is received on your WhatsApp Business Cloud number. Captures configuration values and the incoming message text and sender number. Uses Google Gemini to extract patient name, doctor name, and medication details into structured data and flags any missing required fields. If required details are missing, replies to staff on WhatsApp with what to fix and inserts a needs_review record into Supabase. If details are complete, renders a prescription HTML document, converts it to a PDF via an external HTML-to-PDF API, and uploads the PDF to an external file-hosting API. Sends the prescription PDF to the sender on WhatsApp and inserts a “sent” log record (including the PDF URL) into Supabase.
Tags
Related workflows
See all AI Automation→Scrape and score Amazon products with Apify, OpenAI, and Google Sheets
Quick overview This workflow manually scrapes product results from an Amazon search URL via the Apify Amazon Crawler actor, uses OpenAI to generate a structured product analysis (category, key feature, verdict, value score), and appends the enriched results to a Google Sheets spreadsheet. How it works Runs when you manually click “Test workflow” in n8n. Sends the configured Amazon search URL and scraping limits to the apify Amazon Crawler actor and retrieves the dataset items. Filters out any scraper items that are missing a title or contain an error. Uses OpenAI to analyze each product’s title, brand, price, rating, and review count and returns a structured category, key feature, buyer verdict, and 1–10 value score. Combines the scraped fields and AI analysis into a single row format and adds a timestamp. Appends each enriched product as a new row in Google Sheets. Setup Create an apify API token and add it as an HTTP Header Auth credential used by the Apify request. Add an OpenAI API key as an OpenAI credential and choose the model to use in the configuration. Connect a Google Sheets OAuth2 account and select the target spreadsheet, sheet tab, and columns for appending rows. Upda
Force AI to use a specific output format
This workflow is for anyone looking to automatically fetch, validate, and parse complex language-based queries into a structured format. Its unique capability lies in not only processing language but also fixing invalid outputs before structuring them. Note that to use this template, you need to be on n8n version 1.19.4 or later.
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