# Optimize fleet routes and anomaly alerts with OpenAI and Slack: n8n workflow

> Started by another system calling it, and works across Email, Postgres and Slack. It hands the judgement calls to OpenAI.

Source: https://millionrounds.com/workflow/optimize-fleet-routes-and-anomaly-alerts-with-openai-and-sla (Millionrounds; every figure on the page links to its filing or article)

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

# Optimize fleet routes and anomaly alerts with OpenAI and Slack

Started by another system calling it, and works across Email, Postgres and Slack. It hands the judgement calls to OpenAI. 28 steps, 2 branches, 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%2Foptimize-fleet-routes-and-anomaly-alerts-with-openai-and-sla)

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

**2** Branches: places the flow splits

**1** Loop or waits

**3** Services it connects to

## The flow

Starts it 3 Model 6 Logic 12 Service 7

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

- 1 **Telemetry Webhook Trigger** Webhook *Starts it*
- 2 **Scheduled Data Sync** Schedule trigger *Starts it*
- 3 **OpenAI GPT-4 Model** Lm Chat Open Ai *Model*
- 4 **Route Optimization Output Parser** Output Parser Structured *Model*
- 5 **OpenAI GPT-4 Model for Anomaly** Lm Chat Open Ai *Model*
- 6 **Anomaly Detection Output Parser** Output Parser Structured *Model*
- 7 **Workflow Configuration** Set *Logic*
- 8 **Merge Trigger Sources** Merge *Logic*
- 9 **Route Optimization Agent** Agent *Model*
- 10 **Anomaly Detection Agent** Agent *Model*
- 11 **Normalize Telemetry Data** Code *Logic*
- 12 **Apply Business Rules** Code *Logic*
- 13 **Validate Data Quality** Code *Logic*
- 14 **Route by Severity** Switch *Logic*
- 15 **Remove Duplicate Events** Remove Duplicates *Logic*
- 16 **Store Telemetry Records** Postgres *Service*
- 17 **Wait for Manual Review** Wait *Logic*
- 18 **Alert Critical Incidents** Slack *Service*
- 19 **Fetch Traffic & Weather Data** Http Request *Service*
- 20 **Merge Telemetry with External Data** Merge *Logic*
- 21 **Notify Dispatchers via Slack** Slack *Service*
- 22 **Store Incident Records** Postgres *Service*
- 23 **Prepare Customer Notification** Set *Logic*
- 24 **Generate Performance Report** Postgres *Service*
- 25 **Email Operations Team** Email Send *Service*
- 26 **Check if Re-routing Required** If *Logic*
- 27 **Respond to Webhook** Respond To Webhook *Starts it*
- 28 **Trigger Re-routing Action** Code *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 28, with 2 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Email, Postgres, Slack
- **Model:** OpenAI

## Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

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 28 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 28 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%2Foptimize-fleet-routes-and-anomaly-alerts-with-openai-and-sla)
- **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.

[Email](https://millionrounds.com/workflows?service=Email#library)[Postgres](https://millionrounds.com/workflows?service=Postgres#library)[Slack](https://millionrounds.com/workflows?service=Slack#library)

## Workflows like it

Also alerts and monitoring, with the same services where possible, closest in size first.

- [**Triage AWS security posture changes with Claude and Slack** 28 steps · calls a model · Email, Slack](https://millionrounds.com/workflow/triage-aws-security-posture-changes-with-claude-and-slack)
- [**Sync Android env config to Gradle files with GitHub and Slack** 28 steps · GitHub, Slack](https://millionrounds.com/workflow/sync-android-env-config-to-gradle-files-with-github-and-slac)
- [**Detect procurement fraud and monitor supplier compliance** 29 steps · calls a model · Email, Slack](https://millionrounds.com/workflow/detect-procurement-fraud-and-monitor-supplier-compliance)
- [**Match teacher substitutes and send notifications with OpenAI** 29 steps · calls a model · Gmail, Google Calendar](https://millionrounds.com/workflow/match-teacher-substitutes-and-send-notifications-with-openai)
- [**Monitor semiconductor board reliability with OpenAI and Slack** 29 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/monitor-semiconductor-board-reliability-with-openai-and-slac)
- [**Predict F1 Race Winners with OpenAI and Historical Data** 27 steps · calls a model · Google Sheets, Postgres](https://millionrounds.com/workflow/predict-f1-race-winners-with-openai-and-historical-data)
