# Validate shipments & generate freight documents with OpenAI: n8n workflow

> Started by a change in a Google Sheet, and works across Gmail, Google Drive and Google Sheets. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/validate-shipments-and-generate-freight-documents-with-opena (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Documents and files](https://millionrounds.com/workflows?category=Documents+and+files#library)

# Validate shipments & generate freight documents with OpenAI

Started by a change in a Google Sheet, and works across Gmail, Google Drive and Google Sheets. It hands the judgement calls to OpenAI. 17 steps, 1 branch, 1 loop or waits: a working afternoon to understand properly.

Medium Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fvalidate-shipments-and-generate-freight-documents-with-opena)

**17 steps** Medium: a working afternoon

**1** Branch: places the flow splits

**1** Loop or waits

**3** Services it connects to

## The flow

Starts it 1 Model 3 Logic 3 Service 10

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

- 1 **Google Sheets Trigger** Google Sheets trigger *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Structured Output Parser** Output Parser Structured *Model*
- 4 **Carrier Details** Google Sheets Tool *Service*
- 5 **Loop Over Items** Split In Batches *Logic*
- 6 **Validate Shipment details** Agent *Model*
- 7 **If Validate** If *Logic*
- 8 **Set Shipment Data** Code *Logic*
- 9 **Send Mismatch Items Details** Gmail *Service*
- 10 **PDF Generate** Http Request *Service*
- 11 **Update State** Google Sheets *Service*
- 12 **Get PDF** Extract From File *Service*
- 13 **Send Shipment PDF To Sender** Gmail *Service*
- 14 **Send Shipment PDF To Receiver** Gmail *Service*
- 15 **Download File** Http Request *Service*
- 16 **Upload file** Google Drive *Service*
- 17 **Append or update row in sheet** Google Sheets *Service*

## How it's built

- **Starts on:** A change in a Google Sheet
- **Steps:** 17, with 1 branch, 1 loop or waits
- **Size:** Medium: a working afternoon
- **Connects to:** Gmail, Google Drive, Google Sheets
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Gmail, Google Drive 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 a change in a Google Sheet.

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?

Plan an afternoon. 17 steps is enough that you should read each one before running it.

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 17 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%2Fvalidate-shipments-and-generate-freight-documents-with-opena)
- **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 Drive](https://millionrounds.com/workflows?service=Google+Drive#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)

## Workflows like it

Also documents and files, with the same services where possible, closest in size first.

- [**AI-powered Product Hunt data collection & translation** 17 steps · calls a model · Google Sheets](https://millionrounds.com/workflow/ai-powered-product-hunt-data-collection-and-translation)
- [**Aggregate & update documentation from Slack, Teams & GitHub** 17 steps · calls a model · GitHub, Gmail](https://millionrounds.com/workflow/aggregate-and-update-documentation-from-slack-teams-and-gith)
- [**Create an auto-journal from WhatsApp with Gemini** 17 steps · calls a model · Google Docs, Google Drive](https://millionrounds.com/workflow/create-an-auto-journal-from-whatsapp-with-gemini)
- [**Generate Anki flash cards for language learning** 17 steps · calls a model · Google Drive, Google Sheets](https://millionrounds.com/workflow/generate-anki-flash-cards-for-language-learning)
- [**OCR document processing from LINE/Gmail with OpenAI** 17 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/ocr-document-processing-from-line-gmail-with-openai)
- [**Automated n8n workflow backup to Google Drive** 17 steps · Google Drive](https://millionrounds.com/workflow/automated-n8n-workflow-backup-to-google-drive)
