π€ Upsert and merchandise Medusa products from a PIM via webhook and Admin API
β‘ 2 views Β· π€ CRM & Sales Operations
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-medusaand create a Medusa Admin API credential in n8n. - Ensure your source system (PIM) can POST to the webhook and include the required fields, especially
handlepluscategory_id,collection_id, andsales_channel_idfrom your Medusa store. - Copy the webhook URL from n8n and configure it in your PIMβs outbound webhook settings.
π Nodes Used
Webhook
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File