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

# Create a step template

The Harness Template Library enables you to standardize and create step templates that can be re-used across pipelines and teams that use Harness.

To demonstrate how to create, configure, and use step templates, this topic adds a CD Run step template to a [CD pipeline](/continuous-delivery/troubleshooting-and-resources/tutorials/cd-gitops-tutorials.md). You can also create templates for [CI Run steps](/continuous-integration/use-harness-ci/use-harness-ci/run-step-settings.md) or any other step type in Harness.

This topic assumes you're familiar with [Harness' key concepts](/harness-ai/new-to-harness-platform/overview.md).

#### Objectives <a href="#objectives" id="objectives"></a>

You'll learn how to:

* Create a Run step template.
* Define template parameters.
* Use the run step template in a pipeline.

#### Step 1: Create a template <a href="#step-1-create-a-template" id="step-1-create-a-template"></a>

You can create a step template from your account, org, or project. ​This topic explains the steps to create a step template from the project scope.

To create a inline step template from the project scope, do the following:

1. In your Harness, go to your project.
2. Select **Project Settings**, then, under **Project-level resources**, select **Templates**.
3. Select **+ New Template**, and then select **Step**. The **Create New Step Template** settings open.
4. In **Name**, enter a name for the template.​
5. (Optional) Select the pencil icon to enter a **Description**.
6. (Optional) Select the pencil icon to add **Tags**.
7. In **Version Label**, enter the version of the stage, for example, `v1`. Versioning a template enables you to create a new template without modifying the existing one. For more information, go to [Versioning](/harness-ai/use-harness-platform/templates/template.md).
8. Under **How do you want to set up your template?**, select **Inline**.
9. Select **Start**. The **Step Library** panel opens.

#### Step 2: Add step parameters <a href="#step-2-add-step-parameters" id="step-2-add-step-parameters"></a>

To add step parameters, do the following:

1. Follow the steps above to create a template.
2. In **Step Library,** select **Run** under **Build**.

   The **Step Parameters** settings open.
3. Select **Container Registry**, and then select **Runtime input**, which lets you add values when you start a pipeline execution.
4. In **Image,** select **Runtime input**. You can use any Docker image from any Docker registry, including private registries.
5. In **Command**, select **Runtime input**.
6. Select **Save**. The new template displays under the **Templates** list.

   **Use Runtime Inputs instead of variable expressions:** when you want to template settings in a Stage or step template, use [Runtime inputs](/harness-ai/use-harness-platform/variables-and-expressions/runtime-inputs.md) instead of variable expressions. When Harness tries to resolve variable expressions to specific stage-level settings using fully-qualified names, it can cause issues at runtime. Every pipeline where the stage or step template is inserted must utilize the exact same names for fully-qualified name references to operate. With runtime inputs, you can supply values for a setting at deployment runtime.

{% hint style="info" %}
You can let callers (the pipelines and stages that use this step template) override a controlled set of its advanced settings, such as conditional execution, failure strategy, looping strategy, policy enforcement, and delegate selectors. Set the common value in the template and add only the settings that vary to the template's allow-list. Go to [Override template advanced settings](/harness-ai/use-harness-platform/templates/template-overrides.md) to configure and apply these overrides.
{% endhint %}

#### Step 3: Add the run step template to a pipeline <a href="#step-3-add-the-run-step-template-to-a-pipeline" id="step-3-add-the-run-step-template-to-a-pipeline"></a>

To add the run step template to a pipeline, do the following:

1. Follow the steps above to create a template.
2. Go to your pipeline, and then select **Add Step**. The **Step Library** panel opens.
3. In **Step Library,** select **Run** under **Build**. The **Configure Run** **Step** settings open.
4. Select **Use Template.** The next page lists all the project-level templates.
5. Select the template that you created.
6. Select the **Activity Log** to track all template events. It shows you details like who created the template and template version changes.
7. In **Details**, from the **Version Label** list, select **Always use the stable version**. This ensures that any changes that you make to this version are propagated automatically to the pipelines using this template.
8. Select **Use Template**.
9. In **Container Registry**, select **Runtime input**.
10. In **Image**, select **Runtime input**.
11. In **Command**, select **Runtime input**.
12. Select **Apply Changes**.
13. Click **Save**.
