# AI-driven inventory management with OpenAI and ERP: n8n workflow

> Started by a clock, and works across Email and Postgres. It hands the judgement calls to OpenAI. 12 steps: a working afternoon to understand properly.

Source: https://millionrounds.com/workflow/ai-driven-inventory-management-with-openai-and-erp (Millionrounds; every figure on the page links to its filing or article)

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

# AI-driven inventory management with OpenAI and ERP

Started by a clock, and works across Email and Postgres. It hands the judgement calls to OpenAI. 12 steps: a working afternoon to understand properly.

Medium Calls a model: OpenAI

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fai-driven-inventory-management-with-openai-and-erp)

**12 steps** Medium: a working afternoon

**0** Branches: places the flow splits

**0** Loops or waits

**2** Services it connects to

## The flow

Starts it 1 Model 1 Logic 4 Service 6

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

- 1 **Schedule Trigger** Schedule trigger *Starts it*
- 2 **Fetch Current Inventory** Http Request *Service*
- 3 **Fetch Sales Velocity** Http Request *Service*
- 4 **Merge Inventory & Sales Data** Code *Logic*
- 5 **AI Demand Forecasting** Open Ai *Model*
- 6 **Parse AI Response** Code *Logic*
- 7 **Filter: Reorder Needed** Filter *Logic*
- 8 **Create Purchase Order** Code *Logic*
- 9 **Send PO to Supplier** Http Request *Service*
- 10 **Log to ERP System** Http Request *Service*
- 11 **Save to Database** Postgres *Service*
- 12 **Send Notification Email** Email Send *Service*

## How it's built

- **Starts on:** A clock
- **Steps:** 12
- **Size:** Medium: a working afternoon
- **Connects to:** Email, Postgres
- **Model:** OpenAI

## Questions

What does it need to run?

An n8n account, plus your own Email and Postgres 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?

Plan an afternoon. 12 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 12 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%2Fai-driven-inventory-management-with-openai-and-erp)
- **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)

## Workflows like it

Also data collection, with the same services where possible, closest in size first.

- [**AI Portfolio Risk Analyzer for Zerodha with Perplexity** 12 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/ai-portfolio-risk-analyzer-for-zerodha-with-perplexity)
- [**Automated employee attendance & salary deduction** 12 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/automated-employee-attendance-and-salary-deduction)
- [**Automate personalized email campaigns with Google Docs** 12 steps · Email, Google Docs](https://millionrounds.com/workflow/automate-personalized-email-campaigns-with-google-docs)
- [**Employee onboarding & offboarding with MySQL** 12 steps · Email, MySQL](https://millionrounds.com/workflow/employee-onboarding-and-offboarding-with-mysql)
- [**Track shipments with DHL and Delhivery APIs** 12 steps · Email, Google Sheets](https://millionrounds.com/workflow/track-shipments-with-dhl-and-delhivery-apis)
- [**AI agent that updates its own rules to modify behavior** 13 steps · calls a model · Google Sheets, Postgres](https://millionrounds.com/workflow/ai-agent-that-updates-its-own-rules-to-modify-behavior)
