๐Ÿ”ฌ AI-driven inventory management with OpenAI forecasting & ERP integration

โšก 4,298 views ยท ๐Ÿ”ฌ Document Extraction & Analysis

Description

This n8n workflow automates the monitoring of warehouse inventory and sales velocity to predict demand, generate purchase orders automatically, send them to suppliers, and record all transactions in ERP and database systems. It uses AI-driven forecasting to ensure timely restocking while maintaining operational efficiency and minimizing stockouts or overstocking.


Key Features


Workflow Process

  1. Schedule Trigger

    • Runs every 6 hours to monitor stock and sales data.
    • Interval can be adjusted for higher or lower frequency checks.
  2. Fetch Current Inventory Data

    • Retrieves live inventory levels from the warehouse API endpoint.
    • Requires API credentials and optional GET/POST method setup.
  3. Fetch Sales Velocity

    • Pulls recent sales data for forecasting analysis.
    • Used later for AI-based trend prediction.
  4. Merge Inventory & Sales Data

    • Combines inventory and sales datasets into a unified JSON structure.
    • Prepares data for AI model input.
  5. AI Demand Forecasting

    • Sends merged data to OpenAI GPT for demand prediction.
    • Returns demand score, reorder need, and confidence levels.
  6. Parse AI Response

    • Extracts and structures forecast results.
    • Combines AI data with original inventory dataset.
  7. Filter: Reorder Needed

    • Identifies items flagged for reorder based on AI output.
    • Passes only reorder-required products to next steps.
  8. Create Purchase Order

    • Automatically creates a PO document with item details, quantity, and supplier information.
    • Calculates total cost and applies forecast-based reorder logic.
  9. Send PO to Supplier

    • Sends the generated purchase order to supplier API endpoints.
    • Includes response validation for order success/failure.
  10. Log to ERP System

    • Records confirmed purchase orders into ERP platforms (SAP, Oracle, Netsuite).
    • Includes timestamps and forecast metrics.
  11. Save to Database

    • Stores all PO data, supplier responses, and AI forecast metrics into PostgreSQL/MySQL tables.
    • Useful for long-term audit and analytics.
  12. Send Notification Email

    • Sends summary emails upon PO creation and logging.
    • Includes PO ID, supplier, cost, and demand reasoning.

Setup Instructions


Industries That Benefit

This automation is highly beneficial for:


Prerequisites


Modification Options


Explore More AI Workflows: Get in touch with us to build industry-grade n8n automations with predictive intelligence.

๐Ÿ”— Nodes Used

Send Email, HTTP Request, Postgres, Schedule Trigger, Filter, OpenAI

๐Ÿ“ฅ Import

Download workflow.json and import into n8n: Workflow menu โ†’ Import from File

๐Ÿ“– Importing guide ยท ๐Ÿ”‘ Credential setup