> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mercurjs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# createProductAttributeValuesWorkflow

> Add values to an attribute, mirroring them onto its product option.

Creates values on an existing attribute. If the attribute is a variant-axis `multi_select` with a mirror `ProductOption`, the option's value list is extended first and each new attribute value is bound to its option value via `product_option_value_id`. Triggered by `POST /admin/product-attributes/:id/values`. Emits `product-attribute-value.created`.

## Usage

```ts theme={null}
import { createProductAttributeValuesWorkflow } from "@mercurjs/core/workflows"

const { result } = await createProductAttributeValuesWorkflow(container).run({
  input: {
    attribute_id: "pattr_color",
    values: [{ name: "Green" }, { name: "Yellow", rank: 5 }],
  },
})
```

## Input

<ParamField body="attribute_id" type="string" required>The attribute to add the values to.</ParamField>

<ParamField body="values" type="CreateProductAttributeValueDTO[]" required>
  Values to create.

  <Expandable title="properties">
    <ParamField body="name" type="string" required>Display name of the value.</ParamField>
    <ParamField body="handle" type="string">URL-safe handle; auto-generated when omitted.</ParamField>
    <ParamField body="rank" type="number">Sort rank.</ParamField>
    <ParamField body="is_active" type="boolean">Whether the value is active.</ParamField>
    <ParamField body="metadata" type="object | null">Custom key-value data.</ParamField>
  </Expandable>
</ParamField>

<ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>

## Result

<ResponseField name="result" type="ProductAttributeValueDTO[]">The created values.</ResponseField>

## Hooks

* `validate` — runs before creation with `{ input }`.
* `productAttributeValuesCreated` — runs after creation with `{ values, additional_data }`.
