Quick overview
This workflow collects multiple marketplace order export files and consolidates them into a monthly sales report with channel totals, product totals, and a cleaned order-line export, using n8n Forms for upload and n8n Data Tables to detect channels and store month-over-month history.
How it works
- Receives uploaded order export files (CSV/TSV/TXT/XLSX) and an optional report month through an n8n Form.
- Splits the uploaded files, detects each file’s type, and flags unsupported formats without stopping the run.
- Loads channel mapping rules from an n8n Data Table and matches each file to a sales channel based on its column headers.
- Reads all rows from recognized files and standardizes them into consistent order-line fields, then removes duplicate order lines across overlapping exports.
- Allocates order-level discounts, refunds, and fees across each order’s lines, converts amounts using the exchange rates in the workflow config, and calculates net sales.
- Keeps only valid lines for the report month (excluding cancelled orders and currencies without a configured rate) and either shows a no-orders explanation or builds summaries.
- Generates four XLSX files (channel summary with last-month comparison, product summary, cleaned order lines, and a file log), zips them, and returns the ZIP for download on the final form page.
Setup
- Run the “Set Up Tables” path once to create the n8n Data Tables used for channel detection (channel_mappings) and monthly history (sales_monthly_history).
- Update the Config values for report currency, exchangeRates, and whether to subtract fees from net sales.
- Add or adjust rows in the channel_mappings Data Table so each sales channel’s exports can be detected and mapped to the standard fields.
- Activate the workflow and use the n8n Form production URL to upload your monthly export files.