# Recipe: a nightly digest from n8n, written into onecell

A copy-paste prompt for an n8n AI Agent node: each night it reads the last digest in onecell, compares, and writes a one-screen digest of what needs a person.

> [!info]
> **For:** an operator or founder whose numbers live in other tools: payments, tickets, sign-ups. **When:** set up once; it runs every night. **Takes:** about fifteen minutes in n8n. **You get:** a dated digest in onecell each morning that compares with the night before and lists what needs a person.

## The prompt

In n8n: a *Schedule* trigger, the nodes that fetch your data (Stripe, a database, a sheet), then an *AI Agent* node with an *MCP Client* tool pointing at `https://onecell.io/api/mcp` with a Drafts only key as a Bearer header. Paste this as the agent's prompt, and pass the fetched data in.

```text
You write the nightly digest for <what it covers> into onecell.
The day's data is below.

1. Search onecell for the previous "Digest: <what it covers>" in <cell>
   and read it with get_document. Note anything it left open.

2. Write "Digest: <what it covers>, <date>" with create_document in
   <cell>, slug digest-<yyyy-mm-dd>, tags ["digest", "src:n8n"],
   dry_run false:
   - a stats block: the four numbers that matter, each with the change
     since the previous digest
   - Needs a person: a checklist, only things someone must act on
   - a small table comparing with the previous night
   - one line on what the previous digest left open, and whether it
     cleared

3. Keep it to one screen. If nothing needs a person, say so in one line.
   Never include card numbers, emails or other personal data.

Data:
{{ $json }}
```

## What your agent does

1. Reads last night's digest
   search and get_document, so each digest compares with the one before and follows up what it left open.
2. Picks what matters
   Four numbers with their change, and only the items a person must act on.
3. Writes a dated draft
   One document a night, with a slug from the date, so a rerun can't write twice.
4. Leaves personal data out
   Totals and references, never card numbers or emails.

## What you get

A digest for Tally, a made-up invoicing app. It caught failed payments rising two nights running, and a dispute with a deadline.

<!-- onecell:block {"type":"embed","documentId":"44c325d2-7e0a-4838-9e7a-6d2c3f6ed848"} -->
[Sample nightly digest: Tally payments, 18 August](https://onecell.io/p/sample-nightly-digest-payments)

## Variations

<details>
<summary>No AI, just the numbers</summary>

Skip the agent. Use an *HTTP Request* node that calls `create_document` with a stats block built from the data, as in the Automations guide. Cheaper, and exactly the same every night.

</details>

<details>
<summary>Remember what changed for good</summary>

Add: “If something changed that will still matter next month, such as a new pricing tier or a lost customer, also call `remember` with it.” The fact then turns up in every later search and briefing.

</details>

<details>
<summary>Support tickets instead of payments</summary>

Feed it the day's tickets and ask for themes, each with a count and one example, and which ones already have an answer in onecell.

</details>

## Tips

- Write to a cell the team can see, so the Monday brief picks digests up.
- Ask for “only things someone must act on”. A digest that lists everything gets ignored by Wednesday.
- One key per workflow, Drafts only, stored as an n8n credential.

---

Part of [onecell recipes](https://onecell.io/help/recipes): copy-paste prompts for using onecell in your work.
