Update Shopify Inventory from CSV Files On Your FTP Server

6 min setup
No coding required
Runs automatically

Manually updating inventory from supplier spreadsheets is tedious and error-prone — and falling behind means overselling products you don't actually have. This workflow watches your FTP server for CSV files and automatically syncs inventory quantities to the right Shopify variants by SKU, on an hourly schedule. No copying, no pasting, no catching up. Just accurate stock counts without the manual work.

ftp icon
Fetch CSV file from server
Loop over rows in CSV file
Retrieve Product Variant Details from SKU
Shopify logo icon
Set Inventory Level By Variant

Trusted by 1,000+ Shopify merchants — from solo operators to scaling brands.

Logo: GLDN Logo: MUD/WTR Logo: Bartesian Logo: Allure Logo: Made In Cookware

How it works

4 steps to automatically update your Shopify inventory levels whenever a new CSV file lands on your FTP server

ftp icon

Fetch CSV file from server

App connector: FTP • Time to complete: 2 minutes
Why this matters: This is what kicks off the entire workflow. Without a reliable trigger that reads your CSV correctly, no inventory updates happen downstream — so the file format and schedule you set here are foundational to everything else.

This step connects to your FTP server on an hourly schedule and reads the CSV file you specify. You'll configure two things: the file path (which supports wildcards to match files like inventory/Stock.csv) and whether the file should be moved after it's read. Your CSV must include at minimum a SKU column and an Inventory column — these are required for the workflow to function. Once the file is read, each row gets passed into the next step as individual records.

  • File path field: Enter the path to your CSV file (e.g., inventory/Stock*.csv)
  • Move file after reading: Leave this off unless you want the file removed from the server after each run
  • Schedule: Runs every hour by default — adjust in MESA if you need a different cadence

Loop over rows in CSV file

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: Your CSV likely has dozens or hundreds of SKUs — this step makes sure each row is processed individually rather than all at once, which prevents errors and keeps inventory updates accurate per product.

The Loop step iterates through every row in the CSV file fetched in Step 1, processing one SKU at a time. Each iteration carries that row's SKU and Inventory values forward into the next steps. No configuration is needed here — MESA automatically knows to loop over the CSV data from the trigger. If your CSV has 200 rows, this step runs the following steps 200 times.

Retrieve Product Variant Details from SKU

App connector: Code • Time to complete: 0 minutes (Auto-configured)
Why this matters: Shopify's inventory system works with variant IDs, not SKUs — this step bridges that gap by looking up the correct variant for each row, so the inventory update in the next step lands on the right product.

For each CSV row processed by the Loop, this step takes the SKU value and queries Shopify to find the matching product variant. It returns the variant's ID, which is required to set inventory in the next step. This lookup runs automatically using the SKU from each loop iteration — no configuration is needed. If a SKU in your CSV doesn't match any variant in Shopify, this step will surface an error for that row so you can identify mismatches.

Shopify logo icon

Set Inventory Level By Variant

App connector: Shopify • Time to complete: 2 minutes
Why this matters: This is where the actual inventory number gets written to Shopify. You need to specify the correct store location here — if the wrong location is selected, inventory will update in the wrong place and your stock counts won't reflect reality.

This step sets the available inventory quantity in Shopify for the variant retrieved in Step 3, using the inventory number from the corresponding CSV row. The variant ID is passed in automatically, but you must configure one field: your store's Location ID. To find your Location ID, go to Shopify Admin → Settings → Locations, select the correct location, and copy the ID from the URL. Make sure the location is enabled before saving.

  • Location ID field: Paste your Shopify location ID (e.g., 12345678)
  • Available quantity: Pulled automatically from the CSV's Inventory column

Ready to automatically update your Shopify inventory levels whenever a new CSV file lands on your FTP server

Get setup in 6 minutes.

Try this template →

Frequently asked questions

What happens if a SKU in the CSV doesn't exist in Shopify?

The custom code step logs that the SKU wasn't found and stops processing that row without updating anything. The workflow continues to the next CSV row. Check your MESA logs to see which SKUs failed to match if you suspect missing products.

Can I use this to update inventory at multiple locations?

This workflow updates inventory at a single location specified in the "Set Inventory Level" step. To update multiple locations, either run separate workflows configured for each location, or add a "Location" column to your CSV and modify the logic to use that value instead of a hardcoded location ID.

Does this workflow adjust inventory or set it to an absolute value?

The workflow uses Shopify's "set" endpoint, which sets inventory to the exact quantity from the CSV regardless of the current value. If your CSV says "10" and Shopify currently shows "15," it will change to "10." This ensures your CSV is always the source of truth but doesn't create an adjustment audit trail.

Make this template your own!

Customize this workflow even further:

Send a Slack or email summary after each sync
After the Loop End, add a Slack or email step that sends a summary message each time the workflow completes — including how many SKUs were processed and a timestamp. Useful for ops teams who want a daily confirmation that inventory is staying in sync without logging into Shopify to check.
Flag mismatched SKUs in a Google Sheet
Add a condition step after "Retrieve Product Variant Details from SKU" that checks whether a matching variant was found. If not, route those rows into a Google Sheets action that logs the unmatched SKU, the inventory value from the CSV, and the date — so you can catch and fix data discrepancies before they become stockout problems.
Run the sync on demand instead of hourly
Swap the hourly schedule for a manual trigger or a webhook so you control exactly when the sync runs — handy if your supplier sends files at irregular times or you only want updates to happen during business hours.
Archive processed files to a separate FTP folder
Enable the "move file" option on the trigger and pair it with an FTP action at the end of the workflow to move completed files into an /archive folder with a datestamp. This keeps your FTP server tidy and gives you a clean audit trail of every file that's been processed.

You're in good company

"MESA has been a game changer for us. And, if you ever get stuck, their support team is always super helpful."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
PetFriendly

"It's like Zapier but exactly designed for Shopify. I have been able to complete all the workflows that I've needed."

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Zailys

"The MESA team has been amazing at helping us set up our automations. We would highly recommend this app!"

  • Ico star
  • Ico star
  • Ico star
  • Ico star
  • Ico star
Rothy's

Ready to automatically update your Shopify inventory levels whenever a new CSV file lands on your FTP server?

7-day free trial • 6 min setup • Cancel anytime

Need help? Our automation experts will help you personalize this workflow for free. Contact support