> 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/harness-platform/3.0/harness-platform-resources/overview/overview-1/group.md).

# Group

A Group step organizes multiple steps into a named serial container. Steps inside the group run sequentially, and the group itself supports timeout, on-failure, strategy, and conditional execution.

A **Group** (Serial step group) is a named container that runs its steps sequentially. Use a group to:

* Organize related steps under a single name for clarity in the execution view
* Apply a shared timeout, on-failure rule, or strategy to a set of steps as a unit
* Reference the group's overall status in downstream conditions

## What you will learn

* How a Group step organizes child steps into a named sequential container
* How to apply timeout, on-failure, strategy, and conditional execution to a group as a unit
* How the group's overall status reflects the outcome of its child steps

***

## YAML

```yaml
stages:
  - name: build
    id: build
    steps:
      - name: setup-and-compile
        id: setup_and_compile
        group:
          steps:
            - name: install-deps
              id: install_deps
              run:
                script: npm install
            - name: compile
              id: compile
              run:
                script: npm run build
```

Steps inside `group.steps` run in order. The group completes when all steps finish, or stops early if a step fails (subject to on-failure rules on the group).

***

## Advanced settings

The group supports all step-level advanced settings. These apply to the group as a whole, not to individual steps inside it. The default step group timeout is `2h`.

### Timeout

Terminates the entire group if it exceeds the specified duration. When a group times out, it is marked as **Expired**.

```yaml
- name: setup-and-compile
  id: setup_and_compile
  timeout: 15m
  group:
    steps:
      - name: install-deps
        id: install_deps
        run:
          script: npm install
      - name: compile
        id: compile
        run:
          script: npm run build
```

### On failure

Controls what happens when any step inside the group fails:

```yaml
- name: deploy-group
  id: deploy_group
  on-failure:
    - errors:
        - all
      action: ignore
  group:
    steps:
      - name: pre-check
        id: pre_check
        run:
          script: ./pre-check.sh
      - name: deploy
        id: deploy
        run:
          script: ./deploy.sh
```

### Strategy

Loops the entire group using a matrix, for, or while strategy. Each iteration runs all steps in the group:

```yaml
- name: test-env
  id: test_env
  strategy:
    matrix:
      env:
        - staging
        - production
  group:
    steps:
      - name: seed
        id: seed
        run:
          script: ./seed.sh ${{ matrix.env }}
      - name: test
        id: test
        run:
          script: ./test.sh ${{ matrix.env }}
```

### Conditional execution

Skips the entire group based on a JEXL condition:

```yaml
- name: prod-checks
  id: prod_checks
  if: <+OnPipelineSuccess>
  group:
    steps:
      - name: smoke-test
        id: smoke_test
        run:
          script: ./smoke-test.sh
      - name: notify
        id: notify
        run:
          script: ./notify.sh
```

***

## Next steps

* Go to [Steps overview](/harness-platform/3.0/harness-platform-resources/overview/overview-1.md) to review step types and common advanced settings.
* Go to [On failure](/harness-platform/3.0/harness-platform-resources/overview/strategy/on-failure.md) to configure failure handling.
* Go to [Strategy](/harness-platform/3.0/harness-platform-resources/overview/strategy.md) to loop a group across values.
* Go to [Conditional execution](/harness-platform/3.0/harness-platform-resources/overview/strategy/conditional-execution.md) to skip a group based on a condition.
