How to Schedule Shopify Product CSV Export to FTP

Automating Shopify product CSV exports can significantly affect how smoothly your business runs. It helps keep your inventory data up-to-date across all platforms, making multi-channel inventory management easier and more reliable. Plus, with accurate data, you can trust your reports and dive deeper into analytics to make smarter business decisions.

This tutorial will provide a step-by-step guide for using MESA to build a workflow that exports product data to a CSV file on an FTP server. In addition, it’ll cover everything you need to know and demonstrate how to update essential data points like inventory count, prices, cost of goods, and inventory location.

Automate product CSV exports to FTP—no coding needed. Get MESA and save time managing your Shopify products.

Step-by-Step Guide: Scheduling a Shopify product export workflow

Time needed: 15 minutes

Export product CSV Shopify files to an FTP server with this guide to simplify the process and automate inventory updates.

  1. Add the built-in tool Schedule

    Set a repeating schedule for your export workflow (daily, weekly, etc.).Add the built-in tool Schedule

  2. Next, add a new step, select the Shopify app, and select the Get List of Products action

    Select criteria to define which products are included in the export.Get list of products

  3. Add a Loop step

    Set the “Values to loop over” to iterate through the products from the previous step.Add a Loop step

  4. Inside the Loop, add another Loop step for variants

    Save your workflow to make the Loop variables accessible. Then, add a second Loop to filter out ‘default’ variants automatically added by Shopify.Add another Loop step for variants

  5. Now add a Shopify step and select the Retrieve Inventory Item action

    Because inventory data is managed separately from the product object, you need to extract the Inventory Item ID from the Variant data to access it.Add a Shopify step and select the Retrieve Inventory Item action

  6. Add another Shopify step and select the Get List of Inventory Levels action

    We’ll use the ID from the prior step to collect the inventory values for each Variant.Add another Shopify step and select the Get List of Inventory Levels action

  7. Use the built-in Code step

    We need to use a Custom Code step to generate the Location ID to capture where inventory is stored.
    Use the built-in Code Step

  8. Add a Shopify step and select Retrieve Location

    The value from the previous code step will be used to gather the location’s name for the file.
    Add a Shopify step and select Retrieve Location action

  9. Next, add a Transform Mapping step

    Organize product data fields (SKU, inventory count, cost of goods, etc.) into key/value pairs for the CSV file.
    Add a Transform Mapping step

  10. Configure the Variant Loop End 

    Now, we need to map the value returned as the {{transform}} variable.Configure Loop End variant

  11. Configure the Product Loop End 

    Lastly, we need to map the value returned as the {{loop_3}} variable. Configure the Product Loop End 

  12. Add the FTP step and select Save FTP file

    Make sure to set the file name to something specific like product-export_{{ “now” | date: “_%m_%d_%Y_%r” }}.csvAdd the FTP step and select Save FTP file

  13. Finally, select “Edit code” 

    Copy and paste the following code snippet, then click ‘Save Changes’ to complete the setup. Your workflow is now ready to run.

    const Mesa = require('vendor/Mesa.js');
    const Transform = require('vendor/Transform.js');

    /**
    * A Mesa Script exports a class with a script() method.
    */
    module.exports = new class {

    /**
    * Mesa Script
    *
    * @param {object} payload The payload data
    * @param {object} context Additional context about this task
    */

    script = (payload, context) => {
    // Adjust `payload` here to alter data before we transform it.

    // Alter the payload data based on our transform rules
    let csvRows = [];

    if (payload && payload.items) {
    payload.items.forEach((product) => {
    if (product.items) {
    product.items.map((variant) => {
    const { product_id, product_title, variant_id, variant_option1, variant_option2, variant_price, inventory_quantity, location } = variant;

    csvRows.push({
    product_id,
    product_title,
    variant_id,
    variant_option1,
    variant_option2,
    variant_price,
    inventory_quantity,
    location
    });
    });
    }
    });
    }

    // Adjust `output` here to alter data after we transform it.
    const csvOutput = Mesa.csv.encode(csvRows, true);

    // We're done, call the next step!
    Mesa.output.next(csvOutput);
    }
    }

    Select Edit Code and past in the code snippet

  14. Test, then turn “On”

    Give your workflow a test run to confirm it’s ready, then activate it to run automatically every hour.
    Test and turn on your workflow.

Automating product exports in Shopify significantly streamlines your store’s operations. Furthermore, by scheduling exports to an FTP server, you can efficiently manage inventory, reporting, and product updates with less effort and fewer errors.

This is particularly helpful if you work with multiple sales channels, need detailed analytics, or frequently adjust prices. Here are some key ways merchants use scheduled exports to improve efficiency:

Inventory Syncing with Third-Party Systems

Scheduled exports keep inventory data up-to-date across platforms, ensuring accurate stock levels and avoiding overselling. This is especially valuable for merchants selling on multiple channels or managing complex supply chains.

By automating updates with FTP feeds, you not only save time but also minimize errors, while additionally gaining real-time visibility into your inventory across Shopify and tools like ERPs or warehouse software.

Regular price and product data updates

Scheduling exports to an FTP server not only makes bulk product updates simple and efficient but also allows marketing teams to quickly update descriptions and metadata, thereby improving conversions and enhancing SEO.

It’s also great for managing dynamic pricing for promotions or market changes. As your products evolve, you can quickly adjust descriptions or specifications.

Conclusion

MESA’s product export automation empowers Shopify merchants to streamline operations and focus on growth. Whether reducing human errors, saving time, or ensuring your platforms and systems work together, MESA’s workflows will improve your operations.

With the right approach, automated exports mean your product data is always consistent, allowing you to focus on growth-driving activities like marketing, strategy, and delivering exceptional customer experiences.

Frequently asked questions

What are best practices?

Update your template regularly with relevant fields to maintain accurate data. Use standardized naming conventions across your product catalog for easy organization, and always back up your data before major changes.

How do you handle large inventories?

Segmenting exports into smaller, targeted groups, such as by category, SKU range, or location, makes managing large inventories easier. This helps keep file sizes manageable and data organized. Additionally, with MESA, you can customize the “Get List of Products” step to filter exports by availability, tags, and more, ensuring you export only the products you need.

How do I handle multiple exports from a single workflow run?

MESA’s built-in Paths tool allows you to create multiple exports from a single workflow run. This means you can automatically generate different CSV files for various inventory segments, such as separating exports by location or product type—all within the same scheduled workflow. This tailored approach saves time and helps you focus on the data that matters most.

What you should do now

Whenever you’re ready…here are 4 ways we can help you grow your business:

  1. Add MESA to your Shopify store. The best way to get started is by adding the MESA app from the Shopify App store. Every plan includes the first 7-days free so you can be assured your workflow is running properly.
  2. Browse pre-made templates. Our customizable workflow templates are a great way to get started more quickly.
  3. Talk to our automation experts. If you need help personalizing any workflow template, guidance how to make any automation or, simply want us to make your workflow, we can help.
  4. If you know another merchant who’d enjoy reading this page, share it with them via LinkedIn, YouTube, Twitter, or Facebook.

Accelerate your work with AI automation.

Try for free
background: abstract lines

Accelerate your work with AI automation.

Build AI agents in minutes that integrate, automate, and simplify your business.

Try MESA for free, 7-day trial included.