Promote the AI agent demo into examples/, delete the duplicates - #20
Merged
Conversation
`demo-setup/` arrived on main as scope creep on an error-rendering fix and was never reviewed as content. Of the eight workflow files across it and `examples/`, four were distinct: the AI agent workflow existed three times, the Stripe ingestion flow twice, and the idempotency shape three times. The `video-*` duplicates were credential-stripped copies made for recording, which existed only because the originals carried a credential id minted on one laptop — fix the credentials and the reason for the copies disappears. The agent workflow is the valuable one: it is the only demonstration in the repo of the action node on an AI Agent's `ai_tool` port, which is a capability n8n's verification asks about specifically, and it was sitting in a directory named after a video. It moves to `examples/ai-incident-agent.json` with the credential ids stripped, the `webhookId` dropped and the source renamed to match the `n8n-example-*` convention the other examples use. The captured `issue.opened` body its prompt reads moves alongside it, because the payload shape is not in Hookdeck's API spec anywhere else. `stripe-idempotency.json` goes. It was `process-each-event-once.json` with a different dedupe key, and two files with an identical node graph invite "which one do I import?" when the answer is "either, then change one field". The README now documents both keys in one place, including that keying on `body.id` needs the trigger's deduplication window set to 0 — otherwise Hookdeck collapses the repeat at the edge and the Remove Duplicates node never sees the thing it is there to catch. Someone importing a second JSON would not have noticed that setting or known why it mattered, which is the reason this is prose. Sync acknowledgement is documented rather than shipped as a fourth workflow. The other examples each teach an expression you would not think to write; Sync is a labelled dropdown that already carries its own description, so a file whose only distinguishing feature is one setting earns less than a paragraph does. It is explained where it is load-bearing: in the agent example's section, because the agent only ever runs when an upstream failure reaches Hookdeck, and on Async Retry it never does. The old flow also branched on `payment_intent.payment_failed` and treated it as a processing failure, which is wrong — a failed payment is a perfectly successful delivery. Three of the four scripts go. They automated rehearsing a video, and they hardcoded one laptop's path and workflow ids minted on one n8n instance. `reset-demo.sh` stays because the reset it performs is not obvious — Hookdeck aggregates delivery issues by (webhook_id, error_code, response_status), so after the first issue exists no further `issue.opened` fires and dismissing the issue does not reset it; only a new connection id does. It now resolves the repo root from its own location, finds the workflow by name, discovers the issue trigger, checks every prerequisite before deleting anything, and scopes its deletions to the demo's own resources rather than clearing the project. `restore-node.sh` goes, but what it encoded does not: n8n's Public API will uninstall a community package and refuses to install one that is not vetted, so until this package is verified an API uninstall cannot be reversed from the API. That is a note in CONTRIBUTING.md now rather than a script. No CHANGELOG entry: nothing here ships. `package.json` `files` is an allowlist of `dist/nodes` and `dist/credentials`.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #18.
demo-setup/had four distinct workflows spread over eight files, three scriptsthat only ran on one laptop, and credential ids from one n8n instance. This
promotes the part worth keeping, deletes the duplicates, and leaves one reset
script that runs for someone who is not the person who wrote it.
Promoted
demo-setup/flow2-ingestion-incident.json→examples/ai-incident-agent.json.The only demonstration in the repo of the action node on an AI Agent's
ai_toolport — the capability n8n's verification asks about — and it existed three times
in a directory named after a video. Credential ids stripped (Hookdeck and
Anthropic),
webhookIddropped, source renamedn8n-example-hookdeck-issuestomatch the convention the other examples use. Node graph otherwise untouched.
demo-setup/issue-opened-payload.json→examples/issue-opened-payload.json.Reference material, not an example: the agent's prompt reads fields out of it and
the payload shape is not documented anywhere else.
Deleted
examples/stripe-idempotency.json— the same three nodes asprocess-each-event-once.jsonwith a different dedupe key.demo-setup/video-ai-agent.json,video-flow1-stripe-ingestion.json,video-flow2-ingestion-incident.json,video-stripe-idempotency.jsondemo-setup/flow1-stripe-ingestion.json,flow2-ingestion-incident.jsondemo-setup/pre-take-reset.sh,restore-node.sh,run-demo.shDocumented instead
Both dedupe keys, in one section.
examples/README.mdnow has a table for"retries of one event" (
hookdeck.idempotencyKey) versus "the provider sent ittwice" (
body.id), and spells out that the second needs the trigger'sDeduplication Window set to
0— otherwise Hookdeck collapses the repeat atthe edge and Remove Duplicates never sees the thing it is there to catch.
Sync acknowledgement, in the agent example's section. Per the decision on the
issue, it is not a fourth workflow file. It is explained where it is load-bearing:
the agent only runs because a failed run answered 5xx, which failed the attempt,
which opened the issue, which fired the webhook. On Async Retry the delivery
succeeds the moment Hookdeck hands the event over and no issue is ever raised, so
the agent never fires. The trade-off (Hookdeck's retries and issue tracking over
your run, versus unlimited runtime and recovery being your problem) is in prose
next to it.
The
resource/operationexplanation. Both arenoDataExpression: true, sothe agent cannot choose them: one tool node is one operation, and the model fills
idandfiltersvia$fromAI(). That is why there are three tool nodes and notone, and it is the non-obvious thing about building an agent on this node.
The reset script
One
demo-setup/reset-demo.sh, plus ademo-setup/README.mdcovering what thedemo shows, prerequisites, exactly what gets deleted, and how to re-run. The
script now:
BASH_SOURCE, so it runs from any checkout and anyworking directory;
instead of the four hardcoded ids it used to carry;
both API keys (exported wins over
.env), an authenticated probe of each APIthat distinguishes "not running" from "key rejected", the workflow existing,
the issue trigger existing — and fails with a sentence about what to fix;
node, so there is nojq/python3dependency;--no-listenfor an n8n that is publicly reachable, where the triggerprovisions an HTTP destination and the CLI is not involved.
bash -npasses. I did not run it: it deletes Hookdeck resources.Judgement calls, rather than instructions followed
reset-demo.shused to delete every connection and destination in the project. It now deletes
connections on the demo's own source and
n8n-*destinations that no connectionreferences. Dismissing open issues is still project-wide, because after the
connection is gone there is nothing left to scope by. All of it is tabulated in
demo-setup/README.md.rather than one hardcoded connection id. With the Sync workflow gone there is no
fixed second workflow to name, and the property that actually matters is that the
agent's own connection is excluded — otherwise a failure in the agent workflow
opens an issue that notifies the agent workflow. If the project has no other
connection the script stops and says so, because the demo would have nothing to
react to.
README.mdsaid "Two importable workflows". It now says three andhas a row for the agent example. Leaving it stale seemed worse than touching a
file the plan did not mention.
package.jsonfilesis an allowlist ofdist/nodesanddist/credentials.recorded in the old
demo-setup/README.md, and says so. The verbatim agentoutput still names
demo-stripe, the source in the project it ran in; I leftthe names as they were rather than editing a quote, and labelled it.
temperature: 0and the resource-locatormodelparameter are called outas load-bearing if anyone edits the model node. A plain string there fails at
runtime with
Could not get parameter "model.value".Nothing found that makes the plan wrong.
Verification
Every workflow JSON was checked by script, not by eye — parses, node names and ids
unique, every
connectionskey is a node, every target node exists, targettypematches its port, no credential carries an
id, no orphan nodes:No file under
nodes/,credentials/ortest/is touched.🤖 Generated with Claude Code
https://claude.ai/code/session_01XtT85W8PPr2S8RW2WhCtpi