The Wait Node Is the Easy Part: 6 Ways an n8n Human-Approval Step Breaks (and the .NET Fixes)
Описание и применение
В статье описывается, как устранить шесть распространённых ошибок в шагах человеческого одобрения в n8n, используя .NET‑API для проверки HMAC‑подписей, временных меток, ключей идемпотентности и конечного автомата состояния.
Задача
Human approval steps in n8n workflows often fail due to signature mismatches, replay attacks, duplicate drafts, conflicting decisions, and retry logic.
Результат
All six failure modes were addressed, yielding a robust human‑approval workflow with 32 passing tests and idempotent, secure draft handling.
Рабочий процесс
- 1. n8n creates draft JSON and signs raw string. 2. Sends POST to .NET API with raw body. 3. API verifies signature against raw bytes and timestamp. 4. API stores draft with idempotency key. 5. Human reviews via webhook, posts decision. 6. API updates draft state using state machine rules.
- 7. n8n resumes workflow based on final state.
Доказательства
The first thing you do is sign the request with HMAC so only your n8n can submit drafts.
The fix: build the JSON string once in a Code node, sign that exact string, and send it as a raw body.
sign the timestamp together with the body, as "{unixSeconds}.{rawBody}"
an idempotency key that n8n can compute the same way on every retry.
A draft can only leave <code>pending</code>, and only once.
- Дата записи: 2026-10-22T13:11:11.892Z