How it works

Follow these 8 simple steps to start syncing Shopify products and pricing to Salesforce automatically

Shopify logo icon

Product Updated

App connector: Shopify • Time to complete: 0 minutes (Auto-configured)
Why this matters: Without this trigger, the workflow has no way to know when you've made changes in Shopify, meaning your Salesforce catalog would fall out of sync with your actual inventory and pricing.

This trigger monitors your Shopify store and fires whenever you create or update a product. It captures the complete product data including title, description, variants, SKUs, barcodes, and pricing. Every field gets passed to the next steps so the workflow has all the information needed to update Salesforce. No configuration needed—this trigger works automatically once you activate the workflow.

Loop: Get product variants

App connector: Loop • Time to complete: 0 minutes (Auto-configured)
Why this matters: Products with multiple variants (like different sizes or colors) need separate Salesforce records for each variant, and without this loop, only one variant would sync while the others get ignored.

This step processes each product variant individually by iterating through the variants array from the trigger. The loop creates a separate task for every variant, which means a shirt with small, medium, and large sizes generates three parallel processes. Each iteration passes the variant-specific data (like individual SKU, barcode, and price) forward to create distinct Salesforce records. This ensures your sales team can track and quote each variant independently.

Query Single Product

App connector: Salesforce • Time to complete: 2 minutes
Why this matters: Salesforce doesn't allow duplicate products with the same Shopify Variant ID, so the workflow needs to know whether to create a new record or update an existing one.

This step searches your Salesforce Product2 records to find any product that already has the current Shopify variant ID stored in a custom field. The query returns the Salesforce Product ID if a match exists, or returns empty if this is a new product. The workflow uses this ID in the next step to determine whether to POST (create) or PATCH (update) the product record.

You need to set up a custom field in Salesforce called "Shopify_Variant_ID__c" on the Product2 object before this workflow can run successfully. Your Salesforce admin can create this as a text field with external ID enabled.

Mapping to Salesforce: Create or Update Product

App connector: Transform • Time to complete: 0 minutes (Auto-configured)
Why this matters: Shopify and Salesforce use different field names and data structures, so this transform step translates between the two systems to prevent data from landing in the wrong fields or getting lost entirely.

This transform maps Shopify product data to Salesforce Product2 fields. It takes the product title from Shopify and places it in the Name field, moves the SKU to StockKeepingUnit, maps the barcode to ProductCode, and passes the description as-is. The transform also creates a combined title by appending the variant name to the product name (unless the variant is "Default Title"). All products get marked as active automatically.

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

module.exports = new class {
  script = (payload, context) => {
    // Set the title for the Salesforce Product
    context.steps.loop.combined_title = context.steps['shopify-product-created-or-updated'].title;

    // If product variant has a title other than 'Default Title', append to the Salesforce Product Name
    if (context.steps.loop.title !== 'Default Title') {
      context.steps.loop.combined_title += ' - ' + context.steps.loop.title;
    }

    // Alter the payload data based on our transform rules
    const output = Transform.convert(context, payload);

    // If the 'Salesforce: Query Product' Output found an existing product ID, pass this to the next output so the product is updated
    if (payload && payload.Id) {
      output.id = payload.Id;
    }

    Mesa.output.next(output);
  }
}

This code checks whether a Salesforce Product ID was found in the previous query step and includes it in the output if it exists, which tells the next step to update rather than create.

Create or Update Product

App connector: Salesforce • Time to complete: 0 minutes (Auto-configured)
Why this matters: This is where your Shopify product data actually lands in Salesforce—if this step fails, your sales team works with outdated product information that could lead to incorrect quotes or lost deals.

This step sends the transformed product data to Salesforce and either creates a new Product2 record or updates an existing one based on whether the query step found a matching ID. When creating new products, Salesforce generates a unique ID automatically. When updating, the workflow preserves the existing ID and only modifies the fields included in the mapping. After completion, this step outputs the Salesforce Product ID for use in the pricebook entry steps.

Query Single Pricebook Entry

App connector: Salesforce • Time to complete: 0 minutes (Auto-configured)
Why this matters: Salesforce requires products to have Pricebook Entries before sales reps can add them to opportunities, and without checking for existing entries first, you'd create duplicates that break your pricing structure.

