> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bondata.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Group By

> Group records by field values to control downstream processing and aggregation

Groups records by a field value. This controls how downstream action nodes process records - creating one action per group instead of one batch for all records. It's also required before [Aggregation](/guide/nodes/transform/aggregation-node) to define what to aggregate over.

## Configuration

| Setting   | Description           |
| --------- | --------------------- |
| **Field** | The field to group by |

### Common grouping strategies

| Group by                                    | Effect                  |
| ------------------------------------------- | ----------------------- |
| **Primary key** (e.g., Contact.Id)          | One action per record   |
| **Category field** (e.g., Account.Industry) | One action per category |

## How It Works

<Steps>
  <Step title="Choose a field">
    Select the field that defines how records should be grouped (e.g., group by Account ID, Region, or Status).
  </Step>

  <Step title="Connect downstream nodes">
    Action nodes after this will create one action per group. Aggregation nodes will compute summaries per group.
  </Step>
</Steps>

## Output

The data itself is unchanged - Group By only sets grouping metadata. Downstream nodes use this metadata to process records in groups rather than as a single batch.

<Note>
  Without a Group By node, action nodes (Slack, Email, Create Record, etc.) produce a single batch action for all records, with field values concatenated. Add Group By to control granularity.
</Note>

## Example

Send one Slack message per account (instead of one batch message):

1. **Group By** → Salesforce.Account.Id
2. **Slack** → message template with account details

Without Group By, Slack would send one message listing all accounts.

## Best Practices

* Group by **primary key** when you need per-record actions (updates, notifications, record creation)
* Group by **category field** when you need per-category summaries or actions
* Always use Group By before action nodes if you want per-record behavior
* Use [Split Group](/guide/nodes/transform/split-group-node) later in the workflow to remove grouping

## Related Nodes

* **[Aggregation](/guide/nodes/transform/aggregation-node)** - compute summary statistics per group (SUM, AVG, COUNT)
* **[Split Group](/guide/nodes/transform/split-group-node)** - remove grouping to return to single-batch processing
* **[Sort](/guide/nodes/transform/sort-node)** - order records within groups
