# Reroute delayed shipments with OpenAI and Google Sheets: n8n workflow

> Started by a clock, and works across Gmail, Google Sheets, Slack and Telegram. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/reroute-delayed-shipments-with-openai-and-google-sheets (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [Chat assistants](https://millionrounds.com/workflows?category=Chat+assistants#library)

# Reroute delayed shipments with OpenAI and Google Sheets

Started by a clock, and works across Gmail, Google Sheets, Slack and Telegram. It hands the judgement calls to OpenAI. 22 steps, 3 branches: 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%2Freroute-delayed-shipments-with-openai-and-google-sheets)

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

**3** Branches: places the flow splits

**0** Loops or waits

**4** Services it connects to

## The flow

Starts it 1 Model 1 Logic 10 Service 10

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

- 1 **Check Shipment Statuses** Schedule trigger *Starts it*
- 2 **Read Active Shipments** Google Sheets *Service*
- 3 **Detect Delays** Code *Logic*
- 4 **Build Delay Summary** Code *Logic*
- 5 **Any Delays Found?** If *Logic*
- 6 **Send Delay Summary** Telegram *Service*
- 7 **Split Delayed Shipments** Split Out *Logic*
- 8 **Get Alternate Routes** Http Request *Service*
- 9 **Analyze Reroute Options (AI)** Open Ai *Model*
- 10 **Parse AI Recommendation** Code *Logic*
- 11 **Requires Human Approval?** If *Logic*
- 12 **Request Reroute Approval** Slack *Service*
- 13 **Update Carrier Route** Http Request *Service*
- 14 **Approved?** If *Logic*
- 15 **Prepare Reroute Record** Set *Logic*
- 16 **Attach Approved Shipment Data** Code *Logic*
- 17 **Attach Rejected Shipment Data** Code *Logic*
- 18 **Update Shipment Record** Google Sheets *Service*
- 19 **Mark Escalated - Manual Review** Google Sheets *Service*
- 20 **Notify Customer - Shipment Rerouted** Gmail *Service*
- 21 **Notify Ops - Manual Review Needed** Slack *Service*
- 22 **Log Reroute - Ops Channel** Slack *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 22, with 3 branches
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Gmail, Google Sheets, Slack, Telegram
- **Model:** OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on a clock.

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 22 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 22 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%2Freroute-delayed-shipments-with-openai-and-google-sheets)
- **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)[Slack](https://millionrounds.com/workflows?service=Slack#library)[Telegram](https://millionrounds.com/workflows?service=Telegram#library)

## Workflows like it

Also chat assistants, with the same services where possible, closest in size first.

- [**AI agent - RAG Telegram chatbot n8n with OpenAI** 22 steps · calls a model · Google Drive, Supabase vectors](https://millionrounds.com/workflow/ai-agent-rag-telegram-chatbot-n8n-with-openai)
- [**AI-powered Telegram task assistant with Notion** 22 steps · calls a model · Notion, Telegram](https://millionrounds.com/workflow/ai-powered-telegram-task-assistant-with-notion)
- [**Audit browser and proxy fingerprint/IP integrity with OpenAI** 22 steps · calls a model · Google Sheets, Slack](https://millionrounds.com/workflow/audit-browser-and-proxy-fingerprint-ip-integrity-with-openai)
- [**Audit landing page conversions with DeepSeek and Google Sheets** 22 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/audit-landing-page-conversions-with-deepseek-and-google-shee)
- [**Create an AI knowledge base assistant with Ollama and PGVector** 22 steps · calls a model · Telegram](https://millionrounds.com/workflow/create-an-ai-knowledge-base-assistant-with-ollama-and-pgvect)
- [**Detect and remediate leaked secret on repo with GitHub and AWS** 22 steps · calls a model · Jira, Slack](https://millionrounds.com/workflow/detect-and-remediate-leaked-secret-on-repo-with-github-and-a)
