> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/harness-platform/3.0/harness-platform-resources/templates-overview/v1-step-group-template.md).

# Create a step group template

Bundle multiple steps into a reusable step group template for V1 pipelines.

A step group template bundles an ordered set of steps into a single reusable unit. Use it when several steps always run together, such as build and test, or scan and publish.

***

### Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **V1 pipeline access:** A project with V1 pipelines enabled. Go to the [V1 pipelines overview](/harness-platform/3.0/in-harness-3.0/pipelines.md) to enable V1 in your project.
* **Connector for the runtime image:** A container connector for each image referenced in the group. Go to the [connectors reference](/harness-platform/3.0/in-harness-3.0/connectors.md) to configure one.
* **Permissions:** Create and Edit on Templates. Go to the [RBAC in Harness](/harness-platform/3.0/harness-platform-resources/platform-access-control.md) to configure roles.

***

### Author the step group template <a href="#author-the-step-group-template" id="author-the-step-group-template"></a>

Define the template under the top-level `template` key with a `group` block. Each entry under `steps` is a regular V1 step.

```yaml
template:
  group:
    steps:
      - name: test
        id: test
        run:
          script: pnpm test
          container:
            image: nodejs:latest
            connector: docker_hub_anonymous
      - name: build
        id: build
        run:
          script: pnpm build
          container:
            image: nodejs:latest
            connector: docker_hub_anonymous
```

Steps inside a group share the group's execution context. They run in the declared order unless you set a parallel strategy on individual steps.

To make the group configurable, declare inputs under `template.inputs` and reference them with `${{ inputs.<name> }}` inside any step.

```yaml
template:
  inputs:
    version:
      type: string
      default: latest
  group:
    steps:
      - name: install
        id: install
        run:
          container: node:${{ inputs.version }}
          script: npm install
      - name: test
        id: test
        run:
          container: node:${{ inputs.version }}
          script: npm test
```

***

### Create the template in Harness <a href="#create-the-template-in-harness" id="create-the-template-in-harness"></a>

1. In your project, go to **Resources** and select **Templates**.
2. Select **New Template**. The **Select Template Type** dialog opens. Select **Step Group Template**.
3. The **Create template** dialog opens. Fill in the following fields:
   * **Name** — a human-readable label for the template.
   * **Version label** — the version string consumers reference in `uses` (for example, `v1`).
   * **Storage** — where the template is stored. Select **Inline** to store it in Harness. To store it in a Git provider, select **Harness Code**, **GitHub**, **GitLab**, **Bitbucket**, **Azure Repos**, or **Git** and connect the relevant repository.
   * Optionally expand **Metadata** to add a description and tags.
4. Select **Start**. The template YAML editor opens.
5. Paste or author your step group template YAML in the editor, then save.

***

### Store the template <a href="#store-the-template" id="store-the-template"></a>

Choose where the template is versioned.

* **Harness-managed:** Save the template in the Harness platform. Versions are created and promoted in Harness.
* **Git-stored:** Commit the template to a Git repository. The Git tag, branch, or commit determines the resolved version.

Go to the [V1 Template Library overview](/harness-platform/3.0/harness-platform-resources/templates-overview.md) to compare storage modes.

***

### Reference the template from a pipeline <a href="#reference-the-template-from-a-pipeline" id="reference-the-template-from-a-pipeline"></a>

Reference a step group template from inside a step list with the `template` block. Set `uses` to `<scope>.<name>@<version>` and pass input values under `with`. The group is expanded inline at runtime; the steps run as a group inside the parent stage.

```yaml
pipeline:
  stages:
    - steps:
        - template:
            uses: account.node-build@1.0.0
            with:
              version: "20"
```

If you omit the version suffix, the pipeline resolves to the latest stable version at execution time.

***

### Next steps <a href="#next-steps" id="next-steps"></a>

A step group template covers a fixed sequence of steps inside a stage. When you also want to standardize stage-level settings (such as inputs, environment, or failure strategy), use a stage template instead. Go to the [stage template guide](/harness-platform/3.0/harness-platform-resources/templates-overview/v1-stage-template.md) to author a stage template.

{% @harness-feedback/feedback %}
