# "Exceeded the maximum execution time of 360 minutes": GitHub Actions timeouts, and jobs that finish in time

> GitHub cancels a job on a hosted runner after 6 hours, and a job without timeout-minutes can hang for all 6 hours, every minute billed. What each limit is, how to set timeout-minutes on a job and a step, how to find the step that hangs, and how to make a long job finish: split it, cache it, or run it on 16 vCPU with its caches kept, for a flat $149 a month.

"The job running on runner GitHub Actions 2 has exceeded the maximum execution time of 360 minutes" means GitHub cancelled the job after 6 hours, the most a job on a GitHub-hosted runner can run. The same message with a smaller number means your own `timeout-minutes` stopped it. The fix depends on which job you have: one that hangs needs a short timeout and the step that hangs found; one that really needs 6 hours needs to be split, cached, or run on a faster machine.

Skipbox runs the long job on up to 16 vCPU and 32 GB with its caches kept between jobs, for a flat price with unlimited minutes, so the same work finishes in less of its 6 hours.

- 4, 8 or 16 vCPU by label, against 2 on a private repository's `ubuntu-latest`
- Docker layers, package caches and build output stay on your account's machine for the next run
- $39, $79 or $149 a month, unlimited minutes

**GitHub Actions at a flat price, unlimited minutes** Skipbox runs your GitHub Actions jobs on your own dedicated machine: $39 a month, however many minutes you run. Docker layers and dependency caches stay between jobs, so the next job starts right away.

A 4 vCPU runner, 20,000 minutes a month: GitHub $222 → Skipbox $39. You save $183 every month.

Moving takes one line: `runs-on: skipbox`.

