Quick overview
This workflow runs three times daily to download a stock CSV from an SFTP server, validate and transform the rows, sync inventory updates to GoHighLevel and iPaper via HTTP APIs, write an acknowledgement CSV back to SFTP, and email low-stock and validation-error alerts.
How it works
- Runs on a cron schedule at 06:00, 14:00, and 22:00.
- Lists the
/outbound/stock/ directory on an SFTP server, filters for .csv files, and downloads the matching stock file.
- Parses the CSV, validates required fields and numeric values, normalizes data types, and flags items with stock quantities of 10 or less.
- Sends a low-stock alert email when any items are flagged as critically low.
- Builds and emails a validation error report when any rows fail validation.
- Splits valid products into batches of 50 and updates GoHighLevel and iPaper in parallel via authenticated HTTP requests.
- Generates an acknowledgement CSV for the processed SKUs, uploads it to
/inbound/acknowledgements/ on SFTP, and logs a completion summary.
Setup
- Create and select an SFTP credential for the workflow’s SFTP list, download, and upload steps.
- Add HTTP header authentication credentials for the GoHighLevel and iPaper HTTP requests (GHL bearer token and iPaper API key).
- Set the environment variables
IPAPER_API_URL, GHL_BASE_URL, NOTIFY_FROM_EMAIL, and NOTIFY_TO_EMAIL in your n8n instance.
- Confirm the SFTP paths
/outbound/stock/ and /inbound/acknowledgements/ match your warehouse server’s directory structure and file naming conventions.
- Configure your SMTP/Email Send node settings in n8n so the low-stock and error-report emails can be delivered.