# Email Capture — Health Check

On weekdays at 18:00, warns by e-mail when no captured e-mail reached the non-reply@ mailbox in the last 24 hours.

| Platform | Workflow ID | Status | Version | Last saved | Nodes | Systems |
| --- | --- | --- | --- | --- | --- | --- |
| n8n | M7KVrKzRRyutPwTC | Inactive | ee7ed31c-96e3-4c74-b39f-c544e52ec692 | 2026-11-06T17:16:52.009Z | 7 | Communication, Tooling and Access |

Email Capture — Health Check tells someone when the e-mail capture stops. The capture address suppresses bounces, so a broken routing rule in Google Workspace, a deleted Gmail filter or an expired credential fails without any sign. On weekdays at 18:00 this workflow searches the capture mailbox for e-mail labelled `CRM/CRM - Outbound` or `CRM/CRM - Inbound` in the last 24 hours. When nothing arrived, it sends one alert e-mail from the mailbox to the address in Config.

The workflow is **inactive**. It writes to no business system; its only output is the alert e-mail. The Communication maintainer owns the capture mailbox and receives the alert; the Tooling and Access maintainer owns the Gmail credential.

## Flow

Generated from the n8n version in the box above: every box is a node and every arrow is a connection in n8n. Pink pills are triggers, yellow hexagons are If and Switch nodes with their outputs on the arrows, blue cylinders read (Airtable, Data Table, HTTP GET), green cylinders write, purple boxes call another workflow, and dashed arrows are error outputs.

```mermaid
flowchart TD
  subgraph g0["Check the capture mailbox"]
    n5(["Weekdays 18:00"]):::trigger
    n1["Config"]:::logic
    n0["Captures Today"]:::logic
    n2["No Capture?"]:::logic
  end
  subgraph g1["Alert"]
    n4{{"Silent Day?"}}:::decision
    n3["Send Alert"]:::logic
  end
  n5 --> n1
  n1 --> n0
  n0 --> n2
  n2 --> n4
  n4 -->|true| n3
  classDef trigger fill:#fde7f3,stroke:#d6409f,color:#111
  classDef decision fill:#fff7e0,stroke:#c99a00,color:#111
  classDef read fill:#e8f1ff,stroke:#3b82f6,color:#111
  classDef write fill:#e7f8ee,stroke:#16a34a,color:#111
  classDef subflow fill:#f3e8ff,stroke:#9333ea,color:#111
  classDef wait fill:#f1f1f1,stroke:#888,color:#111
  classDef logic fill:#ffffff,stroke:#999,color:#111
```

## Systems it touches

| System | Through | Reads | Writes |
| --- | --- | --- | --- |
| Gmail (capture mailbox) | Captures Today, Send Alert | Labelled e-mail of the last 24 hours | The alert e-mail |

No Airtable table is read or written.

## Schedule and check

Weekdays 18:00 runs Monday to Friday at 18:00 in the workflow's time zone, America/Recife. Config holds `alertTo`, the address that receives the alert, and `mailbox`, the capture address named in the alert text. Captures Today searches the mailbox with `newer_than:1d (deliveredto:non-reply+crm-out@snackprompt.com OR deliveredto:non-reply+crm-in@snackprompt.com)` and returns at most one message; it outputs an empty item when nothing matches. No Capture? counts the messages found and marks the day as silent when the count is zero and `alertTo` is set. Silent Day? sends the item to Send Alert only on a silent day.

## The alert

Send Alert sends a plain-text e-mail from the capture mailbox to `alertTo`. Subject: "[Email Capture] No e-mail captured today" with the date. The text names the mailbox and lists what to check, in order: the two routing rules in the Admin Console and its Email Log Search, the Gmail filters of the mailbox, and the Email Capture workflow with its Gmail credential.

## Nodes

The workflow has 7 nodes: 6 that run and one sticky note. For an If node, output 0 is true and output 1 is false.

| Node | Type | What it does |
| --- | --- | --- |
| Weekdays 18:00 | scheduleTrigger | Runs Monday to Friday at 18:00 |
| Config | set | Alert address and the capture mailbox name |
| Captures Today | gmail | Searches the mailbox for capture labels in the last 24 hours |
| No Capture? | code | Counts the matches; silent when zero and an alert address is set |
| Silent Day? | if | Continue only on a silent day |
| Send Alert | gmail | Sends the alert e-mail |
| Sticky Note | stickyNote | Setup note on the canvas; does not run |

## Connections

| From | Output | To |
| --- | --- | --- |
| Weekdays 18:00 | 0 | Config |
| Config | 0 | Captures Today |
| Captures Today | 0 | No Capture? |
| No Capture? | 0 | Silent Day? |
| Silent Day? | 0 | Send Alert |

## Settings and error handling

| Setting | Value |
| --- | --- |
| Status | Inactive; never published |
| Execution order | v1 |
| Time zone | America/Recife |
| Error workflow | None |
| On error | Stop the workflow (default) on every node |
| Caller policy | Workflows from the same owner |
| Execution data retention | Instance default; this workflow sets none |

## Before activating

| Step | Where | State at the last review |
| --- | --- | --- |
| Captures Today and Send Alert use the OAuth credential of `non-reply@snackprompt.com` | n8n | Done: both use the credential `no-reply mail` |
| Config `alertTo` holds the address that receives the alert | n8n | Empty; with it empty the workflow never alerts |
| Email Capture is active and the capture labels exist | Gmail, n8n | Pending |

## Known gaps

| Gap | Effect |
| --- | --- |
| The check runs only on weekdays | A capture that stops on Friday evening is reported on Monday |
| One quiet business day also triggers the alert | A day with no customer e-mail at all looks like a failure |
| The alert goes to one address | Change `alertTo` to a group address to reach more people |

## Keep this page in sync

The box at the top shows the n8n version this page describes. Open the workflow in n8n: when its last save is newer than the date in the box, this page is out of date until the next review. Every node and every connection of that version is in [Nodes](#nodes) and [Connections](#connections).