Skip to content

Commit 21de149

Browse files
authored
Rework the README around what the package is and how to start (#25)
The README had become a 480-line reference manual. It is reshaped around what the package is, why to use it over n8n's Webhook node, a quickstart, the two nodes at a glance, security, limitations and a docs table; the reference material moves verbatim into six pages under `docs/`. Both codex files and the credential pointed at README anchors that no longer exist and now point at the docs pages — verified that every target file and the `#credentials` anchor resolves.
1 parent fc22e8d commit 21de149

13 files changed

Lines changed: 672 additions & 480 deletions

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ are an agent reading this: the rules above are still the rules.
151151
| For | Read |
152152
| --- | --- |
153153
| Commands, checklist, releasing, local n8n | [CONTRIBUTING.md](CONTRIBUTING.md) |
154-
| What the nodes do, from a user's view | [README.md](README.md) |
154+
| What the nodes do, from a user's view | [README.md](README.md), then [docs/](docs/) |
155155
| Cutting a release, choosing the version | `skills/n8n-nodes-hookdeck-release/SKILL.md` |
156156
| Generic n8n node-building guidance | `.agents/*.md` (upstream n8n scaffold) |
157157

‎CHANGELOG.md‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1717
Config (JSON) is still there for schemes the fields cannot express, and still
1818
wins where they overlap.
1919

20+
### Changed
21+
22+
- The README now covers what the package is, why you would use it and how to
23+
get started; the reference material it used to carry (every trigger option,
24+
the CLI route, signature verification, the action node's operations and the
25+
reliability contract) moved to `docs/`. The documentation links on both
26+
nodes and on the credential now point at those pages rather than README
27+
anchors that no longer exist.
28+
2029
## [0.2.1] - 2026-09-02
2130

2231
### Fixed

‎CONTRIBUTING.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ infrastructure in someone's Hookdeck project on workflow activation, so most of
55
the care here is about what happens on the boundary — activation, deactivation,
66
and an inbound delivery — rather than about the code shape.
77

8-
[README.md](README.md) documents the nodes from a user's point of view. This
8+
[README.md](README.md) and [docs/](docs/) document the nodes from a user's point of view. This
99
file covers building, testing and releasing them.
1010

1111
## Layout
@@ -125,7 +125,7 @@ hookdeck listen 5678 <source> --device-name n8n-<host>-<instance>
125125

126126
A tunnel still works if you prefer one — set `WEBHOOK_URL` to the public address
127127
before starting n8n and the node provisions an HTTP destination instead. See
128-
[How events reach n8n](README.md#how-events-reach-n8n) for what differs between
128+
[Transport](docs/transport.md) for what differs between
129129
the two.
130130

131131
**Uninstalling through the Public API is a one-way door.** n8n's Public API will

‎README.md‎

Lines changed: 106 additions & 472 deletions
Large diffs are not rendered by default.

‎credentials/HookdeckEventGatewayApi.credentials.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export class HookdeckEventGatewayApi implements ICredentialType {
1313
// The node's own docs, not Hookdeck's API reference. Nothing on
1414
// hookdeck.com currently mentions n8n, so a link there answers none of the
1515
// questions someone has while filling in this credential.
16-
documentationUrl = 'https://github.com/hookdeck/n8n-nodes-hookdeck?tab=readme-ov-file#credentials';
16+
documentationUrl = 'https://github.com/hookdeck/n8n-nodes-hookdeck/blob/main/docs/getting-started.md#credentials';
1717

1818
icon = 'file:../nodes/Hookdeck/hookdeck.svg' as const;
1919

‎docs/action-node.md‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Hookdeck Event Gateway node
2+
3+
The action node: manages sources, destinations and connections, and inspects
4+
events, delivery attempts, requests and issues. Every operation is also
5+
usable as an AI agent tool — the
6+
[incident agent example](../examples/README.md#ai-incident-agentjson) wires
7+
three of them up that way.
8+
9+
| Resource | Operations |
10+
| --- | --- |
11+
| Attempt | Get, Get Many |
12+
| Connection | Get, Get Many, Get Count, Delete, Pause, Unpause |
13+
| Destination | Get, Get Many, Get Count |
14+
| Event | Get, Get Many, Get Count, Retry, Mute, Cancel |
15+
| Issue | Get, Get Many, Get Count, Update, Dismiss |
16+
| Request | Get, Get Many, Retry |
17+
| Source | Get or Create, Get, Get Many, Get Count, Get URL |
18+
19+
## Source → Get or Create
20+
21+
Returns the named source, creating it only if it is not there, and gives back
22+
its public URL. Source names are unique within a project, so a plain create is
23+
not safe to re-run — `POST /sources` answers `409` the second time. An upsert
24+
would be, but `PUT /sources` rewrites an existing source's type and
25+
verification, which is the damage the trigger was changed to stop doing.
26+
Getting first avoids both.
27+
28+
It asks the same questions the trigger does — Source Type, Verification, and the
29+
labelled secret fields for HMAC, API key, basic auth and platform schemes — so
30+
a verified Stripe source can be created without hand-writing its config.
31+
Source Config (JSON) is still there for schemes the fields cannot express, and
32+
still wins where they overlap.
33+
34+
## Get Many
35+
36+
Supports **Return All**, which walks Hookdeck's pagination, or a **Limit**.
37+
38+
## Get Count
39+
40+
Answers "how many" without listing them, and takes the same filters.
41+
Connections, destinations, issues and sources are counted exactly and return
42+
`isAtLeast: false`. Events are different — Hookdeck exposes no event count — so
43+
they are counted by paging to a ceiling and returning `isAtLeast: true` when
44+
that ceiling is reached, alongside `countedUpTo`. Treat that as a floor, not a
45+
total. This matters most when the node is used as an AI agent tool: a page size
46+
reported as a count is a number the agent will state as fact.
47+
48+
## Event → Retry versus Request → Retry
49+
50+
**Event → Retry** redelivers an existing event to its connection; the retry
51+
arrives at the workflow with `hookdeck.attemptTrigger` set to `MANUAL` and the
52+
same `idempotencyKey`. **Request → Retry** replays the original inbound request
53+
through the source, which creates a *new* event with a new ID. Use the first to
54+
recover a failed run (see
55+
[Retrying a failed run under Async Retry](trigger.md#retrying-a-failed-run-under-async-retry)),
56+
and the second when you want the request re-evaluated from ingest.
57+
58+
## As an AI agent tool
59+
60+
On this node, `resource` and `operation` cannot hold an expression, so an agent
61+
cannot choose them: one tool node is one operation, fixed when you build the
62+
workflow. Everything else — `id`, `filters` — can carry `$fromAI()` expressions.
63+
Give the agent one node per operation you are willing to let it perform, which
64+
also makes its permissions legible from the canvas.

‎docs/getting-started.md‎

Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
# Getting started
2+
3+
The long version: installing, creating the credential, setting up the trigger,
4+
finding the URL to give your provider, and what this package has been verified
5+
against.
6+
7+
## Install
8+
9+
Follow the [community nodes installation guide](https://docs.n8n.io/integrations/community-nodes/installation/)
10+
and use the package name `@hookdeck/n8n-nodes-hookdeck`.
11+
12+
You'll also need a [Hookdeck account](https://dashboard.hookdeck.com/signup);
13+
the free tier is enough to run real workflows on.
14+
15+
**Self-hosted n8n today.** n8n Cloud installs only community nodes on n8n's
16+
[verified list](https://docs.n8n.io/integrations/community-nodes/installation/verified-install/),
17+
and this package is not on it yet — the submission is pending. Self-hosted
18+
instances can install any community package, so that is where it runs for now.
19+
20+
## Credentials
21+
22+
The nodes authenticate with the API key of a Hookdeck **Event Gateway** project.
23+
24+
1. Open [Hookdeck](https://dashboard.hookdeck.com) and select an Event Gateway
25+
project.
26+
2. Go to **Project Settings → Secrets** and copy the API key.
27+
3. In n8n, create a new **Hookdeck Event Gateway API** credential and paste the
28+
key.
29+
30+
One credential is one project. The key carries the project, so there is nothing
31+
else to configure and no way to reach across projects — everything these nodes
32+
create or read belongs to the project the key came from. To work with a second
33+
project, add a second credential.
34+
35+
A key from an Outpost project will not work here. Outpost is the outbound path,
36+
with its own API; these nodes only speak to the Event Gateway.
37+
38+
## Setting up the trigger
39+
40+
Set a source name, pick the platform sending the events, and activate the
41+
workflow. On activation the node creates a Hookdeck connection whose destination
42+
is this workflow's webhook URL. The public source URL to give your provider is
43+
then listed under **Source → From List** — see
44+
[Finding the source URL](#finding-the-source-url).
45+
46+
Events arrive through Hookdeck rather than directly, so Hookdeck's connection
47+
rules apply to them — retries, delivery rate limits and deduplication are
48+
configured on the node under **Options**. Every option is listed in the
49+
[trigger reference](trigger.md).
50+
51+
> **On wording.** n8n 2.x calls making a workflow live **publishing** — the
52+
> button reads *Publish*, and *Unpublish* to take it down. Older versions, the
53+
> REST API, and the node option **On Deactivate** still say activate and
54+
> deactivate. They are the same thing.
55+
56+
**Verification only starts when a secret is set.** Choosing a Source Type tells
57+
Hookdeck *which* signature scheme that platform uses; it does not enable
58+
verification on its own. Fill in **Webhook Secret** for platform sources, or
59+
set **Verification** for generic ones. [Security](security.md) explains why this
60+
is easy to miss and how to confirm a source is verifying.
61+
62+
### An existing source is adopted, not rewritten
63+
64+
If a source of that name is already in the project, the node binds the
65+
connection to it by ID and leaves its Source Type and Verification exactly as
66+
they are — a source can feed several connections, and rewriting it would change
67+
how their events are verified too. The node's own Source Type and Verification
68+
apply only when it creates the source. Note that this holds even when the types
69+
agree: a Webhook Secret or HMAC setting entered here does not reach a source
70+
that already exists. Whenever a setting is ignored, n8n's server log names it.
71+
72+
To deliberately reconfigure an existing source, turn on **Options → Update
73+
Existing Source**. That applies this node's settings to the source, and to every
74+
connection fed by it.
75+
76+
## Finding the source URL
77+
78+
This is the address you give your provider. It is `https://hkdk.events/<source id>`,
79+
and Hookdeck generates that ID when the source is created, so it cannot be
80+
predicted from the name and does not exist until the source does.
81+
82+
1. **Source → By Name**, type a name.
83+
2. **Publish the workflow.** The node creates the source.
84+
3. **Source → From List.** Each source is listed as `name — https://hkdk.events/...`.
85+
4. Give that URL to Stripe, GitHub, or whatever is sending the events.
86+
87+
There is no need to know the URL before publishing. Nothing can arrive until
88+
your provider has been pointed at it, so publishing first costs nothing.
89+
90+
If the source already exists in Hookdeck, skip to step 3 — pick it from the
91+
list, and the node leaves its Source Type and Verification alone. The link
92+
beside the field in **By Name** mode opens Hookdeck's create-a-source page, if
93+
you would rather make it there first.
94+
95+
To get the URL onto your clipboard, either use the link beside a listed source,
96+
which opens it in the Hookdeck dashboard where there is a copy button, or run
97+
the **Hookdeck Event Gateway** node with **Source → Get or Create** or
98+
**Source → Get URL**, both of which return the URL as workflow data with
99+
copy-on-hover. (The link deliberately does not point at
100+
the source URL itself: that endpoint rejects browser `GET` requests with `405`,
101+
and aiming a link at your own ingest endpoint invites firing requests at it by
102+
accident.)
103+
104+
n8n's own webhook URL is hidden on this node on purpose. It is an internal
105+
address: sending a provider there bypasses Hookdeck and silently loses the
106+
verification, queueing and retries this node exists to provide.
107+
108+
## If Hookdeck cannot reach your n8n
109+
110+
A laptop, or an instance behind NAT, has no address Hookdeck can deliver to.
111+
The trigger detects this on publish, provisions a CLI destination instead of an
112+
HTTP one, and writes the `hookdeck listen` command to run to n8n's server log.
113+
There is nothing to configure, but the CLI route has limits of its own —
114+
[Transport](transport.md) covers both routes and what differs.
115+
116+
## Compatibility
117+
118+
Built against Hookdeck API version `2025-07-01`, and verified end to end on n8n
119+
**2.35.7** with Node.js 22.23.2: package loaded from `N8N_CUSTOM_EXTENSIONS`,
120+
credential created and its test passing, workflow activated, a live event sent
121+
through the source URL and received by the workflow with its signature verified,
122+
forged requests rejected with `401`, and an event sent while deactivated held and
123+
then delivered on reactivation.
124+
125+
It targets `n8nNodesApiVersion: 1`, which n8n 1.x also supports, but only 2.x has
126+
been tested — if you run 1.x, treat it as unverified rather than assumed working.

‎docs/limitations.md‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Limitations
2+
3+
Known boundaries, stated so nobody discovers them in production.
4+
5+
- **Self-hosted n8n only, for now.** n8n Cloud installs only verified community
6+
nodes and this package's verification submission is pending.
7+
8+
- **Sync acknowledgement is capped at 60 seconds.** Hookdeck stops waiting after
9+
that, so a workflow that takes longer must use Async Retry, and with it takes
10+
on recovery itself — see below.
11+
12+
- **The CLI route holds nothing for a listener that does not exist.** When
13+
Hookdeck cannot reach n8n directly, events go through `hookdeck listen`. A
14+
dropped listener is covered by the retry rule, but a connection with *no* CLI
15+
session records no event at all: nothing queued, nothing failed, nothing to
16+
retry. Delivery Rate Limit and Delivery Group are also unavailable on that
17+
route. [Transport](transport.md#what-the-cli-route-cannot-do) has the
18+
measurements.
19+
20+
- **n8n 1.x is unverified.** The package targets `n8nNodesApiVersion: 1`, which
21+
1.x supports, but only 2.x has been tested.
22+
23+
## Departures from the shared reliability contract
24+
25+
This node follows a reliability contract shared with the Hookdeck plugins for
26+
other hosts. Three parts of it work differently here, because n8n requires it:
27+
28+
- **No local deduplication ledger.** The shared contract deduplicates on
29+
"admit when the attempt number exceeds the highest recorded for this event
30+
ID". A trigger node is invoked before the workflow runs and has no completion
31+
hook, so it cannot record whether a run succeeded. Deduplication is therefore
32+
delegated to Hookdeck's own **Deduplication Window** rule, which collapses
33+
repeat events at ingest. Workflows needing stricter guarantees should key on
34+
`hookdeck.idempotencyKey` themselves — the
35+
[process-each-event-once example](../examples/README.md#process-each-event-oncejson)
36+
does exactly that.
37+
- **Async Retry does not re-enqueue failed runs by itself.** For the same
38+
reason — no completion hook — the trigger cannot call
39+
`POST /events/{id}/retry` when a run fails. The capability is exposed instead,
40+
as a workflow step: see
41+
[Retrying a failed run under Async Retry](trigger.md#retrying-a-failed-run-under-async-retry).
42+
Sync mode needs none of this, because a failed run answers 5xx and Hookdeck's
43+
retry rules apply directly.
44+
- **No host-side admission control.** The contract answers `503` with
45+
`Retry-After` when a concurrency cap is reached. n8n governs its own execution
46+
concurrency, so the equivalent lever here is the **Delivery Rate Limit**
47+
option, which caps delivery inside Hookdeck before n8n is reached — on a
48+
directly reachable n8n. Instances receiving events through the Hookdeck CLI
49+
have no equivalent, because a CLI destination does not support rate limiting.
50+
51+
Destination authentication also uses `CUSTOM_SIGNATURE` rather than
52+
`HOOKDECK_SIGNATURE` — [Security](security.md#signature-verification-on-delivery)
53+
explains why.

‎docs/security.md‎

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# Security and the trust boundary
2+
3+
Webhook payloads are third-party input. Two signatures stand between a
4+
provider and your workflow — the provider's, checked by Hookdeck at ingest, and
5+
Hookdeck's, checked by the trigger on delivery — and each has a trap worth
6+
knowing about.
7+
8+
## Verification only starts when a secret is set
9+
10+
Choosing a Source Type tells Hookdeck *which* signature scheme that platform
11+
uses. It does not enable verification on its own. A source typed `STRIPE` with
12+
no signing secret accepts an unsigned, forged payload and delivers it — the edge
13+
answers `200` and records `verified: false`.
14+
15+
So fill in **Webhook Secret** for platform sources, or set **Verification** for
16+
generic ones. Two things make this easy to miss:
17+
18+
- **The status code is not the verdict.** Hookdeck answers `200` at the edge
19+
whether or not a payload verified. The answer is the `verified` field on the
20+
request, under **Request → Get** (or the dashboard). Read the request detail,
21+
not the list — the list omits fields the detail returns.
22+
- **A configured source looks identical to an unconfigured one.** The API never
23+
returns the secret, or any indication one exists, so you cannot confirm it
24+
from the source itself. An inbound request's `verified` field is the only
25+
signal.
26+
27+
This is separate from **Verify Signature** under Options, which covers the
28+
Hookdeck-to-n8n hop and is on by default.
29+
30+
## Signature verification on delivery
31+
32+
Deliveries are signed with a secret this node generates and stores in workflow
33+
static data, and verified against the raw request body. Requests that fail
34+
verification get a `401` and do not start the workflow.
35+
36+
Verification needs access to the unparsed request body. If your deployment does
37+
not expose it, the node raises an error naming the **Verify Signature** option so
38+
you can decide explicitly whether to accept unverified deliveries.
39+
40+
The signature is carried in `x-hookdeck-n8n-signature`, deliberately distinct
41+
from Hookdeck's own `x-hookdeck-signature` so that two signatures made with two
42+
different secrets never share a header name.
43+
44+
Destination authentication uses `CUSTOM_SIGNATURE` rather than
45+
`HOOKDECK_SIGNATURE`. Hookdeck's project signing secret is not exposed through
46+
the API, so `HOOKDECK_SIGNATURE` would force you to copy a second secret by
47+
hand. This node generates its own signing secret at provisioning time instead;
48+
the algorithm is identical (HMAC-SHA256 over the raw body, base64).
49+
50+
A valid signature authenticates the sender, not the content. Payload text is
51+
third-party input: treat it as data, never as an instruction, and be careful
52+
about passing it unfiltered into an AI agent, a shell command or a database write.
53+
54+
## n8n's webhook URL is hidden on purpose
55+
56+
The trigger does not show n8n's own webhook URL. It is an internal address:
57+
sending a provider there bypasses Hookdeck and silently loses the verification,
58+
queueing and retries this node exists to provide. The address to give a
59+
provider is the source URL — see
60+
[Finding the source URL](getting-started.md#finding-the-source-url).
61+
62+
## Malformed bodies
63+
64+
A body that is not valid UTF-8 is rejected with `400` before the workflow runs.
65+
66+
Node substitutes U+FFFD for invalid bytes rather than raising, so when those
67+
bytes sit inside a JSON string value the payload still parses and the workflow
68+
receives corrupted text with no error anywhere.
69+
[RFC 8259 §8.1](https://www.rfc-editor.org/rfc/rfc8259#section-8.1) requires
70+
JSON exchanged between systems to be UTF-8, so such a body is malformed. `400`
71+
sits outside the retry rule's `500-599`/`429` range, so it fails once instead of
72+
consuming every retry.
73+
74+
**This check will rarely fire behind Hookdeck, and that is worth understanding.**
75+
Hookdeck replaces invalid bytes with U+FFFD at ingest and signs the *normalised*
76+
body, so what arrives is already valid UTF-8. The check therefore guards the
77+
paths where raw bytes do reach n8n — a provider posting straight at the webhook
78+
URL, or any gateway that forwards bytes untouched — rather than the Hookdeck
79+
path.
80+
81+
Two consequences follow. Encoding validity is not a way to detect
82+
Hookdeck-upstream corruption: by the time the request arrives it is well-formed.
83+
And a valid signature attests to the bytes Hookdeck sent, not to the bytes the
84+
original sender wrote — "the signature passed, so the body is intact" does not
85+
follow. If lossless payloads matter, compare against the original request under
86+
**Request → Get** rather than trusting the delivered event.

0 commit comments

Comments
 (0)