Skip to main content

♻️ AI multi-stop planner for circular logistics with GPT-4o & Open Route API

Workflow preview

Workflow preview
100%
♻️ AI multi-stop planner for circular logistics with GPT-4o & Open Route API preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

Tags : AI Agent, Supply Chain, Logistics, Circular Economy, Route Planning, Transportation, GPS API Context Hi! I’m Samir — a Supply Chain Engineer and Data Scientist based...

Best for

  • Miscellaneous automation workflows
  • AI Summarization automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

n8n-nodes-base.gmailtrigger, @n8n/n8n-nodes-langchain.outputparserstructured, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.googlesheets, n8n-nodes-base.wait, n8n-nodes-base.httprequest, n8n-nodes-base.set, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Samir Saci.

Original n8n.io source

1.1 Workflow description

Title
♻️ AI multi-stop planner for circular logistics with GPT-4o & Open Route API
Workflow name
♻️ AI multi-stop planner for circular logistics with GPT-4o & Open Route API

Tags: AI Agent, Supply Chain, Logistics, Circular Economy, Route Planning, Transportation, GPS API

Context

Hi! I’m Samir — a Supply Chain Engineer and Data Scientist based in Paris, and founder of LogiGreen Consulting.

I help logistics teams reduce operational workload and errors by combining AI automation, route optimisation APIs, and workflow automation.

This workflow is part of a circular economy project, where stores return reusable packaging (bins, crates, containers) to a central warehouse.

> Let's create circular economies with AI-powered automation using n8n!

📬 For business inquiries, you can find me on LinkedIn

Who is this template for?

This workflow is designed for logistics teams participating in circular economy loops.

Let us imagine your transportation company receives this pickup request:

The two AI Agent nodes connected to Openroute Service API will process the information and reply with the detailed route plan.

The results include driving time and the optimal sequence of stops generated by the multi-stop optimization endpoint of the API.

How does it work?

This workflow automates the end-to-end processing of multi-stop pickup requests for reusable packaging:

  • 📨 Gmail Trigger listens for collection request emails
  • 🧠 AI Agent parses the email into structured data (store ID, address, date)
  • 📍 Each stop is geocoded into GPS coordinates
  • 🗺️ OpenRouteService optimizes the stop sequence using truck-specific routing
  • 📄 A second AI Agent formats a confirmation email in HTML with the ordered pickup plan
  • 📧 The reply is sent back with all details including duration and route

Steps:

  1. 💌 Trigger on a new Gmail message
  2. 🧠 Extract data using AI Agent (e.g., stores, addresses, times)
  3. 📑 Store raw and processed data in Google Sheets
  4. 📍 Enrich with GPS coordinates
  5. 🚚 Optimize route using OpenRouteService (truck profile)
  6. 📄 Format the confirmation using an AI Agent
  7. 📬 Send reply to requester with route and timing

What do I need to get started?

You’ll need:

  • A Gmail account to receive collection requests
  • A Google Sheet to store and review data
  • A free OpenRouteService API key
  • Access to OpenAI for using AI Agent nodes
  • Sample pickup request emails to test

Next Steps

🗒️ Use the sticky notes inside the n8n canvas to:

  • Plug in your Gmail and OpenRouteService credentials
  • Try with a sample store collection email
  • Validate the confirmation format and route accuracy

📺 Learn More with n8n Tutorials

Get hands-on experience with automation through my comprehensive n8n tutorial playlist, featuring 18+ complete, step-by-step videos and ready-to-use templates.

This template was built using n8n v1.93.0
Submitted: June 7, 2025

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - Gmail Trigger

Type / Role
n8n-nodes-base.gmailTrigger - gmailTrigger
Config choices
Version 1.2

Block 2 - Structured Output Parser

Type / Role
@n8n/n8n-nodes-langchain.outputParserStructured - outputParserStructured
Config choices
Version 1.2

Block 3 - AI Agent Parser

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 4 - Record Email Content

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 5 - 5 sec

Type / Role
n8n-nodes-base.wait - wait
Config choices
Version 1.1

Block 6 - Query Open Route API Pickup

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 7 - Save Pickup GPS

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 8 - GPS Pickup

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 9 - Collect Coordinates

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 10 - Request Open Route API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 11 - Collect Shipment Information

Type / Role
n8n-nodes-base.googleSheets - googleSheets
Config choices
Version 4.6

Block 12 - OpenAI Chat Model

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 13 - AI Agent Reply

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 14 - Reply

Type / Role
n8n-nodes-base.gmail - gmail
Config choices
Version 2.1

Block 15 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 16 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 17 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - OpenAI Chat Model2

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 19 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 20 - Loop Over Items

Type / Role
n8n-nodes-base.splitInBatches - splitInBatches
Config choices
Version 3

Block 21 - Split by Address

Type / Role
n8n-nodes-base.splitOut - splitOut
Config choices
Version 1

Block 22 - Extract Job

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 23 - Jobs Mapping

Type / Role
n8n-nodes-base.set - set
Config choices
Version 3.4

Block 24 - Format Jobs

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Showing the first 24 of 29 workflow blocks. Download the JSON for the full node graph.

3. Summary Table

Workflow ♻️ AI multi-stop planner for circular logistics with GPT-4o & Open Route API
Complexity advanced
Nodes 29
Categories Miscellaneous, AI Summarization
Author Samir Saci
Published 07 Jun 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4753/4753.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does ♻️ AI multi-stop planner for circular logistics with GPT-4o & Open Route API do?

Tags : AI Agent, Supply Chain, Logistics, Circular Economy, Route Planning, Transportation, GPS API Context Hi! I’m Samir — a Supply Chain Engineer and Data Scientist based...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Miscellaneous, AI Summarization use case.