- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
Menu
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
batchProductVariantsWorkflow - Medusa Core Workflows Reference
This documentation provides a reference to the batchProductVariantsWorkflow
. It belongs to the @medusajs/medusa/core-flows
package.
This workflow creates, updates, and deletes product variants. It's used by the Manage Variants in a Product Admin API Route.
You can use this workflow within your own customizations or custom workflows to manage the variants of a product. You can also use this within a seed script or in a custom import script.
Source CodeExamples#
Steps#
Workflow Hook
Step conditioned by when
Input#
BatchProductVariantsWorkflowInput
BatchProductVariantsWorkflowInputThe product variants to manage.
BatchProductVariantsWorkflowInput
BatchProductVariantsWorkflowInputRecords to create in bulk.
Records to update in bulk.
delete
string[]OptionalRecords to delete in bulk.
delete
string[]OptionalOutput#
BatchProductVariantsWorkflowOutput
BatchProductVariantsWorkflowOutputThe result of managing the product variants.
BatchProductVariantsWorkflowOutput
BatchProductVariantsWorkflowOutputcreated
ProductVariantDTO[]The records that were created in the bulk operation.
created
ProductVariantDTO[]updated
ProductVariantDTO[]The records that were updated in the bulk operation.
updated
ProductVariantDTO[]deleted
string[]The IDs of the records deleted in the bulk operation.
deleted
string[]Was this page helpful?