Automation library · Chat assistants

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.

LargeCalls a model: OpenAI

22 stepsLarge: read it before trusting it with anything live
3Branches: places the flow splits
0Loops or waits
4Services it connects to

The flow

Starts it 1Model 1Logic 10Service 10

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

  1. 1Check Shipment StatusesSchedule triggerStarts it
  2. 2Read Active ShipmentsGoogle SheetsService
  3. 3Detect DelaysCodeLogic
  4. 4Build Delay SummaryCodeLogic
  5. 5Any Delays Found?IfLogic
  6. 6Send Delay SummaryTelegramService
  7. 7Split Delayed ShipmentsSplit OutLogic
  8. 8Get Alternate RoutesHttp RequestService
  9. 9Analyze Reroute Options (AI)Open AiModel
  10. 10Parse AI RecommendationCodeLogic
  11. 11Requires Human Approval?IfLogic
  12. 12Request Reroute ApprovalSlackService
  13. 13Update Carrier RouteHttp RequestService
  14. 14Approved?IfLogic
  15. 15Prepare Reroute RecordSetLogic
  16. 16Attach Approved Shipment DataCodeLogic
  17. 17Attach Rejected Shipment DataCodeLogic
  18. 18Update Shipment RecordGoogle SheetsService
  19. 19Mark Escalated - Manual ReviewGoogle SheetsService
  20. 20Notify Customer - Shipment ReroutedGmailService
  21. 21Notify Ops - Manual Review NeededSlackService
  22. 22Log Reroute - Ops ChannelSlackService

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.