# Digest

### Overview

The **Digest Component** collects incoming data entries and releases them as a batch based on a threshold, a schedule, or a manual trigger via a webhook. This component is useful for aggregating data over time and sending it at controlled intervals.

### Usage

#### Input Parameters

| Parameter    | Type     | Description                                                                                                                                      |
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| `threshold`  | `number` | Number of entries required to trigger output. If set, output is triggered when this count is reached.                                            |
| `webhookUrl` | `string` | A generated webhook URL that allows manual triggering of output.                                                                                 |
| `minute`     | `string` | Specifies at which minutes of the hour the digest should run. Supports cron-like syntax.                                                         |
| `hour`       | `string` | Specifies at which hours of the day the digest should run. Supports cron-like syntax.                                                            |
| `dayMonth`   | `string` | Specifies on which days of the month the digest should run. Supports cron-like syntax.                                                           |
| `dayWeek`    | `string` | Specifies on which days of the week the digest should run. Supports cron-like syntax.                                                            |
| `timezone`   | `string` | Timezone for scheduling, defaults to GMT.                                                                                                        |
| `outputType` | `string` | Format of the output data. Options: `first` (first entry), `array` (all entries as an array), `object` (one entry at a time), `file` (CSV file). |

#### Input Ports

| Port | Description                            |
| ---- | -------------------------------------- |
| `in` | Receives data entries for aggregation. |

#### Output Ports

| Port  | Description                                                                                            |
| ----- | ------------------------------------------------------------------------------------------------------ |
| `out` | Emits the aggregated data based on the configured condition (threshold, schedule, or webhook trigger). |

### Instructions

1. **Set a Threshold (Optional)**
   * Define the `threshold` parameter to release data when a certain number of entries are reached.
2. **Schedule Batch Processing (Optional)**
   * Configure `minute`, `hour`, `dayMonth`, and `dayWeek` to process batches at specific times.
3. **Manual Trigger via Webhook (Optional)**
   * Use the `webhookUrl` to release entries manually at any time.
4. **Select Output Type**
   * Choose how the collected data should be sent (`first`, `array`, `object`, or `file`).

### Notes

* **Supports multiple trigger methods:** Data is released either via count (`threshold`), time (`schedule`), or manually (`webhook`).
* **Flexible scheduling:** Uses cron-like syntax for precise control over execution times.
* **Different output formats:** Users can choose between receiving data as an array, a single entry, or a downloadable CSV file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.appmixer.com/connector-configuration/utils/controls/digest.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
