On this page
Key takeaways
- n8n suits business workflows that join several SaaS tools and need a human approval step, without the cost of a fully custom build.
- The value in our inventory build came from clear reorder rules and clean master data, not from the automation tool itself.
- Keeping a person in the loop for approval earned the trust of inventory managers and made the rollout smooth.
- LLMs are best added at the edges of a rules-based workflow, for explaining anomalies and drafting supplier emails, not for making the reorder decision.
- Design for change from day one: APIs get deprecated, vendors change and thresholds drift.
Workflow automation with n8n and AI works best when you automate a well-understood, repetitive decision, keep a human in the loop for approval, and add AI only where judgement or language is needed. In this case study we walk through a real build: a weekly n8n workflow that pulls sales and stock data for an e-commerce seller, calculates what to reorder, asks inventory managers to approve, and then emails manufacturers automatically. You will see the architecture, the reorder logic, what changed for the business, and where large language models can extend it.
What problem were we solving?
Our client is an e-commerce seller with a catalogue sold through Amazon. Every week, someone on the inventory team had to pull sales reports, check stock levels in more than one system, work out which products were running low, and then write to each manufacturer with a purchase request.
That process had three familiar problems:
- It was slow and manual. Skilled time went into copying numbers between reports and spreadsheets every week.
- It was error-prone. A missed SKU meant a stock-out; an over-cautious guess meant cash tied up in overstock.
- It depended on a few people. When the person who "knew the numbers" was on leave, reordering slipped.
None of this required a moonshot. The decision itself was already rule-based in people's heads. The opportunity was to make those rules explicit, run them on schedule and give the team a clean summary to approve. You can read the project summary on our automated inventory replenishment case study.
Why did we choose n8n for this workflow?
We looked at three options: a fully custom service, a simple no-code tool, and n8n. The table below summarises how we thought about it.
| Criterion | Custom code | Simple no-code tool | n8n |
|---|---|---|---|
| Multi-system integration | Full control | Limited to prebuilt connectors | Prebuilt nodes plus HTTP and code steps |
| Custom reorder calculations | Easy | Awkward | Easy with code nodes |
| Human approval step | Must be built | Basic | Supported with wait and webhook nodes |
| Hosting and data control | Your infrastructure | Vendor cloud | Self-hosted or cloud |
| Cost to change later | Developer time | Low, but hits limits fast | Low to moderate |
| Visibility for the business | Low | High | High, visual workflows |
n8n gave us the flexibility of code where we needed it, with a visual workflow the client's team could actually follow. It can also be self-hosted, which is worth considering when a workflow handles commercial data such as sales volumes and supplier pricing.
How does the n8n workflow work, step by step?
Here is the build at a high level. Each step is a group of nodes in n8n.
1. A weekly schedule trigger
The workflow starts on a weekly cron trigger. Weekly suited the client's buying rhythm and manufacturer lead times. Running daily would have created noise without changing decisions.
2. Pull weekly sales and inventory from Amazon
The first data step calls Amazon MWS to fetch the past week's sales and current Amazon inventory for every active SKU. This gives the workflow its demand signal: how many units of each product actually sold.
3. Get real-time stock from Borderless
Amazon's figures are not the whole picture. The workflow then calls the Borderless API for real-time stock levels, so the calculation reflects what is physically available rather than a stale snapshot.
4. Join with master data
Next, the workflow reads master data held in Google Sheets and a database. This is where the business rules live:
- SKU-level reorder thresholds and target cover
- Vendor mapping: which manufacturer supplies which SKU
- Manufacturer contact details
- Flags for discontinued or seasonal products
Keeping this in a sheet the inventory team can edit was a deliberate choice. They can change a threshold or switch a vendor without asking a developer.
5. Calculate what to reorder
A code node runs the reorder logic for every SKU (covered in detail below) and produces a list of products that need replenishing, with suggested quantities, grouped by manufacturer.
6. Send a summary for validation
Instead of emailing manufacturers straight away, the workflow sends a reorder summary email to the inventory managers. It lists each proposed order, the numbers behind it and a clear approve action. The workflow then waits.
7. Approval, then automatic manufacturer emails
Once a manager approves, n8n resumes and sends purchase request emails to each manufacturer automatically, one per vendor, with the relevant SKUs and quantities.
8. Slack notifications throughout
At key points (run started, summary sent, approval received, supplier emails dispatched, or an error) the workflow posts to a Slack channel. The team can see the state of the week's reorder without logging into anything.
What does the reorder logic look like?
The heart of the workflow is a small, transparent calculation. We deliberately avoided anything the team could not explain on a whiteboard.
For each SKU, the logic considers four inputs:
- Weekly sales velocity. Units sold in the recent period, which gives an expected weekly demand.
- SKU thresholds. The minimum stock level (and target cover) set in master data for that product.
- Available inventory. The combined stock from Amazon and Borderless, reflecting what can actually be sold.
- Vendor mapping. Which manufacturer to order from, so the output is grouped into ready-to-send orders.
In plain terms: if available stock will fall below the threshold given current sales velocity, the SKU is flagged, and the suggested quantity brings it back up to its target cover. SKUs flagged as discontinued are skipped.
Why not a machine learning forecast from day one? Because the client needed a working, trusted system quickly, and the rules already reflected how the team thought. A simple rule that people trust beats a clever model nobody will approve. Once the workflow has run for a few months, that history becomes the training data for a better forecast, if one is needed.
What changed for the business?
We only claim what we observed, and the outcomes here are operational rather than headline numbers.
- Far less manual monitoring. The inventory team no longer compiles reports by hand each week. They review a summary and approve.
- Lower stock-out and overstock risk. Every active SKU is checked against the same rules every week, so products no longer slip through the cracks, and orders are sized to demand rather than gut feel.
- Faster supplier communication. Approved orders go to manufacturers as soon as they are signed off, rather than waiting for someone to write emails.
- Better visibility. Slack updates mean managers know whether this week's reorder has run, been approved and been sent.
- Less key-person risk. The rules live in master data and the workflow, not in one person's head.
If you are measuring a project like this, useful KPIs are hours spent on reordering per week, stock-out incidents per month, days of inventory cover, and time from reorder decision to supplier email.
Where can AI and LLMs extend this workflow?
The current build is deliberately rules-based. That is a strength: it is predictable and auditable. But there are clear places where large language models (LLMs) add value without taking control of the core decision.
Demand anomaly explanations
When a SKU's sales jump or collapse week on week, the reorder suggestion changes sharply, and managers rightly ask why. An LLM step can take the recent sales series, stock changes and any notes (a promotion, a listing issue, a competitor out of stock) and write a two-line explanation next to the flagged item. The manager still decides; they just decide faster.
Supplier email drafting
Today the manufacturer emails follow a template. An LLM can draft more natural messages that reflect context: a rush request, a change in quantity versus last order, or a follow-up if a previous order has not been confirmed. The draft can still pass through the same approval step before sending.
Other sensible extensions
- Reading supplier replies. Classifying incoming emails as "confirmed", "delayed" or "needs attention" and posting a summary to Slack.
- Master data checks. Flagging SKUs with missing vendor mappings or thresholds that look out of line with sales history.
- Forecasting upgrade. Once enough history exists, replacing simple velocity with a forecast that accounts for seasonality, then comparing it with the rules-based suggestion before switching over.
n8n supports these patterns natively with AI and HTTP nodes, so the extensions sit inside the same workflow rather than a separate system.
What lessons can other leaders take from this build?
Here is a checklist we now use on any workflow automation project, drawn directly from this one.
- Automate a decision you already understand. If your team cannot write the rule down, automation will only speed up confusion.
- Fix master data first. Vendor mappings and thresholds drive every calculation. Clean data keeps the logic simple.
- Keep a human in the loop at the start. Approval builds trust. You can relax it later for low-risk, low-value orders once the numbers prove themselves.
- Make the rules editable by the business. A shared sheet or admin screen for thresholds avoids a developer ticket for every change.
- Notify where people already work. Slack updates did more for adoption than any dashboard would have.
- Plan for API change. Marketplace and logistics APIs evolve. Amazon, for example, has moved sellers from MWS to its Selling Partner API, so isolate each integration in its own set of nodes and expect to replace one without rebuilding the rest.
- Log everything. Store each run's inputs, suggestions and approvals. It makes debugging easy and becomes training data for future AI.
- Add AI at the edges, not the centre. Use LLMs to explain, draft and classify around a transparent core decision.
The broader point for CXOs: the biggest gains from automation usually come from ordinary, weekly processes that quietly consume skilled people's time. They are low-risk, easy to measure and a good first step before more ambitious AI work.
How P26 helps
P26 designs and builds workflow automations like this one for mid-size and enterprise teams, using n8n, custom code or a mix of both depending on what fits. We start by mapping the process and agreeing the business rules with the people who own them, then build, test and hand over a workflow your team can understand and adjust. Where AI adds real value, such as explaining anomalies or drafting communications, we add it with guardrails and human approval. Learn more on our business process automation page.
If there is a weekly process in your business that still runs on spreadsheets and email, it is probably a good candidate. Tell us about it and we will help you work out whether automation, AI or both make sense. Book a call.
Frequently asked questions
What is n8n used for in business automation?
n8n is a workflow automation platform that connects APIs, databases and SaaS tools through visual workflows with optional code steps. Businesses use it for scheduled data syncs, approval flows, notifications and, increasingly, workflows that call large language models.
Is n8n better than Zapier for complex workflows?
For multi-step workflows with branching logic, custom calculations and self-hosting needs, n8n is usually the stronger fit. Zapier is quicker for simple two- or three-step automations owned by non-technical teams.
Can AI make inventory reorder decisions on its own?
It can, but for most mid-size sellers we do not recommend starting there. A transparent rules-based calculation with human approval is easier to trust and audit, and AI adds more value by explaining anomalies and drafting communications around that decision.
How long does it take to build an n8n automation like this?
A workflow of this scope typically takes a few weeks, depending on API access, the state of your master data and how many edge cases the business needs handled. Most of the time goes into agreeing reorder rules and cleaning data, not building nodes.
- #n8n
- #workflow automation
- #inventory management
- #process automation
- #ai agents