This step searches for an existing PricebookEntry record linked to the Product ID created in the previous step. The query looks specifically at the standard pricebook and returns the entry ID if one already exists. If no entry is found, the query returns empty and signals the workflow to create a new entry. This prevents the common error where products exist but can't be added to opportunities because they're missing pricebook entries.

Mapping to Salesforce: Create or Update Pricebook Entry

App connector: Transform • Time to complete: 2 minutes
Why this matters: Pricebook entries and product records have different update rules in Salesforce—you can change prices on existing entries but can't reassign which product they belong to, so this transform needs different logic for creates vs. updates.

This transform maps the variant price from Shopify to the Salesforce UnitPrice field and links it to the product created earlier. For new pricebook entries, it includes the Product2Id to establish the relationship. For updates to existing entries, it removes the Product2Id field because Salesforce doesn't allow changing which product an entry belongs to. You'll need to fill in the Pricebook2Id field with your Salesforce standard pricebook ID (usually found in Salesforce Setup under "Pricebooks").

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

module.exports = new class {
  script = (payload, context) => {
    // Alter the payload data based on our transform rules
    const output = Transform.convert(context, payload);

    // Remove Product2Id field - this cannot be updated on an existing pricebook entry
    if (payload && payload.Id) {
      output.id = payload.Id;
      delete output.Product2Id;
    }

    Mesa.output.next(output);
  }
}

This code detects whether a pricebook entry already exists and removes the Product2Id field for updates while keeping it for new entries.

salesforce logo icon

Create or Update Pricebook Entry

App connector: Salesforce • Time to complete: 0 minutes (Auto-configured)
Why this matters: Without pricebook entries, your sales team literally cannot add products to opportunities in Salesforce, which means this seemingly technical step is actually what makes your products sellable in your CRM.

This final step creates a new pricebook entry or updates the existing one with current pricing from Shopify. When creating entries, it links them to both the product and the standard pricebook. When updating, it only modifies the price and active status. After this step completes, your product appears in Salesforce with accurate pricing and can be added to opportunities immediately. The workflow outputs the pricebook entry ID for reference.

Make it your own

Customize this workflow even further:

Add product tags for categorization
Include a mapping step that syncs Shopify product tags to Salesforce custom fields, so your sales team can filter and search products by collection, season, or any other tag you use for organization.
Send notifications for high-value products
Add a Filter step that checks the product price, then use the Email action to alert your sales manager whenever a product over a certain threshold gets added or updated, keeping them informed about premium inventory.
Sync inventory levels to Salesforce
Extend this workflow with additional steps that pull Shopify inventory data and update custom fields on the Salesforce product record, giving your sales team real-time stock visibility during the quoting process.
Track product changes in Slack
Add a Slack notification step after the product update that posts product name and price changes to a dedicated channel, creating a transparent audit trail your team can reference.

Frequently asked questions

What happens if I update a product variant's price in Shopify?
The workflow catches the update and immediately syncs the new price to the corresponding Pricebook Entry in Salesforce, so your sales team quotes the current price. If you change a product from $50 to $45, the Salesforce pricebook reflects $45 within seconds of you saving the change in Shopify.
Does this sync product images to Salesforce?
No, this template focuses on product names, SKUs, descriptions, and pricing data. Salesforce doesn't have standard image fields on Product2 records, so you'd need custom fields and additional workflow steps to handle images. Most teams link to their Shopify product pages instead.
What's the Pricebook2Id and where do I find it?
The Pricebook2Id is Salesforce's unique identifier for your standard pricebook. Go to Setup > Search "Price Books" > Open your Standard Price Book > Look at the URL, and the 18-character ID after "/Pricebook2/" is what you need. It usually starts with "01s" and you only need to set this once.
What is a template?
Templates are pre-made workflows by our team of experts. Instead of building a workflow from scratch, these have all the steps needed to complete the task.
Can I personalize a template?
Yes! Every step can be customized to meet your exact requirements. Additionally, you can even add more steps and make it more sophisticated.
Are templates free?
Yes! Our entire library containing hundreds of templates are free to use and customize to your exact needs.

Ready to start syncing Shopify products and pricing to Salesforce automatically?

Join thousands who've automated their work and saved an average of 3.5 hours every week.

Start with this template — It's free
7-day free trial • 10 min setup • Cancel anytime