Upsert and merchandise Medusa products from a PIM via webhook and Admin API

Go to Workflow
0 views
Built by Black Swamp AI Black Swamp AI
Created on August 20, 2026

Description

Quick overview
This workflow receives a product-launch webhook from a PIM, upserts the product in Medusa by handle, assigns it to a category and collection, publishes it to a sales channel, and returns a JSON response describing the action taken.

How it works
Receives a POST webhook request containing product details, pricing, and destination merchandising IDs.
Validates and normalizes required fields (including handle, SKU, currency, amount, category, collection, and sales channel).
Searches Medusa for an existing product with the same handle.
Updates the existing Medusa product’s core fields if found, or creates a new Medusa product with an initial priced variant if not.
Adds the product to the specified Medusa product category and product collection, then publishes it to the specified Medusa sales channel.
Returns a JSON response indicating whether the product was created or updated along with the product and destination IDs.

Setup
Install the community node package @blackswampai/n8n-nodes-medusa and create a Medusa Admin API credential in n8n.
Ensure your source system (PIM) can POST to the webhook and include the required fields, especially handle plus category_id, collection_id, and sales_channel_id from your Medusa store.
Copy the webhook URL from n8n and configure it in your PIM’s outbound webhook settings.

Nodes Used (1)

Code
n8n-nodes-base.code