---
url: /en/build/timeout.md
description: >
  Describes the timeout limits for Cloud Native Build pipelines and jobs,
  including default no-output timeout, maximum execution durations, and how to
  configure custom timeout values.
---
In Cloud Native Build, each pipeline or job has a maximum execution time.
If exceeded, it will automatically terminate.

## Pipeline Timeout

The maximum execution time for a pipeline is `20 hours`.
After `20 hours`, the pipeline container will be automatically destroyed.

## Job Timeout

A job can customize its timeout by declaring
[`timeout`](./grammar.md#timeout).
If not declared, the following default values apply.

> For agent tasks such as `npc:go`, `timeout` applies to **each tool execution** (e.g., bash commands)
> rather than the entire agent session; the overall session duration is still bound by the
> [pipeline timeout](#pipeline-timeout). See [`npc:go` Timeout](./internal-steps/npc/go.md#npc-go-timeout) for details.

### No Output Timeout

If a `Job` has no output for **10 minutes** continuously, a timeout will be triggered.
If [`timeout`](./grammar.md#timeout) is declared,
the no-output timeout matches the configured value.

### Maximum Timeout Duration

A `Job` defaults to a maximum execution of **2 hours**.
If [`timeout`](./grammar.md#timeout) is declared,
that value is used instead, up to a maximum of **12 hours**.

### Configuration Example

The following example triggers a pipeline on the `push` event
and sets the timeout of a job to **30 minutes**:

```yaml title=".cnb.yml"
main:
  push:
    - stages:
        - name: build
          image: node:20
          script: |
            npm install
            npm run build
          timeout: 30m # This job runs for at most 30 minutes
```

After declaring `timeout`, this job:

* triggers a no-output timeout after **30 minutes** of inactivity
  (replacing the default 10 minutes);
* runs for at most **30 minutes** and then terminates automatically.

> `timeout` supports units such as `ms`, `s`, `m`, and `h`.
> See [grammar](./grammar.md#timeout) for more details.
