> 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/chaos-testing/actions/delay-action.md).

# Delay Action

Configure a delay action in Harness Resilience Testing to introduce a timed pause between phases of a chaos experiment

## What is a delay action? <a href="#what-is-a-delay-action" id="what-is-a-delay-action"></a>

A **Delay Action** introduces a configurable time delay during chaos experiment execution. It pauses the experiment workflow for a specified duration, allowing you to:

* Create time gaps between different experiment phases
* Allow systems to stabilize after fault injection
* Wait for monitoring systems to capture metrics
* Simulate real-world scenarios where operations require time
* Control the timing and pacing of experiment execution

## When to use delay actions <a href="#when-to-use-delay-actions" id="when-to-use-delay-actions"></a>

Delay actions are particularly useful in the following scenarios:

### System stabilization <a href="#system-stabilization" id="system-stabilization"></a>

Use cases in this category include the following:

* **After Fault Injection**: Allow time for systems to react to injected faults
* **Before Validation**: Wait for systems to reach a steady state before running probes
* **During Recovery**: Give systems time to recover from chaos events

### Observability and monitoring <a href="#monitoring-and-observability" id="monitoring-and-observability"></a>

Use cases in this category include the following:

* **Metric Collection**: Allow monitoring systems to collect sufficient data points
* **Alert Processing**: Wait for alerting systems to detect and process anomalies
* **Dashboard Updates**: Give dashboards time to reflect system state changes

### Realistic scenarios <a href="#realistic-scenarios" id="realistic-scenarios"></a>

Use cases in this category include the following:

* **Gradual Rollouts**: Simulate gradual deployment or rollback scenarios
* **User Behavior**: Model real-world user interaction patterns
* **System Dependencies**: Account for dependencies that have inherent delays

## How to configure a delay action <a href="#how-to-configure-a-delay-action" id="how-to-configure-a-delay-action"></a>

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

Perform the following steps:

1. Navigate to your **Probes & Actions** and go to the **Actions** tab
2. Click **New Action** and select **Delay** from the dropdown.

   ![delay action](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-6c3973c4ec55b809ab6b42bdc0d2cc67a743aad3%2Fcreate-delay-action.png?alt=media)

### Step 2: Configure delay parameters <a href="#step-2-configure-delay-parameters" id="step-2-configure-delay-parameters"></a>

Configure the following parameters for your delay action:

* **Action Name**: Provide a descriptive name for the delay action (e.g., "Wait for system stabilization")
* **Infrastructure Type**: Select the target infrastructure (e.g., Kubernetes)

  ![configure delay action](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-6c3973c4ec55b809ab6b42bdc0d2cc67a743aad3%2Fcreate-delay-action.png?alt=media)
* **Duration**: Specify the delay duration

  ![delay action duration](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-53affebfcc9433d67a564b7262db842a3a1132bf%2Fdelay-action-duration.png?alt=media)

### Step 3: Position the action <a href="#step-3-position-the-action" id="step-3-position-the-action"></a>

Place the delay action at the appropriate point in your experiment workflow:

* **Before Faults**: To prepare systems before chaos injection
* **Between Faults**: To create gaps between different fault injections
* **After Faults**: To allow systems to stabilize before validation

## Monitor delay actions <a href="#monitoring-delay-actions" id="monitoring-delay-actions"></a>

### Timeline view <a href="#timeline-view" id="timeline-view"></a>

Use the timeline view to do the following:

* View delay execution in the experiment timeline
* Track delay start and completion times
* Monitor overall experiment duration impact

### Execution logs <a href="#execution-logs" id="execution-logs"></a>

Use the execution logs to do the following:

* Review delay action logs for execution details
* Check for any issues during delay execution
* Validate that delays are executed as configured

## Common patterns <a href="#common-patterns" id="common-patterns"></a>

### Progressive delays <a href="#progressive-delays" id="progressive-delays"></a>

Use increasing delay durations for progressive fault injection:

```
Fault 1 → 30s delay → Fault 2 → 60s delay → Fault 3 → 90s delay
```

### Recovery windows <a href="#recovery-windows" id="recovery-windows"></a>

Create recovery windows between fault phases:

```
Chaos Phase → 2min delay → Validation Phase → 1min delay → Cleanup Phase
```

### Intervals for monitoring <a href="#monitoring-intervals" id="monitoring-intervals"></a>

Align delays with monitoring collection intervals:

```
Fault Injection → 30s delay (metric scrape interval) → Probe Validation
```

## Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>The experiment takes longer than expected</summary>

Each delay action pauses the experiment workflow for its full duration, so delays add to the overall experiment duration. Use the timeline view to track delay start and completion times, then shorten the **Duration** of any delay that is longer than you need.

</details>

<details>

<summary>A probe validates the system before it has stabilized</summary>

Place a delay action after the fault and before the probe, so the system has time to reach a steady state before validation. Align the **Duration** with your monitoring collection interval so that metrics are available when the probe runs.

</details>

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

* [Learn about Custom Script Actions](https://developer.harness.io/resilience-testing/chaos-testing/actions/custom-script-action.md)
* Explore experiment timeline view (see Experiments documentation)
* [Create experiments with actions](https://developer.harness.io/resilience-testing/chaos-testing/experiments.md)

{% @harness-feedback/feedback %}
