# AI agent for transportation orders management with OpenAI: n8n workflow

> Started by an arriving email, and works across Gmail and Google Sheets. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/ai-agent-for-transportation-orders-management-with-openai (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [E-commerce](https://millionrounds.com/workflows?category=E-commerce#library)

# AI agent for transportation orders management with OpenAI

Started by an arriving email, and works across Gmail and Google Sheets. It hands the judgement calls to OpenAI. 21 steps, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-agent-for-transportation-orders-management-with-openai)

**21 steps** Large: read it before trusting it with anything live

**0** Branches: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 1 Model 5 Logic 4 Service 11

The steps in the order they run, from what starts it.

- 1 **Gmail Trigger** Gmail trigger *Starts it*
- 2 **Structured Output Parser** Output Parser Structured *Model*
- 3 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 4 **OpenAI Chat Model2** Lm Chat Open Ai *Model*
- 5 **AI Agent Parser** Agent *Model*
- 6 **AI Agent Reply** Agent *Model*
- 7 **Collect Coordinates** Google Sheets *Service*
- 8 **Record Email Content** Google Sheets *Service*
- 9 **Collect Addresses** Google Sheets *Service*
- 10 **Collect Shipment Information** Google Sheets *Service*
- 11 **Reply** Gmail *Service*
- 12 **Request Open Route API** Http Request *Service*
- 13 **Query Open Route API Pickup** Http Request *Service*
- 14 **Query Open Route API Delivery** Http Request *Service*
- 15 **Driving Time & Distance** Set *Logic*
- 16 **GPS Pickup** Set *Logic*
- 17 **GPS Delivery** Set *Logic*
- 18 **Save Results** Google Sheets *Service*
- 19 **Save Pickup GPS** Google Sheets *Service*
- 20 **Save Delivery GPS** Google Sheets *Service*
- 21 **5 sec** Wait *Logic*

## How it's built

- **Starts on:** An arriving email
- **Steps:** 21, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail and Google Sheets accounts, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on an arriving email.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 21 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

**Before you run it**

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 21 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-agent-for-transportation-orders-management-with-openai)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[Gmail](https://millionrounds.com/workflows?service=Gmail#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)

## Workflows like it

Also e-commerce, with the same services where possible, closest in size first.

- [**AI-powered customer email support for e-commerce with Pinecone** 21 steps · calls a model · Gmail](https://millionrounds.com/workflow/ai-powered-customer-email-support-for-e-commerce-with-pineco)
- [**Monitor e-commerce price changes with Decodo Scraper** 21 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/monitor-e-commerce-price-changes-with-decodo-scraper)
- [**E-commerce bestseller video generator with Algolia** 21 steps · Gmail](https://millionrounds.com/workflow/e-commerce-bestseller-video-generator-with-algolia)
- [**Synchronizing WooCommerce inventory and creating products** 20 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/synchronizing-woocommerce-inventory-and-creating-products)
- [**3D Product Video Generator from 2D Image for E-Commerce Stores** 20 steps · Gmail, Google Drive](https://millionrounds.com/workflow/3d-product-video-generator-from-2d-image-for-e-commerce-stor)
- [**Automate inventory reordering and vendor bill approvals** 20 steps · Gmail, Slack](https://millionrounds.com/workflow/automate-inventory-reordering-and-vendor-bill-approvals)
