# Wait Step

<%= toc %>

A *wait* step waits for all previous steps to have successfully completed before allowing following jobs to continue.

<%= toc %>

<%= image "wait-step.png", width: 1070/2, height: 508/2, alt: "Screenshot of a basic wait step" %>

A basic wait step can be defined in your pipeline settings, or in your [pipeline.yml](/docs/pipelines/uploading-pipelines) file. It can be placed between steps to ensure that previous steps are successful before continuing to run the rest. 

```yml
- command: "command.sh"
- wait
- command: "echo The command passed"
```

## Continuing on failure

You can also configure the *wait* step to continue even if the previous steps failed.

If the previous steps failed, the build will be marked as failed only after the steps after the `wait` have completed. This is useful for processing results from previous steps, such as test coverage, or summarizing test failures.

```yml
- command: "command.sh"
- wait: ~
  continue_on_failure: true
- command: "echo This runs regardless of the success or failure"
- wait
- command: "echo The command passed"
```

In this example, if `command.sh` succeeds, both of the following command steps will be run. If `command.sh` fails, only the first will be run, and the build will then be marked as failed.

# Wait Step

<%= toc %>

A *wait* step waits for all previous steps to have successfully completed before allowing following jobs to continue.

<%= toc %>

<%= image "wait-step.png", width: 1070/2, height: 508/2, alt: "Screenshot of a basic wait step" %>

A basic wait step can be defined in your pipeline settings, or in your [pipeline.yml](/docs/pipelines/uploading-pipelines) file. It can be placed between steps to ensure that previous steps are successful before continuing to run the rest. 

```yml
- command: "command.sh"
- wait
- command: "echo The command passed"
```

## Continuing on failure

You can also configure the *wait* step to continue even if the previous steps failed.

If the previous steps failed, the build will be marked as failed only after the steps after the `wait` have completed. This is useful for processing results from previous steps, such as test coverage, or summarizing test failures.

```yml
- command: "command.sh"
- wait: ~
  continue_on_failure: true
- command: "echo This runs regardless of the success or failure"
- wait
- command: "echo The command passed"
```

In this example, if `command.sh` succeeds, both of the following command steps will be run. If `command.sh` fails, only the first will be run, and the build will then be marked as failed.

The explicit null `~` syntax used in the above example isn't required, but is reccommended as a best practice. It ensures that nothing else is accidentally added to the `wait` before the `continue_on_failure` attribute.

Clarify that the ~ isn't required
Clarify that the ~ isn't required
