> 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/resilience-testing/3.0/load-testing/run-in-a-pipeline.md).

# Run in a Pipeline

Add a **Load Test** step to a Harness pipeline to run an existing load test as part of your delivery process. The step references a load test you already created, and you pass its parameters as fixed values, runtime inputs, or expressions. This lets you validate performance on every deployment and reuse one load test across pipelines with different values.

{% hint style="info" %}
**FEATURE FLAG**

Load Testing is currently behind a feature flag (`CHAOS_LOAD_TESTING_ENABLED`). Contact your Harness sales representative to enable it for your account.
{% endhint %}

***

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

* **Module access:** Access to the Harness Resilience Testing module.
* **A load test:** An existing load test to reference in the step. Go to [Python](/resilience-testing/load-testing/create-a-load-test.md), [JavaScript](/resilience-testing/load-testing/create-a-load-test/k6.md), or [Java](/resilience-testing/load-testing/create-a-load-test/jmeter.md) to create one.
* **A pipeline:** A pipeline with a stage that supports the Load Test step, such as a Deploy or Custom stage.

{% hint style="info" %}
**MEASURING HEALTH UNDER LOAD INSTEAD**

This page adds a load test to a pipeline you already have. To run a load test alongside a probe that watches the service while the traffic is applied, create a composite load test instead, and Harness builds the pipeline for you. Go to [Composite load tests](/resilience-testing/load-testing/composite-load-tests.md) to compare the two.
{% endhint %}

***

### Add a Load Test step <a href="#add-a-load-test-step" id="add-a-load-test-step"></a>

1. Open your pipeline and select the stage where you want to run the load test.
2. On the **Execution** tab, select **Add Step**.
3. In the **Step Library**, under **Resilience Testing**, select **Load Test**. The **Configure Load Test** panel opens.
4. Enter the step details:

| Field                   | Description                                                                      |
| ----------------------- | -------------------------------------------------------------------------------- |
| **Name**                | A descriptive name for the step.                                                 |
| **Id**                  | The step identifier, generated from the name. Select the edit icon to change it. |
| **Description**         | (Optional) What the step validates.                                              |
| **Load Test Reference** | The load test this step runs. Select **Select Load Test** to choose one.         |

You can add more than one Load Test step to a stage to run several tests in sequence.

***

### Select the load test <a href="#select-the-load-test" id="select-the-load-test"></a>

1. In **Load Test Reference**, select **Select Load Test**.
2. In the **Select Load Test** modal, search for a load test and select its card. Each card shows the engine (Python, JavaScript, or Java), the last run status, and when it was last updated. The **Summary** panel shows the test's users and duration.
3. Select **Add to Pipeline**.

{% hint style="info" %}
**CREATE A LOAD TEST INLINE**

Select **+ New Load Test** in the modal to create a load test without leaving the pipeline.
{% endhint %}

***

### Configure tool inputs <a href="#configure-tool-inputs" id="configure-tool-inputs"></a>

After you select a load test, the **Tool Inputs** section shows the parameters the test exposes. The inputs depend on the referenced load test and its engine. For example, a Python (Locust) test on Kubernetes exposes:

| Input               | Description                                                     |
| ------------------- | --------------------------------------------------------------- |
| **durationSeconds** | Total run time of the load test, in seconds.                    |
| **rampUpTimeSec**   | Time to ramp virtual users from zero to the target, in seconds. |
| **workerCount**     | Number of worker pods that generate load.                       |
| **targetUrl**       | The base URL of the application under test.                     |

Required inputs are marked with an asterisk (`*`).

For each input, select the pin icon to choose how to provide its value:

| Value type        | When to use                                                                                              |
| ----------------- | -------------------------------------------------------------------------------------------------------- |
| **Fixed value**   | Enter the value now. It does not change at runtime.                                                      |
| **Runtime input** | Leave the value open and provide it when the pipeline runs. Harness prompts you for it before execution. |
| **Expression**    | Reference a pipeline variable or a prior step's output, such as `<+pipeline.variables.targetUrl>`.       |

Use **Runtime input** to reuse the same load test across pipelines and supply different values per run. Use **Expression** to derive a value from earlier stages, such as the URL of a service you just deployed.

***

### Apply and run <a href="#apply-and-run" id="apply-and-run"></a>

1. (Optional) Select the **Advanced** tab to configure a failure strategy and other settings.
2. Select **Apply Changes** to save the step, then **Save** to save the pipeline.
3. Run the pipeline. If any input is a runtime input, Harness prompts you for its value before the step runs. The step resolves the inputs and variables, then runs the load test.

Go to [Analyze load test results](/resilience-testing/load-testing/analyze-results.md) to interpret throughput, error rate, response times, and threshold outcomes.

***

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

* Go to [Run a load test template in a pipeline](/resilience-testing/load-testing/run-in-a-pipeline/run-load-test-template-in-pipeline.md) to add a reusable Load Test step template to a pipeline.
* Go to [Load Test Templates](/resilience-testing/load-testing/load-test-templates.md) to create reusable load test definitions in a ChaosHub.
* Go to [Composite load tests](/resilience-testing/load-testing/composite-load-tests.md) to run a load test and a probe together in a dedicated stage.
* Go to [Use HCE with Continuous Delivery](/resilience-testing/shared-capabilities/integrations/cicd/harness-cd.md) to add chaos experiments to the same pipeline.
* Go to [Analyze load test results](/resilience-testing/load-testing/analyze-results.md) to review a run.
