> ## 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.

# deleteProductAttributesWorkflow

> Delete attributes and their mirror product options.

Deletes product attributes after validating none of them is still linked to a product or category. Mirror `ProductOption`s of axis attributes are deleted alongside. Triggered by `DELETE /admin/product-attributes/:id`; also run internally when detaching product-scoped attributes. Emits `product-attribute.deleted`.

## Usage

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

await deleteProductAttributesWorkflow(container).run({
  input: { ids: ["pattr_123"] },
})
```

## Input

<ParamField body="ids" type="string[]" required>Ids of the attributes to delete; the workflow throws if an attribute is still linked.</ParamField>
<ParamField body="additional_data" type="object">Custom data passed through to the hooks.</ParamField>

## Result

<ResponseField name="result" type="void">No return value.</ResponseField>

## Hooks

* `validate` — runs before deletion with `{ input }`.
* `productAttributesDeleted` — runs after deletion with `{ ids, additional_data }`.
