Skip to main content
Handles the remove portion of the attribute batch engine (createAndLinkProductAttributesToProductWorkflow). Rejects required attributes, dismisses the product’s value links for every listed attribute, detaches the mirror ProductOption for shared axis attributes, and runs deleteProductAttributesWorkflow for product-scoped (inline) attributes so their exclusive options are deleted too.

Usage

import { removeProductAttributesFromProductWorkflow } from "@mercurjs/core/workflows"

await removeProductAttributesFromProductWorkflow(container).run({
  input: {
    product_id: "prod_123",
    remove: ["pattr_color", "pattr_custom_size"],
  },
})

Input

product_id
string
required
The product to detach the attributes from.
remove
string[]
required
Ids of the attributes to detach; attributes with is_required: true cause the workflow to throw.
additional_data
object
Custom data passed through.

Result

result
void
No return value.