> 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/v1-step-template.md).

# Create a V1 step template

A step template captures one reusable step that you can drop into any V1 pipeline. Use it for a self-contained unit of work, such as a build, a script, or a single deployment action.

***

### 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](https://github.com/iKettles/harness-gitbook/tree/main/3k-docs/platform/getting-started/pipeline/README.md) to enable V1 in your project.
* **Connector for the runtime image:** A container connector for the image your step uses (for example, `docker_hub_anonymous`). 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-ai/use-harness-platform/platform-access-control.md) to configure roles.

***

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

Define the template under the top-level `template` key with a single `step` block. The body of `step` is identical to a step you would write inline in a pipeline.

```yaml
template:
  step:
    run:
      script: |-
        pnpm build
        pnpm test
      container:
        image: nodejs:latest
        connector: docker_hub_anonymous
```

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

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

***

### 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/v1-template-library-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 template from inside a step list using the `template` block. Set `uses` to `<scope>.<name>@<version>` and supply input values under `with`.

```yaml
pipeline:
  stages:
    - steps:
        - template:
            uses: account.docker@1.0.0
            with:
              push: true
              tags: latest
              repo: harness/hello-world
```

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

```yaml
pipeline:
  stages:
    - steps:
        - template:
            uses: account.docker
            with:
              push: true
              tags: latest
```

***

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

A step template solves the single-step case. When several steps always run together, group them into one reusable unit instead. Go to the [step group template guide](/harness-platform/3.0/harness-platform-resources/templates/v1-step-group-template.md) to bundle multiple steps. Go to the [stage template guide](/harness-platform/3.0/harness-platform-resources/templates/v1-stage-template.md) to standardize a complete stage.
