Skip to content
FlowHubFluxonLab
Gmail
Gmailfree

Send staged invoice payment reminders with Microsoft SQL and Gmail

by Prakash Softwareadapted from n8n official workflow galleryUpdated Aug 2026
RequiresGmailGmailHTMLHTMLMicrosoft SQLMicrosoft SQL
Share Post Share
ScDaily at 9 AMMSFetch Unpaid InvoicesFetch Unpaid In…IfHas Unpaid Invoices?Has Unpaid Invo…MeMerge All StagesDTCalculate Days Until DueCalculate Days …SwRoute to Reminder StageRoute to Remind…IfAlready Sent 7 Before?Already Sent 7 …SePrepare Email 7 BeforePrepare Email 7…Send Email 7 BeforeSend Email 7 Be…MSUpdate DB 7 BeforeUpdate DB 7 Bef…MSLog Audit 7 BeforeLog Audit 7 Bef…IfAlready Sent 3 Before?Already Sent 3 …SePrepare Email 3 BeforePrepare Email 3…Send Email 3 BeforeSend Email 3 Be…MSUpdate DB 3 BeforeUpdate DB 3 Bef…MSLog Audit 3 BeforeLog Audit 3 Bef…IfAlready Sent Due Today?Already Sent Du…SePrepare Email Due TodayPrepare Email D…Send Email Due TodaySend Email Due …MSUpdate DB Due TodayUpdate DB Due T…MSLog Audit Due TodayLog Audit Due T…IfAlready Sent 1 Overdue?Already Sent 1 …SePrepare Email 1 OverduePrepare Email 1…Send Email 1 OverdueSend Email 1 Ov…MSUpdate DB 1 OverdueUpdate DB 1 Ove…MSLog Audit 1 OverdueLog Audit 1 Ove…IfAlready Sent 7 Overdue?Already Sent 7 …SePrepare Email 7 OverduePrepare Email 7…Send Email 7 OverdueSend Email 7 Ov…MSUpdate DB 7 OverdueUpdate DB 7 Ove…MSLog Audit 7 OverdueLog Audit 7 Ove…IfAlready Sent 15 Overdue?Already Sent 15…SePrepare Email 15 OverduePrepare Email 1…Send Email 15 OverdueSend Email 15 O…MSUpdate DB 15 OverdueUpdate DB 15 Ov…MSLog Audit 15 OverdueLog Audit 15 Ov…SIProcess Each InvoiceProcess Each In…SeNo Invoices to ProcessNo Invoices to …AgAggregate SummaryAggregate Summa…SeGenerate Summary ReportGenerate Summar…HtCreate HTML ReportCreate HTML Rep…Send Summary to FinanceSend Summary to…
1/5
STEPS · 48
Runs on a schedule

Quick Overview This workflow runs daily at 9 AM to pull unpaid invoices from Microsoft SQL, send staged payment reminder emails via Gmail based on due date timing, update invoice status and an audit log in the database, and email an HTML summary report to the finance team. How it works Runs every day at 9 AM on a schedule. Queries a Microsoft SQL database for invoices with PaymentStatus = 'Unpaid' and checks whether any results are returned. For each unpaid invoice, calculates the number of days until the due date and routes it to the matching reminder window (7 days before, 3 days before, due today, 1 day overdue, 7 days overdue, or 15 days overdue). For invoices in each window, checks the current ReminderStage, composes the appropriate email content, and sends the reminder to the customer via Gmail. After each email is sent, updates the invoice record with the new ReminderStage and LastReminderDate and inserts a REMINDER_SENT entry into a Microsoft SQL AuditLog table. Merges all reminder results, aggregates them into a single list, generates an HTML summary report, and emails it to the finance address via Gmail.

Tags

n8nreference-onlygmailhtmlmicrosoft-sql
Connects
gmailGmailhtmlHTMLmicrosoftsqlMicrosoft SQL
CategoryGmail
Triggermanual
Complexityadvanced
Nodes42
AddedJul 2, 2026

Related workflows

See all Gmail
gmailhtmlW
free

Generate Logos and Images with Consistent Visual Styles using Imagen 3.0

This n8n template allows you to use AI to generate logos or images which mimic visual styles of other logos or images. The model used to generate the images is Google's Imagen 3.0. With this template, users will be able to automate design and marketing tasks such as creating variants of existing designs, remixing existing assets to validate different styles and explore a range of designs which would have been otherwise too expensive and time-consming previously. How it works A form trigger is used to capture the source image to reference styles from and a prompt for the target image to generate. The source image is passed to Gemini 2.0 to be analysed and its visual style and tone extracted as a detailed description. This visual style description is then combined with the user's initial target image prompt. This final prompt is given to Imagen 3.0 to generate the images. A quick webpage is put together with the generated images to present back to the user. If the user provided an email address, a copy of this HTML page will be sent. How to use Ensure the workflow is live to share the form publicly. The source image must be accessible to your n8n instance - either a public image of t

by Jimleuk
CgmailW
free

URL and IP lookups through Greynoise and VirusTotal

This n8n workflow serves as a powerful cybersecurity and threat intelligence tool to look up URLs or IP addresses through industry standard threat intelligence vendors. It starts with either a form submission or a webhook trigger, allowing users to input data, URLs or IPs that require analysis. The workflow then splits into two paths depending on whether the input data is an IP or URL. If an IP was given, it sets the ip variable to the IP; however if a URL was given the workflow will perform a DNS lookup using Google Public DNS and sets the ip variable based on the results from Google. The workflow then checks the obtained IP addresses against GreyNoise services, with one branch utilizing GreyNoise RIOT IP Lookup to assess IP reputation and association with known benign services, and the other using GreyNoise IP Context to evaluate potential threats. The results from both GreyNoise services are merged to create a comprehensive analysis which includes the IP, classification (benign, malicious, or unknown), IP location, tags to identify activity or malware, category, and trust level. In parallel, a VirusTotal scan is initiated for the URL/IP to identify if it is malicious. A 5-second

by n8n Team
CgmailsheetsW
free

Sync HubSpot Contacts with LinkedIn URLs, Detect Changes & Send Gmail Alerts

Automate CSV imports into HubSpot without the mess. Powered by n8n. Supercharged by Pollup AI. Who’s this for? This workflow is perfect for Ops-minded folks in Customer Success, Marketing, and Sales – especially if you’re juggling CSV lists, CRM updates, and team-wide reporting. Whether you're a CS ops lead syncing product usage, or a RevOps manager updating contact records, this will save you hours. 🧠 Why it matters Manually importing CSVs into HubSpot is a headache: ❌ Copy-paste errors ❌ Mismatched fields ❌ Wasted time formatting every upload This workflow does the heavy lifting for you: ✅ Pulls fields dynamically from your HubSpot instance ✅ Preps and maps CSV data in minutes ✅ Syncs with Google Sheets to keep your source of truth aligned 🔄 What the workflow actually does Pulls live field names from HubSpot’s API (no guesswork) Indexes and organizes your CSV for import Processes & transforms raw data (optional filters, cleanup, etc.) Dynamically maps CSV fields to HubSpot fields Executes the upload and logs results ⚙️ How to get started Prerequisites: HubSpot private app token Google Sheets API credentials Access to an n8n instance (cloud or self-hosted) Setup in 3 steps: Impo

by PollupAI