Plan delivery routes from Notion orders with Nominatim and email

Go to Workflow
1 views
Built by Kevin Yu Kevin Yu
Created on June 07, 2026

Description

Quick Overview
This workflow collects delivery orders via an n8n form into a Notion database, then on a weekly schedule pulls pending orders, geocodes addresses with OpenStreetMap Nominatim, generates a nearest-neighbor route plan grouped by delivery day, and emails the plan as a text schedule.

How it works
Receives a new order submission through an n8n Form trigger.
Generates a unique order ID, normalizes the form fields (customer, address, totals, payment status), and saves the order as a new page in a Notion database with Status set to pending.
Runs on a cron schedule (Friday at 6pm) or manually to plan routes.
Fetches all Notion database pages where Status equals pending and converts Notion properties into a clean list of orders.
Geocodes each delivery address using the OpenStreetMap Nominatim API with a built-in rate limit.
Splits orders into Saturday and Sunday groups, orders stops using a nearest-neighbor distance heuristic, and formats a Markdown-like delivery plan that tags each stop as [PAID] or [COLLECT ON DELIVERY] and flags any geocoding failures.
Sends the formatted delivery plan by email using SMTP.

Setup
Create a Notion database with properties matching the workflow (Customer Name, Order ID, Phone, Address, Items, Total, Day, Paid, Notes, Status, Received At) and ensure the Day and Status select values include Saturday/Sunday and pending/done.
Create and connect a Notion integration to the database, then add the Notion API credential in n8n.
Replace YOUR_NOTION_DATABASE_ID_HERE in both Notion nodes with your database ID.
Add an SMTP credential, then set the From and To addresses in the email step to real recipients.
Copy the production URL from the Form trigger and share it as your order intake form.

Nodes Used (4)

Code
n8n-nodes-base.code
HTTP Request
n8n-nodes-base.httpRequest
Notion
n8n-nodes-base.notion
Send Email
n8n-nodes-base.emailSend