# Automate demand forecasting & inventory ordering with MySQL: n8n workflow

> Started by a clock, and works across MySQL and Slack. 24 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Source: https://millionrounds.com/workflow/automate-demand-forecasting-and-inventory-ordering-with-mysq (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)

# Automate demand forecasting & inventory ordering with MySQL

Started by a clock, and works across MySQL and Slack. 24 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fautomate-demand-forecasting-and-inventory-ordering-with-mysq)

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

**2** Branches: places the flow splits

**1** Loop or waits

**2** Services it connects to

## The flow

Starts it 1 Logic 10 Service 13

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

- 1 **Run Daily at 03:00** Schedule trigger *Starts it*
- 2 **Fetch POS Data** Http Request *Service*
- 3 **Fetch Historical Sales** My Sql *Service*
- 4 **Fetch Weather Forecast** Http Request *Service*
- 5 **Fetch SNS Trends** Http Request *Service*
- 6 **Fetch Inventory Master** Http Request *Service*
- 7 **Merge Data 1** Merge *Logic*
- 8 **Merge Data 2** Merge *Logic*
- 9 **Format Prediction Dataset** Code *Logic*
- 10 **Call AI Prediction API** Http Request *Service*
- 11 **Calculate Stock Shortage** Code *Logic*
- 12 **Finalize Order Qty** Code *Logic*
- 13 **Check Order Necessity** If *Logic*
- 14 **Split by Product** Split In Batches *Logic*
- 15 **Get Quote Supplier A** Http Request *Service*
- 16 **Get Quote Supplier B** Http Request *Service*
- 17 **Get Quote Supplier C** Http Request *Service*
- 18 **Merge Quotes** Merge *Logic*
- 19 **Select Best Supplier** Code *Logic*
- 20 **Execute Auto Order** Http Request *Service*
- 21 **Update Inventory System** Http Request *Service*
- 22 **Save Order Log** My Sql *Service*
- 23 **Check Anomalies** If *Logic*
- 24 **Slack Anomaly Alert** Slack *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 24, with 2 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** MySQL, Slack
- **Model:** None. This is plumbing, not judgement

## Questions

What does it need to run?

An n8n account, plus your own MySQL and Slack accounts. You connect your own accounts after importing it; none are included.

What starts it?

It starts on a clock.

Does it use AI?

No. Every step is fixed logic or a call to a service, so it does the same thing every time.

How long does it take to set up?

Take your time. At 24 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 24 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%2Fautomate-demand-forecasting-and-inventory-ordering-with-mysq)
- **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.

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

## Workflows like it

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

- [**E-commerce Order Confirmation with Airtable and Gmail** 24 steps · Airtable, Gmail](https://millionrounds.com/workflow/e-commerce-order-confirmation-with-airtable-and-gmail)
- [**Resolve ecommerce order exceptions with Claude and Slack** 24 steps · Slack](https://millionrounds.com/workflow/resolve-ecommerce-order-exceptions-with-claude-and-slack)
- [**Triage warranty claims and issue RMAs with OpenAI and Shopify** 24 steps · calls a model · Airtable, Gmail](https://millionrounds.com/workflow/triage-warranty-claims-and-issue-rmas-with-openai-and-shopif)
- [**Manage inventory reorders with Google Sheets and Slack** 22 steps · Gmail, Google Sheets](https://millionrounds.com/workflow/manage-inventory-reorders-with-google-sheets-and-slack)
- [**Route ecommerce risk and inventory decisions with Claude** 26 steps · Postgres, Slack](https://millionrounds.com/workflow/route-ecommerce-risk-and-inventory-decisions-with-claude)
- [**Score Shopify customer churn risk and sync results** 22 steps · Gmail, Slack](https://millionrounds.com/workflow/score-shopify-customer-churn-risk-and-sync-results)
