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

# Example: a reviewed inbox digest

> Build a practical Gmail-to-Slack digest with the CLI, live Action schemas, a review step, and an Audit check.

A support lead wants a weekday summary of the team's inbox in a Slack channel. The agent reads Gmail metadata, prepares a short digest for review, then posts the approved text. The example uses two Actions verified in the Loadout catalog; inspect their live schemas again before running the workflow.

## 1. Inspect the exact Actions and accounts

```bash theme={null}
aident capabilities get --name composio:gmail_tools:gmail_fetch_emails --json
aident capabilities get --name composio:slack_tools:slack_send_message --json
aident vault status --integrationId composio:gmail_tools --json
aident vault status --integrationId composio:slack_tools --json
```

`gmail_fetch_emails` currently accepts a Gmail `query`, `user_id`, `max_results`, and payload controls. Its results can be unsorted or empty, and a `nextPageToken` means more pages remain. `slack_send_message` requires `channel` and one visible content mode. For an ordinary digest, use `markdown_text`, not `blocks`.

If either account is disconnected, run `aident vault connect --integrationId <id> --json` and have the owner complete the returned browser flow.

## 2. Fetch the inbox window

Save this as `gmail-input.json`, replacing the dates with the desired UTC calendar-day window:

```json theme={null}
{
  "query": "in:inbox after:YYYY/MM/DD before:YYYY/MM/DD",
  "user_id": "me",
  "max_results": 50,
  "verbose": false,
  "include_payload": false
}
```

```bash theme={null}
aident capabilities preflight \
  --name composio:gmail_tools:gmail_fetch_emails \
  --input-file ./gmail-input.json --json

aident capabilities execute \
  --name composio:gmail_tools:gmail_fetch_emails \
  --input-file ./gmail-input.json --json > ./gmail-result.json
```

The metadata is enough for a queue digest of senders, subjects, and message times. If the lead needs message content, change the payload controls after reviewing the live schema and handle missing payloads. Follow `nextPageToken` for additional pages, then sort messages by their returned time before summarizing. Keep private email content out of shared logs.

## 3. Review the outgoing digest

Show the lead the exact Slack channel and message before posting. Save the approved content as `slack-input.json`:

```json theme={null}
{
  "channel": "C1234567890",
  "markdown_text": "# Support inbox digest\n\n3 new requests need review.\n\n- Customer A: renewal question\n- Customer B: invoice correction\n- Customer C: account access"
}
```

Use the actual channel ID and a summary grounded in the Gmail result. The example text is illustrative and should never be sent as a fabricated report.

## 4. Validate, post, and verify

```bash theme={null}
aident capabilities preflight \
  --name composio:slack_tools:slack_send_message \
  --input-file ./slack-input.json --json

aident capabilities execute \
  --name composio:slack_tools:slack_send_message \
  --input-file ./slack-input.json --json > ./slack-result.json

aident audit recent --limit 20 --json
```

Post only after preflight passes and the lead approves that exact channel and text. Check the Action result for Slack's `ok`, channel, and message timestamp or link, then confirm the message is visible in Slack. Slack message posting is not idempotent: if the CLI response is interrupted, inspect Audit and the channel before retrying.

Your scheduler can run the read and draft steps each weekday. Keep the review and post gate in the orchestration until the lead authorizes a defined automatic publishing policy. Loadout handles Action access and Audit; your scheduler owns timing and its own failure alerts.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.