[Start my 7-day free trial](https://app.skipbox.dev/sign-in?ref=g-github-actions-job-timeout-en)

## GitHub's time limits

| Limit | GitHub-hosted runner | Self-hosted runner | What happens at the limit |
|---|---|---|---|
| One job | 6 hours | 5 days | The job is cancelled and fails |
| `timeout-minutes` not set | 360 minutes | 360 minutes | The job is cancelled |
| Waiting in the queue | 24 hours | 24 hours | The job is cancelled |
| One workflow run | 35 days | 35 days | The run is cancelled |
| `GITHUB_TOKEN` | Expires when the job ends | At most 24 hours | Steps that call GitHub's API fail |

GitHub's figures are from its [Actions limits](https://docs.github.com/en/actions/reference/limits) and [workflow syntax](https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax) pages. The 6 hours count from when a runner picks the job up: time in the queue isn't part of them.

## Set a timeout on every job

Without `timeout-minutes`, a job that hangs runs for 360 minutes and you pay for all of them on a private repository. Set each job's timeout to two or three times its normal time:

```yaml
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - uses: actions/checkout@v4
      - run: npm ci
      - name: Integration tests
        timeout-minutes: 15
        run: npm run test:integration
```

- **Job:** `jobs.<job_id>.timeout-minutes` cancels the whole job.
- **Step:** `steps[*].timeout-minutes` kills one step's process; with `continue-on-error: true` the job goes on.
- **One command:** `timeout 10m ./run-e2e.sh` stops a single command inside a script and exits with 124, so the log says which command it was.

## Find the step that hangs

A job that takes 20 minutes on a good day and 6 hours on a bad one is waiting for something. Open the log of the cancelled run and read the last lines printed before it went quiet. The usual causes:

| What the log shows last | What is waiting | Fix |
|---|---|---|
| A question (`[Y/n]`, `Do you want to continue?`) | A command asking for input nobody gives | `-y`, `--yes`, `DEBIAN_FRONTEND=noninteractive`, `--non-interactive` |
| A server's "listening on" or "ready" line | A server started in the foreground | Start it with `&` or `docker compose up -d`, then wait for its port with a timeout |
| A test that started and never finished | A test waiting for a database or service that never came up | A health check on the service, and a per-test timeout |
| Steps getting slower, then nothing | The machine is out of memory and swapping | Fewer parallel workers, or a machine with more memory |
| Nothing at all after the runner line | The runner lost its connection or the VM went down | See [the shutdown signal guide](https://skipbox.dev/guides/github-actions-runner-shutdown-signal) |

To look inside a job while it hangs, `mxschmitt/action-tmate` opens an SSH session into the runner at the step you put it.

## Make a long job fit in 6 hours

When the job really needs the time, three things shorten it.

### Split it

Run the test suite in shards with a matrix, so each shard is its own job with its own 6 hours:

```yaml
jobs:
  test:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    strategy:
      matrix:
        shard: [1, 2, 3, 4]
    steps:
      - uses: actions/checkout@v4
      - run: npx playwright test --shard=${{ matrix.shard }}/4
```

For a build that can't be split, save its output between jobs with `actions/upload-artifact` and `actions/download-artifact`, and let the next job pick up where the last one stopped.

### Stop rebuilding what didn't change

A job that downloads every dependency and builds every Docker layer from nothing spends much of its time redoing the last run. `actions/cache` saves part of it, within GitHub's 10 GB per repository, and restoring a large cache takes minutes of its own. See [the Docker layer cache guide](https://skipbox.dev/guides/docker-layer-cache-github-actions) and [the cache size limit guide](https://skipbox.dev/guides/github-actions-cache-size-limit).

### Run it on a faster machine

A private repository's `ubuntu-latest` has 2 cores. A compile, a test suite or a Docker build that uses every core finishes sooner on more of them. GitHub's larger runners have more cores, are billed per minute on GitHub Team and Enterprise Cloud, and keep the same 6-hour limit.

## Skipbox: more cores, and the caches already there

| `runs-on` | Machine | Plan, per month |
|---|---|---|
| `skipbox` | 4 vCPU, 16 GB | S, $39 |
| `skipbox-8x16` | 8 vCPU, 16 GB | M, $79 |
| `skipbox-16x32` | 16 vCPU, 32 GB | L, $149 |

- **The caches stay.** Each plan is a machine kept for your account: Docker images and layers, package caches and the tool cache are on its disk when the next job starts, with nothing to restore.
- **Minutes are unlimited.** A long job costs the same flat price as a short one, and runs outside your GitHub Actions budget.
- **The same limit, used less.** A Skipbox job can run for up to 6 hours, and `timeout-minutes` works as on any runner.
- **Measured in public.** The [benchmark](https://docs.skipbox.dev/benchmarks) runs open-source projects' own jobs on GitHub's runner and on Skipbox, with every run's log on GitHub.

Moving a job is one line:

```yaml
jobs:
  build:
    runs-on: skipbox-16x32 # was ubuntu-latest
    timeout-minutes: 120
```

1. Sign in to Skipbox with GitHub.
2. Install the Skipbox GitHub App and pick the repositories.
3. Change `runs-on` and push.

## Try it on the job that runs out of time

You can try it on your own jobs first: free for 7 days, no minute cap.

Move the job that hits the limit to `runs-on: skipbox` and compare its second run with its last run on GitHub. Check what your minutes cost now in the [calculator on the home page](https://skipbox.dev/?ref=g-github-actions-job-timeout-en#cost).

## FAQ

### What is the maximum time a GitHub Actions job can run?

6 hours (360 minutes) on a GitHub-hosted runner, and 5 days on a self-hosted runner, per GitHub's Actions limits page. A whole workflow run can last up to 35 days, and a job can wait in the queue for 24 hours before GitHub cancels it.

### What is the default timeout-minutes in GitHub Actions?

360. GitHub's workflow syntax gives jobs.<job_id>.timeout-minutes a default of 360, so a job that hangs without one runs, and is billed, for 6 hours before GitHub cancels it. Set it to about two or three times the job's normal time.

### How do I set a timeout for one step?

Put timeout-minutes on the step: GitHub kills the step's process when it runs longer. It takes a positive whole number of minutes. For one command inside a script, the shell's timeout works too: timeout 20m npm test.

### Can a GitHub-hosted job run longer than 6 hours?

No. A larger timeout-minutes doesn't lift the 6-hour limit on GitHub's runners. Split the work into jobs that each fit, save the work between them, or make the job faster: more cores and caches that are already there.

### Why does my job take 6 hours when it normally takes 20 minutes?

Something is waiting: a command asking a question nobody answers, a server started in the foreground, a test waiting for a service that never came up, or a machine short of memory. With no timeout-minutes the job sits there until GitHub's 360 minutes run out. Set a timeout, then read the last lines the log printed before it stopped.

### Does Skipbox let a job run longer?

A Skipbox job can run for up to 6 hours, as on GitHub's runners, and it finishes sooner: up to 16 vCPU and 32 GB, with Docker layers and package caches kept on your account's machine between jobs. The benchmark of open-source projects' own jobs is public, with every run's log.

Updated 2026-11-25 · https://skipbox.dev/guides/github-actions-job-timeout
