---
title: "set-artifact-names | Customer&#x27;s Canvas Hub"
canonical: "https://customerscanvas.com/docs/hub/printer-guide/pipelines/tasks/set-artifact-names/"
---

# set-artifact-names

> Learn how the set-artifact-names task renames individual artifacts and artifact collections.

This task assigns names to single artifacts and artifact groups. All artifacts for which you want to set a name must be listed in `inputArtifacts`.

## Parameters

- **Key-Value Pairs**: Each parameter is a key-value pair, where:
  - **Key** is the artifact name (e.g., `"result"`) or a collection (e.g., `"result*"`).
  - **Value** is the assigned name, supporting [argument interpolation](https://customerscanvas.com/docs/hub/printer-guide/pipelines/concepts/interpolation.md).
- **Collections**: If a collection is specified (e.g., `"result*"`), the name is assigned to each element in the collection with the element index appended (e.g., `result1` becomes `"collection name (1)"`).
- **Override Support**: You can override the name for a specific element in a collection (e.g., `"result1": "collection name override"`).

:::note
If no name is specified for an artifact, its existing name is retained.
:::

## Examples

### Basic naming

This example demonstrates how to set names for both a single artifact and a collection.

```json
{
    "description": "Set names for preview and result files",
    "name": "set-basic-names",
    "type": "set-artifact-names",
    "inputArtifacts": [
        "preview",
        "result*"
    ],
    "parameters": {
        "preview": "{{project.items.@.fields.previewFileName?}}",
        "result*": "rendered_page_*"
    }
}
```

### Collection with override

This example shows how to assign a name to a collection and override the name for a specific element.

```json
{
    "description": "Set names for a collection with an override",
    "name": "set-collection-names",
    "type": "set-artifact-names",
    "inputArtifacts": [
        "output*"
    ],
    "parameters": {
        "output*": "final_output",
        "output1": "final_output_cover"
    }
}
```

### Dynamic naming

This example uses interpolation to dynamically name artifacts based on project data.

```json
{
    "description": "Set dynamic names using project data",
    "name": "set-dynamic-names",
    "type": "set-artifact-names",
    "inputArtifacts": [
        "design",
        "pages*"
    ],
    "parameters": {
        "design": "{{project.name}}_design",
        "pages*": "{{project.name}}_page"
    }
}
```
