# Notification retry rehearsal / 通知重试演练

Tested 2026-10-16 on Windows 11, n8n 2.43.7, Node.js 24.19.0.
Private SQLite, no website database, no external accounts. Manual CLI execution of an imported inactive workflow. Local SMTP receiver bound to 127.0.0.1:2525; synthetic `.invalid` addresses only. SMTP acceptance is not inbox delivery.

## Preset checks / 预设检查

- REQ-1 first@example.invalid: eligible once per input batch.
- Duplicate REQ-1: flagged duplicate-in-batch, not sent.
- REQ-2 not-an-email: flagged invalid, not sent.
- REQ-3 retry@example.invalid: first RCPT attempt gets SMTP 450; subsequent attempts accepted.
- Separate REQ-4 fail@example.invalid: every RCPT attempt gets 450; run should fail after two attempts.
- Two executions share one receiver for the repeat trial, but no application deduplication state.

## Flow / 流程

Manual trigger -> synthetic raw Set input -> Code validation and in-memory batch deduplication -> IF eligible -> Loop Over Items (batch size 1) -> Send Email -> back to loop. Done output -> completion. Ineligible branch -> inspect rejected items. Send Email: maxTries 2, waitBetweenTries 1000ms, stop on error.

The baseline removes only the loop and passes both eligible items directly to Send Email. Published workflow is the single-item version. No credentials are in the download. It is inactive and has no schedule or webhook.

Native dependencies were installed locally; `n8n import:workflow --input=<private-copy>` and `n8n execute --id=gitstarsNotificationLab` ran against the private SQLite directory. A private synthetic SMTP credential selected only the loopback receiver. CLI output stayed in ignored local logs; published results retain receiver events and selected execution outputs, not account secrets.

The receiver implements EHLO, MAIL FROM, RCPT TO, DATA and QUIT. DATA ending in a dot records an accepted message. It never forwards mail. At RCPT it returns 450 for the first retry address attempt, then 250; it always returns 450 for the failure address. All other synthetic recipients receive 250. No authentication or STARTTLS is offered. This setup must not be exposed publicly or copied to a real provider.

## Observations / 观察结果

| Trial | First accepted | Retry accepted | Failed-address accepted | Exit |
| --- | --- | --- | --- | --- |
| Batch retry | 2 | 1 | 0 | 0 |
| One-item retry | 1 | 1 | 0 | 0 |
| One-item flow executed twice | 2 | 2 | 0 | 0, 0 |
| Permanent rejection | 0 | 0 | 0 | 1 |

See results.json for actual event order, results.csv for counts, and execution-checks.json for selected node outputs. In the repeat case the receiver rejects only the first retry attempt across both executions: total retry attempts 3.

## Reproduction boundaries / 复现边界

Import workflow.json into an isolated n8n workspace and select your own local mail-catcher credential. It intentionally refuses normal domains. An ordinary mail catcher that accepts everything validates wiring only; reproducing the failure counts requires a receiver configured with the RCPT behavior above. No catcher or credentials are hosted by this website.

workflow-bundle.zip contains workflow.json, this method, results.json, results.csv and execution-checks.json only. Extract it, then import workflow.json, not the ZIP. The bundle contains no credentials, executables or development runner.

This is not an external form integration, spreadsheet integration, unattended deployment, delivery guarantee, throughput benchmark or security certification. It has no durable deduplication, atomic claim, recovery queue, operator alert, concurrency test, provider idempotency, bounce handling or inbox-delivery test. Re-running sends again. Synthetic email validation is deliberately incomplete. Keep real customer information and provider secrets out of the fixture.

下载流程只适合演练：先用自己控制的本地接收器，不连接真实客户账号。普通接收器未必会模拟失败，不能据此声称已验证失败重试。上线前必须另外处理持久去重、并发、状态不明的投递、告警与恢复。

Official references: https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.splitinbatches/ and https://docs.n8n.io/sustainable-use-license/ . n8n is distributed under its applicable license; no n8n binaries or dependencies are included here.
