> For the complete documentation index, see [llms.txt](https://docs.datajet-app.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.datajet-app.com/liquid/filters/sleep.md).

# sleep

Pauses the script for a number of seconds and returns its input unchanged. Use it when a script has to wait for an external system to finish something asynchronous before it can continue.

```liquid
{% assign ignore = "" | sleep: 10 %}
```

## Syntax

```liquid
{{ value | sleep }}
{{ value | sleep: seconds }}
```

| Parameter | Description                                             |
| --------- | ------------------------------------------------------- |
| `value`   | Any value. It is returned unchanged                     |
| `seconds` | Optional. Seconds to wait, maximum 600. Defaults to `1` |

## Return Value

Returns the input value after the pause.

## Examples

**Wait for an external job to finish before reading its result:**

```liquid
{% assign status = "pending" %}
{% while status == "pending" %}
  {% assign ignore = "" | sleep: 10 %}
  {% http url: status_url, method: "GET" as check %}
  {% assign status = check.body.status %}
{% endwhile %}
```

## Notes

* Maximum 600 seconds per call. Longer waits fail with an error
* The pause counts toward the script's execution timeout (24 hours for scheduled and event scripts, 60 seconds for HTTP and shipping scripts)
* Not needed for API throttling. The `graphql` and `http` tags already retry throttled requests with backoff
* Only available in backend scripts, not in the storefront preview
