> 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/use-harness-platform/triggers/selective-stage-execution-using-triggers.md).

# Selective pipeline stage execution by using triggers

You can set webhook triggers to run specific pipeline stages using the [Allow selective stage(s) executions?](/harness-platform/use-harness-platform/pipelines/run-specific-stage-in-pipeline.md) option.

{% hint style="info" %}
Harness variable expressions are not supported in triggers for pipeline or stage variables.
{% endhint %}

### Requirements <a href="#requirements" id="requirements"></a>

Make sure that you have met the following requirements:

* You have a Harness pipeline with a [CD stage](/continuous-delivery/new-to-continuous-delivery/overview.md#stage).
* You have set the service and infrastructure as runtime inputs so that you can provide the value in **Trigger>** **Configuration** tab.

### Execute a specific pipeline stage using triggers <a href="#execute-a-specific-pipeline-stage-using-triggers" id="execute-a-specific-pipeline-stage-using-triggers"></a>

1. Select a pipeline whose stage you want to execute using triggers.
2. Make sure that the **Selective Execution Settings>** [**Allow selective stage(s) executions?**](/harness-platform/use-harness-platform/pipelines/run-specific-stage-in-pipeline.md) in **Advanced Options** of the pipeline is set to **Yes**.

   ![](/files/ayZt6SmHZhMq3MyxDzBk)
3. When you create a trigger, in the **Configuration** tab, select the stages you want to execute.

   ![](/files/jInYmqUfIX5RSAnkatz3)

Here is a sample trigger YAML:

```yaml
trigger:
name: stage3Trigger
identifier: stage3Trigger
enabled: true
description: ""
tags: {}
stagesToExecute:
  - stage3
orgIdentifier: NgTriggersOrg
projectIdentifier: viniciusTest
pipelineIdentifier: ThreeStagesPipeline
source:
  type: Webhook
  spec:
    type: Custom
    spec:
      payloadConditions: []
      headerConditions: []
inputYaml: |
  pipeline:
    identifier: ThreeStagesPipeline
    stages:
      - stage:
          identifier: stage3
          type: Custom
          variables:
            - name: stage3var
              type: String
              value: stage3Var

```
