n8n workflow lifecycle official
Use when starting, designing, organizing, finishing, or shipping an n8n workflow. Covers visual layout (sticky notes), descriptions that capture the *why*, node names, validation, testing, folders/projects, and publishing. Triggers on create_workflow_from_code, update_workflow, validate_workflow, publish_workflow, archive_workflow, "design", "lay out", "organize", "structure", "sticky", "describe this workflow", "ship", "deploy", "publish", "name this workflow", or any folder/project organization request.
By- name:
- n8n-workflow-lifecycle-official
- description:
- Use when starting, designing, organizing, finishing, or shipping an n8n workflow. Covers visual layout (sticky notes), descriptions that capture the *why*, node names, validation, testing, folders/projects, and publishing. Triggers on create_workflow_from_code, update_workflow, validate_workflow, publish_workflow, archive_workflow, "design", "lay out", "organize", "structure", "sticky", "describe this workflow", "ship", "deploy", "publish", "name this workflow", or any folder/project organization request.
n8n Workflow Lifecycle
The six stages
- PLAN. Gather requirements, ask clarifying questions, search for existing workflows / sub-workflows that already do this.
- BUILD. Write SDK code (with skills: subworkflows, node-config, expressions, code-nodes; readability section below). Use
validate_node_configas a side-channel for iteration, debugging, or small single-node edits: clean per-parameter errors without full-graph noise. Not a replacement forvalidate_workflowin VALIDATE. - VALIDATE.
validate_workflow+get_workflow_detailsfor connections, then have the user verify per-node credentials and create anything you couldn't (missing credentials, folders, etc). - TEST.
test_workflowwithprepare_workflow_pin_data; iterate until output matches intent. - PUBLISH.
publish_workflowonly after stages 3 and 4 are clean. - HANDOFF. Production handoff: how to trigger it, what it returns, what to watch, what they should know to use it well.
Skipping a stage produces workflows that look done but break in production, or solve the wrong problem entirely. Three most common skips:
- Build before plan. "User asked for X, I'll start coding" without confirming what X means, whether the same logic already exists as a sub-workflow, or which folder/project it belongs in. Cheaper to ask one clarifying question than to rebuild after.
- Test before user-side wire-up. Running
test_workflowbefore the user has verified credentials per node hits the wrong service or 401s. Get the user-side setup done as part of VALIDATE. - Publish without test. Validation passing means the SDK is well-formed; it does NOT mean the workflow is correct.
Non-negotiables
- Validate AND verify before publish. Run
validate_workflowon the SDK code, thenget_workflow_detailsafter every create/update to check theconnectionsobject. Validation alone misses silently dropped wires.validate_node_configis a separate per-node iteration tool, not a replacement for this step. - Surface known limitations to the user. If folders, MCP access, or any other limitation blocks the request, say so explicitly and propose a path. Don't silently dump workflows at the wrong location or report success on a request you couldn't fully fulfill.
- Ask before testing when not-auto-pinned downstreams have side effects.
test_workflowauto-pins triggers, credentialed nodes, and HTTP Request nodes. Everything else (Code, Edit Fields, If, Wait, Execute Command, file ops, sub-workflow calls, Data Tables) runs for real. Ask the user before running if any of those would fire user-visible side effects. Seereferences/TESTING.md.
Strong defaults
- Test before publish with
test_workflow+prepare_workflow_pin_data. Seereferences/TESTING.mdfor mocking by trigger type, pinning individual nodes, and the side-effect surface. Looser for internal one-off scripts you watch run. - Always include a
descriptiononcreate_workflow_from_code. 1-2 sentences capturing what and why. See "Readability" below.
Validation isn't enough
validate_workflow runs schema and shape checks: missing parameters, type errors, references to non-existent nodes. It does not catch:
- The
.to()-inside-.add()connection trap (silent dropped wires) - Fan-outs collapsed to a single connection
- Merge index off-by-one
- Error outputs wired without
onError: 'continueErrorOutput' - Parameters that are syntactically valid but semantically wrong (e.g., wrong sheet ID, wrong column name)
Validation is necessary but not sufficient. The real gate is:
validate_workflowpasses.get_workflow_detailsreturns aconnectionsobject that matches your intent.test_workflowproduces the right output on representative pinned data.
Only then call publish_workflow.
For the full pre-publish checklist, see references/VALIDATION_CHECKLIST.md.
Execution model
n8n workflows execute sequentially, left-to-right, top-to-bottom. Branches that visually appear parallel on the canvas (fan-out from one source to multiple downstreams) run one after the other, ordered by the target nodes' Y-position on the canvas. There is no automatic concurrency.
Practical consequences:
- A fan-out to three slow HTTP calls runs in series; total latency is the sum, not the max.
- "Parallel" branches share workflow state in execution order; downstream consumers see whatever the last branch left.
- For real concurrency, dispatch sub-workflows with
mode: 'each'andwaitForSubWorkflow: false. Seen8n-loops-officialandn8n-subworkflows-official.
This is platform behavior, not an SDK quirk. Don't design fan-outs around assumed parallelism.
Naming conventions
Bad names compound: a workflow that's hard to find six months from now gets duplicated.
For full conventions (verb-noun patterns, capitalization, prefixes), read references/NAMING_CONVENTIONS.md. Short version:
- Workflows: verb-first, scoped.
Send weekly customer reportnotCustomer report sender. - Nodes: describe what they do in this workflow, not the node type.
Fetch active customersnotPostgres1. - Sub-workflows: plain descriptive name (
Parse RFC2822 date); carry the category in tags (subworkflow, a domain tag,tool), not a name prefix.search_workflows({ tags })filters on them. Seen8n-subworkflows-officialreferences/NAMING_AND_DISCOVERY.md. - Tags: the AI-side discovery mechanism (n8n 2.27.0+). The MCP lists (
list_workflow_tags), filters (search_workflows({ tags })), and attaches them (update_workflowaddTags/removeTags, auto-creating unknown names). Lowercase, 2-4 per workflow. Seereferences/NAMING_CONVENTIONS.md.
Readability: descriptions, node groups, sticky notes, conventions
Four levers carry the readability load, grouping from 7 boxes on and the other three from about 5 nodes on:
Workflow
description: capture the why, including AI-derived context. Two sentences: what it does and why it exists. Most importantly, capture context you had during conversation that won't otherwise survive into the file (the constraint that drove the design, why this approach over the alternative, the user's reason for asking). Otherwise it dies with the chat.Node groups: the only way to group nodes. Named frames, one per logical step (
Validate input,Enrich order,Notify). Organization only, members run inline (reuse/isolation is a sub-workflow's job). Readreferences/NODE_GROUPS.mdbefore creating or editing any group, and after any save that reported a group problem. The three things to know up front:- When: more than 7 boxes with every group collapsed, typically into 3-5 groups. A box is the trigger, each group, and each ungrouped node; sub-nodes and sticky notes don't count.
- A group must be a connected, trigger-free section with at most one member facing out in each direction, with an Agent's sub-nodes all in or all out. Members are node names, not ids.
- An invalid group op is skipped, not fatal, and unrelated edits can silently delete a valid existing group, so a save that looks clean can have lost one. The exception is a description over 145 characters: that rejects the whole
update_workflowcall. Read the group fields on every create and update, and repair before reporting done.
Sticky notes: annotate, don't group. Grouping is the node group's job (above). Stickies carry what a group name can't: a callout, a TODO, a warning. Read
references/STICKY_NOTES.mdbefore placing one.- On create, always anchor.
sticky(content, [nodes], { color })derives the box from the nodes it wraps, after layout. Coordinates guess at a canvas that doesn't exist yet; omitting both is worse, since the fallback centers the note under the whole graph and only dodges other stickies, never nodes. If you can't name the nodes a note is about, it doesn't belong on the canvas. - Three roles, and the anchor set follows from the role. A stage zone anchors one stage's nodes; a callout anchors the single node it warns about; a gray title band anchors the whole flow and is rare, only for a canvas you're deliberately leaving ungrouped.
- Scale: under ~5 nodes, none. From 5 to 7 boxes, one zone per stage. Over 7, node groups section and document the canvas via their descriptions, and you anchor nothing to a grouped node: those positions are collapsed-chip slots, so the note draws over the expanded group and matches nothing collapsed.
- Zones need room the derived box doesn't give. Declare
height: 272for a one-row zone,464for a branch fan (add 32 for Message an Agent v2+). Never declare a width. Then, once the canvas is final, widen every zone in one batchedupdate_workflow:x = min(node.x) - 56,width = span + 112. Computed from the nodes, so re-running is harmless, but it's a finishing step, not per-edit. update_workflowhas no sticky op. A sticky there is anaddNodeofn8n-nodes-base.stickyNotewithcontent,width,height,colorinparameters; an omittedpositionmeans[0, 0].- Content and color:
### Titlecarrying the point, plus one short line. Only the top 64px clears the nodes, so never add height for more text; longer prose goes in nodenotesor the workflowdescription.color1-7 stands for what happens there: green creates or involves a person, red is destructive or irreversible, blue is routing and transformation, gray is documentation. A user preference, then nearby workflows, outrank that.
- On create, always anchor.
Node
notesfor non-obvious config. Explain why a workaround exists or a Code node does what it does. Don't annotate obvious nodes.
Plus two notes:
- Match existing project conventions before introducing your own. Skim a couple of nearby workflows via
search_workflows+get_workflow_detailsand mirror the sticky palette, naming, and description style. - Layout runs on create, never on update.
create_workflow_from_codelays out every node that doesn't carry an explicitposition, so omit them and let it. Setting some and not others is the bad case: yours are honored and the rest are laid out around them, which is how nodes end up stacked.update_workflowruns no layout at all, so anything you add sits exactly where you put it.
Folder management
On a registered instance the MCP creates and organizes folders: create_folder, update_folder (rename/move), move_workflows_to_folder, and a folderId on create_workflow_from_code for create-time placement. search_folders resolves names to IDs.
If the user wants a folder that doesn't exist, create it, don't build at the root and report success. If the folder tools are absent, the instance isn't registered: folders are blocked in the UI too, so ask the user to register (free, in Settings) rather than create the folder by hand. No tool deletes a folder, and projects are read-only.
For the full protocol, read references/FOLDER_LIMITATIONS.md.
Per-workflow MCP access
Each workflow has an availableInMCP flag. The default depends on who created it:
- Workflows created via the MCP (
create_workflow_from_code) default to MCP-accessible. No toggle step needed: you can find them viasearch_workflowsand operate on them right away. - Workflows created in the n8n UI can default to off. Until the user flips the toggle, the workflow is invisible to you.
The #1 case where this bites: the user built a workflow manually in the UI and now wants you to inspect or edit it, but you can't see it. Before assuming it doesn't exist or you're searching the wrong project, ask the user to confirm MCP access is enabled.
Sub-workflows called via MCP: the caller can use them as code-level sub-workflows without the toggle. To invoke as MCP-exposed tools, the toggle is required (and is on by default for MCP-created sub-workflows).
For the full case-by-case guide and user-facing message, read references/MCP_ACCESS_PER_WORKFLOW.md.
User-side wire-up (part of stage 3)
There are things the user has to do that you can't, and they need to be done before testing, otherwise the test fires against the wrong credential, hits a missing folder, or 401s. Surface these as a short list during VALIDATE, before TEST:
- Verify credentials per node.
newCredential('Label')is cosmetic. n8n auto-assigns the most recently edited credential of the right type, which silently picks the wrong one when the user has multiples (prod vs staging Gmail, two API keys). Tell them: "open every node that uses a credential and confirm the right one is selected." Seen8n-credentials-and-security-officialnon-negotiable #2. - Create missing credentials. If the user pasted a secret in chat or the workflow needs an account that doesn't exist yet, name the credential type and have them create it in the UI.
- Register for folders (only if the tools are missing). Folder tools need a registered instance. If they're absent, the user registers (free, in Settings) before you can create or place folders; otherwise you handle folders yourself. See
references/FOLDER_LIMITATIONS.md. - MCP access toggle for user created workflows. Workflows you create via the MCP are MCP-accessible by default. The toggle only matters when the test depends on a UI-created workflow being callable from the MCP. See
references/MCP_ACCESS_PER_WORKFLOW.md.
Don't proceed to TEST until these are confirmed done.
Handoff: production handoff (stage 6)
After publish_workflow and a clean test, the workflow is technically live, but the user still needs enough context to actually use it in production. Treat this like the freelancer-to-customer handoff: short, structured, and oriented toward how they'll operate it from here.
What to include:
- How it triggers. Webhook URL (live now that it's published), schedule cadence + timezone, manual trigger button, sub-workflow caller, whichever applies. For webhooks, hand them the URL.
- What it returns / where the data goes. One sentence. "Writes new rows to the
customerstable," "responds JSON to the caller," "fires the on-call Slack channel." - How to invoke it for real, with an example. "Hit the webhook with
curl -X POST <url> -d '{...}'," "trigger manually from the UI," "wait until 09:00 UTC for the first scheduled run." - What to watch. Failure modes that surface as alerts/errors, rate-limit ceilings on upstream services, and where to look first when something breaks (executions tab, error workflow, audit log, etc.).
- MCP access status. If you created the workflow via the MCP, it's already MCP-accessible. Let the user know they can revoke access in Settings if they want to lock it down. If they hand-built it in the UI, they need to flip MCP access on for any other agent to call it.
- Anything still pending on their side. Secret rotation if a token was pasted in chat, follow-up wiring you couldn't reach, known TODOs left in stickies.
Keep it tight: half a dozen bullets, not a wall of text. The user shouldn't have to ask "ok, what now?"
Reference files
| File | Read when |
|---|---|
references/NAMING_CONVENTIONS.md |
Naming a new workflow, sub-workflow, or node |
references/NODE_GROUPS.md |
Before creating or editing any node group, or after a save reported a skipped or removed group |
references/STICKY_NOTES.md |
About to add, move, or resize a sticky note on either tool |
references/FOLDER_LIMITATIONS.md |
User mentions a folder, project structure, or wants workflows organized |
references/MCP_ACCESS_PER_WORKFLOW.md |
Building a workflow that you or another agent will call via MCP |
references/VALIDATION_CHECKLIST.md |
Just finished a workflow and about to call publish_workflow |
references/REVIEW_CHECKLIST.md |
Reviewing or auditing an existing workflow (any age, any author). Severity-tiered findings, distinct from the pre-publish validation checklist |
references/TESTING.md |
About to run test_workflow or execute_workflow, mocking trigger input, side-effect protocol |
Anti-patterns
| Anti-pattern | What goes wrong | Fix |
|---|---|---|
Calling publish_workflow without validating |
Broken workflows reach production | Validate, verify connections, then test |
| Creating workflows at root because the requested folder doesn't exist | Workflows get lost, and the user has to drag them manually | Surface the limitation before building |
Generic node names (HTTP Request1, Set2) |
Workflows are unreadable a month later | Rename to describe the action |
Missing description on create_workflow_from_code |
Workflow invisible in search, no context for maintainers | Always include 1-2 sentences |
| Asking the user to flip the MCP access toggle on a workflow you created via the MCP | Wastes their time, agent-created workflows default to MCP-accessible | Only mention the toggle for UI-created workflows, or when the user wants to revoke MCP access on an agent-created one |
Running test_workflow on a workflow with side-effecty non-pinned downstreams without asking |
Real Data Table write, real sub-workflow side effects, real Execute Command output, etc. Triggers + credentialed nodes + HTTP get pinned, nothing else does | Ask first. See references/TESTING.md. |
| No node groups on a canvas over 7 top-level boxes | Reader has to read every node to find what they want | Group each logical step. See references/NODE_GROUPS.md |
Reporting a create or update as done without reading its group fields (skippedGroups on create; skippedOperations / removedGroups on update) |
A group op was silently skipped, or an existing group was deleted by an unrelated edit, and the save still looked successful | Check them on every call and repair. See references/NODE_GROUPS.md |
| Sticky note used to fake a group, or sticky-of-every-color | Grouping is the node group's job / color becomes pure noise | Group with a node group; reserve stickies for callouts, one color per category |
Hand-positioned stickies on create_workflow_from_code |
Coordinates are chosen before layout runs, so the note lands away from the nodes it describes | Pass the nodes to sticky(content, [nodes]) and let the box be derived. See references/STICKY_NOTES.md |
description: "Sends Slack." |
Adds nothing visible from the trigger and Slack node | Include why + AI-derived context: "Sends weekly summary to founders. Replaces manual report that kept getting skipped." |
| Designing fan-out branches as if they execute concurrently | n8n runs fan-out branches sequentially, top-to-bottom by Y-position. Total runtime is the sum of branches, not the max | For real concurrency, dispatch via Execute Workflow with mode: 'each' + waitForSubWorkflow: false. See n8n-subworkflows-official "Fire-and-forget parallelization" |
Open this reference as its own page
Folder management
On a registered instance the MCP creates, renames, and moves folders, and moves workflows between them. On an unregistered instance the folder tools don't exist, and folders are blocked in the n8n UI too, so the fix is to register, not to build folders by hand.
Tools
| Operation | Tool |
|---|---|
| Resolve a folder name to its ID | search_folders |
| Create a folder (optionally nested) | create_folder (needs projectId) |
| Rename or move a folder within its project | update_folder |
Move workflows into a folder, or to root (folderId: "0") |
move_workflows_to_folder (≤20, same project) |
| Place a workflow into a folder at create time | create_workflow_from_code folderId (needs projectId) |
No tool deletes a folder, and projects are read-only (search_projects only; no create/rename project).
Protocol when the user mentions a folder
search_foldersfor the project. Multiple name matches → ask which one.- Exists → place workflows there:
folderIdoncreate_workflow_from_code, ormove_workflows_to_folderfor ones that already exist. - Doesn't exist →
create_folder, then place. No need to hand it back to the user. - Folder tools absent → the instance isn't registered. Ask the user to register it (free Community-edition registration in Settings); folders are unavailable in the UI until then.
Confirm the destination by folder name, not ID. move_workflows_to_folder can partially succeed: report anything in failed.
Many workflows at once
move_workflows_to_folder takes up to 20 IDs per call and requires all to share the folder's project. Create the folder once, then batch the moves.
Open this reference as its own page
Per-workflow MCP access
Each workflow has an availableInMCP flag, controlled by a toggle in the workflow's UI settings. When false, the workflow doesn't appear in search_workflows results and the agent can't see it.
Defaults
- Agent-created workflows (via
create_workflow_from_code) default toavailableInMCP: true. No toggle step needed. - UI-created workflows can default to off. If a user describes a workflow you can't find, this is the most likely cause.
When this matters
User asks about a workflow you can't find
By far the most common case. You search via search_workflows and either get nothing or a result set that doesn't include the workflow they're describing. Before assuming it doesn't exist:
"I can't see a workflow matching that description. Could you check that MCP access is enabled on it? In the n8n UI, open the workflow, go to Settings, and toggle MCP access on. Workflows aren't visible to me until that's enabled."
If they confirm it's already enabled, then dig into other causes (wrong project, wrong instance, archived).
Restricting access to a workflow you built
Agent-created workflows are visible to MCP by default. To revoke access (e.g., temporarily disabling a destructive tool), the user toggles the flag off in the UI.
Why this exists
Auto-exposing every workflow to MCP would be a security hole: any agent with MCP access could trigger or modify any workflow, including production-critical ones. The opt-in toggle for UI-created workflows is intentional. Agent-created workflows default on because the agent already has full MCP access during creation.
Open this reference as its own page
Naming conventions
A workflow built today gets searched, debugged, and extended six months later by people who weren't in the room. These conventions optimize for findability and readability over brevity.
Workflows
Format
<Verb> <object> [scope/qualifier]
Verb says what it does, object says to what, qualifier (optional) narrows scope.
| ✅ Good | ❌ Avoid |
|---|---|
Send weekly customer report |
Customer report sender (noun-first, ambiguous frequency) |
Sync Stripe customers to Postgres |
Stripe-Postgres (no verb, unclear direction) |
Notify on-call when error rate >5% |
Error monitor (vague: what does it do?) |
Daily: clean up stale Slack DMs |
Slack cleanup (no schedule, no specificity) |
Capitalization
Sentence case, not Title Case. Easier to scan, and matches normal prose. Acronyms keep their casing.
Punctuation
- Colon for category prefix on top-level workflows:
Daily: clean up stale Slack DMs,Webhook: report-request. Sub-workflows categorize by tag, not name prefix (see Sub-workflows and Tags below). - No emojis in workflow names. They break in URLs, search, and CLI tools.
- No trailing version numbers (
v2,final). For versioning, archive the old one or use git on the SDK code.
Sub-workflows
Same verb-first rule. The name says what the sub-workflow does; a tag says what kind it is. Category lives in tags, not a name prefix.
| Name | Tags |
|---|---|
Fetch JSON with retry |
subworkflow |
Parse RFC2822 date |
subworkflow |
Hydrate customer from Stripe |
customer, subworkflow |
Compute MRR |
billing |
List available credentials |
tool (MCP-extending workflows, see n8n-extending-mcp-official) |
Tags compose: a customer-domain tool carries customer + tool. search_workflows({ tags }) filters on them with AND semantics (a workflow must have every listed tag). This replaces the old name-prefix convention, which only existed because the MCP couldn't filter by tags. Full discovery protocol: n8n-subworkflows-official references/NAMING_AND_DISCOVERY.md.
Nodes
The rule
Nodes are named after what they do in this workflow, not the node type.
| ✅ Good | ❌ Avoid |
|---|---|
Fetch active customers |
Postgres1 |
Build email HTML |
Set2 |
Send manager Slack alert |
Slack |
Loop through orders |
SplitInBatches |
Webhook: report-request |
Webhook |
The default name (HTTP Request1, Code1) is debugging hostile. A failure on node "HTTP Request3" tells you nothing, but a failure on node "Fetch order details" tells you exactly which step is broken.
Webhook nodes
Always include path or purpose: Webhook: report-request, Webhook: GitHub PR opened. The URL itself is opaque, so the name compensates.
Loop and merge nodes
For SplitInBatches, name after what's being iterated (Loop through orders).
For Merge, name after what's being merged (Merge customer + Stripe data).
Tags
Tags are the AI-side discovery and categorization mechanism (n8n 2.27.0+). The MCP can read them (list_workflow_tags), filter by them (search_workflows({ tags }), AND semantics), and attach/detach them (update_workflow addTags/removeTags). addTags auto-creates an unknown tag, so you never pre-register one. It cannot rename or delete tag entities, and create_workflow_from_code can't set tags at create time, so tag right after creating.
Tag names are now exact-match machine identifiers, not just human labels:
- All lowercase, spaces not hyphens:
customer,daily report,util,prod. A case or spelling mismatch is a different tag. - No emojis.
addTagsand thetagsfilter match names exactly, so an emoji makes every match fragile. list_workflow_tagsbefore tagging to reuse the instance's existing names instead of spawning near-duplicates (customervscustomers).- Aim for 2-4 per workflow. More is noise.
Standard category tags: subworkflow (reusable building block), a domain tag (customer, billing, notification), and tool (MCP-callable, see n8n-extending-mcp-official). For the full discovery protocol, see n8n-subworkflows-official references/NAMING_AND_DISCOVERY.md.
Instance and user conventions overrule all of the above. If list_workflow_tags shows an existing vocabulary, or the user prefers different names, casing, or categories, match theirs. Consistency within an instance beats this skill's defaults.
Workflow description
Always include description on create_workflow_from_code. 2-4 sentences answering:
- What does it do? (one sentence)
- Why does it exist / what's the context? (one sentence)
The second matters more. The "what" is usually obvious from the nodes, but the "why" is context the user provided (or you derived) and otherwise gets lost.
| Good | Avoid |
|---|---|
| "Sends a weekly summary of new signups to the founders' Slack. Built because the manual report kept getting skipped during launch weeks." | "Sends weekly Slack." |
| "Hydrates incoming Stripe customer events with subscription data and writes to the customers table. Replaces the old Zapier flow that hit rate limits." | "Stripe to Postgres." |
For more on capturing derived context, see the parent SKILL.md "Readability" section.
When to break the rules
- Existing project conventions. If the user's instance uses different naming, match their pattern. Consistency within a project beats consistency with this skill.
- Generated workflows. For programmatic batches (one per data source), templated names are fine, but include the source identifier (
Sync source-A to warehouse, notSync1).
Open this reference as its own page
Node groups
Read this before creating or editing groups. Named visual frames on the canvas, no execution semantics.
get_workflow_sdk_reference({ section: 'groups' }) serves n8n's own copy of the rules below and is the authority if the two ever disagree. Read it too when groups are the main job; this file is the one that also covers what each tool reports back.
When to group: count boxes, not nodes
A box is what the canvas shows with every group collapsed: the trigger, each group, and each ungrouped node. Sub-nodes and sticky notes are not boxes.
More than 7 boxes means group. Typically 3 to 5 groups, one per stage or business outcome. Never split one objective to hit the number. Staying above 7 is fine only when every remaining top-level item is already a group, or is a node that cannot legally join one.
The rules
- No trigger nodes. A trigger can never be a member.
- One connected section with a single entry and exit. The connectable members form one reachable section, not two islands. At most one member takes main input from outside and has no predecessor inside; at most one sends main output outside and has no successor inside. The limit is on members facing outward, not on connections: that one entry member may receive several inbound connections, and that one exit member may send several outward, and the group is still valid. What fails is two different members each facing the same direction. This is the rule most often misread as "one incoming connection". Exception: a closed loop whose only exit is the loop node.
- Keep AI sub-nodes with their Agent. If an Agent is in a group, its sub-nodes are in the same group. All in or all out: no non-main connection may cross the boundary, not just model, tool, and memory.
- One group per node. No overlapping membership.
- Unique names and ids, at least one member. Sticky notes may ride along without participating in connectivity, and a sticky-only group is valid.
When a section is too branchy to form one group, group a smaller valid slice (one branch, or the linear run before or after the split) rather than leaving the whole stage ungrouped.
Keep existing groups and their descriptions intact when editing a workflow, unless the change is about grouping.
The operations
All four are update_workflow operations. Members are node names, never ids. (Before n8n 2.33.0 they were ids, and the three granular ops may be missing entirely below 2.41.0.)
| Op | Fields |
|---|---|
setNodeGroups |
nodeGroups[] of { name, nodeNames[], description?, id? }. Replaces every group; [] clears them all. |
addNodeGroup |
name, nodeNames[], description?, id? |
removeNodeGroup |
groupName. Removes the frame, keeps the nodes. |
updateNodeGroup |
groupName, plus at least one of newName, nodeNames[], description ("" clears it) |
In SDK code, declare a group with .group(name, members, options?) on the workflow, where members are the node handles (the const from node(...)), the same way connections reference nodes.
Failure modes: a bad group op is skipped, not fatal
Group ops are the one exception to update_workflow being atomic: an invalid group op is skipped and the rest of the batch still saves. (An over-long description is the one thing that still fails the whole call: see Descriptions.) So a call that looks successful can still have lost a group, and the fields that say so differ by tool.
update_workflow:
skippedOperations[]({ opIndex, type, reason }): group ops you submitted that did not take effect.removedGroups[]({ groupName, reason }): an existing group your other edits invalidated. You did not touch it; adding a node or connection elsewhere made it illegal and the server deleted it. Tell the user when this fires, because nothing else about the response looks like a failure.validationWarnings[]: includesTOP_LEVEL_ITEMS_OVER_CEILING. A warning marked[pre-existing](alsopreExisting: true) was already true before your update, so leave those alone rather than widening the task.
create_workflow_from_code reports dropped groups as skippedGroups[] ({ groupName, reason }) and its warning array is warnings, with no preExisting field. It has no removedGroups: on create there is no prior group for an unrelated edit to invalidate.
validate_workflow flags an over-ceiling canvas as SDK_UNGROUPED_CANVAS, not TOP_LEVEL_ITEMS_OVER_CEILING.
Repair with a follow-up update_workflow before telling the user the workflow is done, and never re-emit a group the server just rejected: fix what the reason names.
Descriptions
Always set one, max 145 characters. Groups are created collapsed, so title plus description is the whole first impression. It must add to the title rather than restate it, and collapsed groups clip the text, so spend the first words on the input, the output, or the scope boundary.
The two entry points disagree about going over 145:
update_workflowrejects the entire call with a schema error. Not a skipped group op: nothing in the batch saves.- SDK
.group()on create validates clean, saves clean, and silently truncates to exactly 145, mid-word, with no warning.
Write to the limit rather than relying on either.
Open this reference as its own page
Workflow review checklist
Severity-tiered audit for any existing n8n workflow or n8n build (group of workflows). Different from VALIDATION_CHECKLIST.md (which is pre-publish gates for your own in-progress build): this file is for reviewing arbitrary workflows, including ones built by anyone, from anywhere.
How to use
Walk the list top to bottom. For each item, inspect the workflow (get_workflow_details) and decide if the issue applies. Report findings grouped by severity. Each item links to the canonical skill reference for the why and the how to fix. Be a very thourough reviewer and air on the side of reading references to ensure full context.
You're reviewing JSON, not SDK source. get_workflow_details returns the n8n workflow JSON (nodes with parameters, connections graph, credential references, node type strings like n8n-nodes-base.httpRequest). Phrase findings in JSON terms: "node Foo has parameters.onError set to 'continueErrorOutput' but connections.Foo.main[1] is empty,".
| Severity | Meaning | Action |
|---|---|---|
| MUST FIX | Ship-blocker. Security hole, broken connection, or production-breaking bug. | Stop the workflow if active, fix before re-enabling. |
| SHOULD FIX | Real issue. Antipattern, missing error handling on production paths, broken contracts. | Plan a follow-up, fix in the next change. |
| NICE TO HAVE | Polish. Naming, descriptions, conventions. | Clean up opportunistically. |
Cross-cutting first
Before walking the per-domain list:
- Pull the workflow(s).
get_workflow_details({ workflowId }), required so subsequent checks operate on the actual JSON, not assumptions. - High-level intent / logic smell test. Read the workflow's
description(if it exists), then trace the happy path once top to bottom. Does the structure match what the description says it does? Anything obviously dead, missing, contradictory, or not fitting (a write node in a workflow described as read-only, a fan-out with one terminal branch that should be wired further, an HTTP call to a domain unrelated to the stated integration)? Catches whole classes of issues the per-domain checks won't surface. - Note the trigger type. Webhook, schedule, manual, sub-workflow, chat trigger. Severity of issues changes by trigger (a webhook-API workflow needs error paths; a manual run does not).
- Note whether the workflow is active. Active/published workflows with broken connections are higher severity.
MUST FIX
Credentials and secrets
- Tokens, API keys, or secrets in node text fields. Any node parameter holding
Bearer xxx,sk-..., an API key, or a password as plain text. The credential system is the only correct home. → n8n-credentials-and-security-official - Tokens stored in Set node values for later
{{$json.token}}referencing. The token is in workflow JSON regardless of how it's read. → n8n-credentials-and-security-official - Hardcoded credentials in Code nodes. Same leak surface as text fields. → n8n-code-nodes-official anti-patterns
- HTTP Request nodes with
Authorizationheader values typed in directly instead of using a credential. ForAuthorization: Bearer <token>, useBearer Auth(httpBearerAuth) so the token is stored without the prefix. For other custom auth headers, useHeader Auth(httpHeaderAuth). → HTTP_REQUEST_WITH_AUTH.md - Secret read from
$vars.Xand used as an auth value. Use a credential instead. → n8n-credentials-and-security-official
SQL / query injection
- User input interpolated into a query string. Any DB node with
parameters.querycontaining{{ $json.something }}(or any{{ ... }}expression that resolves from caller input) inside the SQL itself is a SQL injection: n8n substitutes the expression into the query before parameter binding. Use parameter binding instead (Postgres / MySQL:$1, $2placeholders +parameters.options.queryReplacement; Mongo: object filters). → DATABASE_NODES.md
Connection bugs (silent breakage)
- Merge index off-by-one.
parameters.useDataOfInputis 1-indexed but the corresponding entry inconnections.<source>.main[index]is 0-indexed. If the merge node's expected primary input doesn't match the wiring, the wrong source is picked silently. → MERGE_NODE.md - Merge with 3+ sources but
numberOfInputsleft at default 2. Third source silently drops. → MERGE_NODE.md - Error output wired without
onError: 'continueErrorOutput'on the node config. Error branch is unreachable; node failure halts the workflow. → NODE_ERROR_OUTPUTS.md -
onError: 'continueErrorOutput'set butmain[1]not wired. Error path is enabled but goes nowhere. → NODE_ERROR_OUTPUTS.md
Webhook API workflows (Webhook + Respond to Webhook)
- Webhook performs a sensitive action with
parameters.authentication: 'none'. "Sensitive" = mutates state, sends external messages, hits production data, exposes private info, triggers paid actions. Anyone with the URL can fire it. Setparameters.authenticationto'basicAuth'or'headerAuth'and use the matching credential. → n8n-credentials-and-security-official
Sub-workflow contracts
-
Execute Workflow Triggerset topassthroughwhen it shouldn't be. Passthrough loses the typed-input contract that agent tools (fromAi()) and structured callers need. Only correct when (a) the sub-workflow specifically receives binary AND isn't an agent tool, or (b) the sub-workflow takes no inputs (Define Below requires at least one field). For (b), the body should open with aSet("Keep Only Set", no fields) and the trigger should carry a sticky noting no inputs are expected. → n8n-subworkflows-official non-negotiables and SUBWORKFLOW_PATTERNS.md "Splitting by input shape"
First-class n8n Agents
Review an Agent with get_agent (draft) and get_agent with versionId set to its published activeVersionId (live). Findings are in config JSON terms.
- No
memoryblock on a conversational Agent. It forgets the previous turn even inside one session. Add{ "enabled": true, "storage": "n8n" }. → MEMORY.md - Saved sub-agent unpublished while the parent is published. Production delegation fails and the parent answers without it. Nothing else flags this. → SUB_AGENTS.md
- Tool that sends, pays, deletes, or changes data without
requireApproval(or MCPapproval). → APPROVALS.md - Approval-required tool on an Agent that runs from Message an Agent or a scheduled task. Fails, or parks with no one to answer. → APPROVALS.md
- Telegram channel with
accessMode: publicwhen the Agent isn't meant for strangers. Anyone can talk to it and spend its budget. → CHANNELS.md - Two different Agents called with the same Message an Agent session key in one project (for example both keyed on a bare Telegram id). Keys are project-wide, not per Agent, so the second Agent's call fails with "Failed to create the agent execution record". Prefix keys per Agent. → MESSAGE_AN_AGENT.md
Chat-triggered agents (Slack / Discord / Teams / Telegram)
- Bot's own user ID not filtered out, either via the trigger's own filter option (preferred: Slack's
options.userIdsexclusion list) or as the first node after the trigger. The bot's reply re-triggers the workflow → infinite loop. Watch out for surface-specific semantics: Telegram'suserIdsis an allowlist, not an exclusion list. → CHAT_SURFACE_PATTERNS.md
SHOULD FIX
Naming
- Generic node names (
HTTP Request1,Set2,Postgres1). Debugging-hostile: a failure onnode "HTTP Request3"tells the operator nothing, butnode "Fetch order details"localizes the break instantly. Rename every node to describe what it does in this workflow. → NAMING_CONVENTIONS.md
Comms nodes (Slack, Gmail, Discord, SMTP, Telegram)
- n8n attribution still appended on Slack / Gmail / Email / Discord nodes. Most comms nodes have "Append n8n Attribution" enabled by default. Users typically want it removed in production. → COMMS_NODES.md
- Slack thread reply posting as top-level message.
thread_tsnot set, or set in the wrong nested location. → COMMS_NODES.md
Set node antipattern
- Set node feeding only 0 or 1 downstream consumer. Most common antipattern in the pack. Delete + inline the expression at the consumer. → n8n-expressions-official "The Set-node antipattern"
- Set node before a Data Table Insert/Update mapping fields to schema. Map directly in the Data Table node's per-column expression slots. → n8n-data-tables-official strong defaults
- Set node building an email/Slack body. Build the body inline in the comms node's body field with an expression. → COMMS_NODES.md
- Multiple consecutive Set nodes each defining one field. Collapse, or eliminate. → n8n-expressions-official
Code node antipattern
- Code node doing pure data shaping (
.map,.filter,.find, field rename, optional chaining). Use an expression or Edit Fields with arrow function. → n8n-code-nodes-official decision tree - Code node using
crypto.createHash/crypto.createHmac. Use the native Crypto node (n8n-nodes-base.crypto). Recurring AI slip. → n8n-code-nodes-official "Cryptographic operations" - Code node parsing XML / SOAP / RSS. Use the native XML node + Edit Fields with arrow function for extraction. → n8n-code-nodes-official "XML / SOAP / RSS parsing"
- Code node + Set node combo (Set builds inputs, Code transforms). One Edit Fields with arrow function does both. → ARROW_FUNCTIONS_IN_EDIT_FIELDS.md
Expression discipline
-
$json.xreferences deep in workflows with branches/intermediates. Switch to$('Source Node').item.json.xfor refactor stability. → n8n-expressions-official non-negotiable - DateTime nodes used for date math/formatting. Use Luxon expressions (
DateTime.fromISO(...)) inline. → n8n-expressions-official strong defaults -
$env.Xreferenced in any expression. Doesn't work, throws at runtime. Replace with$vars.X(paid plans), a Data Table, or a credential for secrets. → n8n-expressions-official anti-patterns - Aggregate node + per-item execution mismatch. Expressions using
$input.all()/$('Node').all()without combining with another node's.itemshould setexecuteOnce: trueon the node. → n8n-loops-official non-negotiable and n8n-expressions-official ".all().map() triggers an executeOnce question"
Execution model
- Workflow assumes fan-out branches execute in parallel. They don't, n8n runs them sequentially top-to-bottom by Y-position. Real concurrency needs sub-workflow dispatch with
mode: 'each'+waitForSubWorkflow: false. → n8n-workflow-lifecycle-official "Execution model"
Loops
-
Loop Over Itemsadded "to make it loop" when default per-item iteration handles it. Default per-item iteration already waits for each item before the next, so a Loop Over Items added "to wait for all items" is unnecessary. → n8n-loops-official "When NOT to reach for Loop Over Items" - Custom pagination implementation (Loop Over Items +
$pageCount, hand-rolledwhilein a Code node, Set + IF cycle, etc.) instead of HTTP Request's built-inPaginationoption. → HTTP_PAGINATION.md - Reset-mode loop with no clear termination.
reset: truewithout an explicit stop condition +$runIndexceiling = infinite loop, n8n eats memory until killed. → LOOP_OVER_ITEMS.md "Reset mode" - One
Loop Over Itemsnested inside another in the same workflow. Doesn't work; breaks at runtime. Move the inner loop into a sub-workflow called per outer iteration (mode: 'each'). → LOOP_OVER_ITEMS.md "Nesting Loop Over Items"
Self-healing on transient failures
- Network-calling nodes (HTTP, comms, DB, AI) without
retryOnFailconfigured. Transient 429s and upstream blips surface as 5xx, alerts fire on noise. → n8n-error-handling-official "Self-healing on transient failures"
Switch nodes
- Switch with no fallback output configured. Unmatched items silently drop. Set
options.fallbackOutput: 'extra'andoptions.renameFallbackOutput: '<name>'. → SWITCH_FALLBACK.md - Switch outputs unnamed. Set
renameOutput: true+outputKey: '<name>'per rule for self-documenting branches. → SWITCH_FALLBACK.md
Sub-workflows
- Duplicated logic across workflows that would be a sub-workflow. → n8n-subworkflows-official decision tree
- Sub-workflow with no
description. Won't be found in future searches; nobody (or AI) knows what it does. → n8n-subworkflows-official anti-patterns - Sub-workflow has hidden side effects. The name and
descriptiondescribe pure logic (parse, validate, format, compute, transform), but the body contains write / send nodes (Data Table Insert/Update, Slack/Gmail/Discord send, HTTP POST, file write, audit log, etc.). Callers reasonably assume the sub-workflow is safe to retry; doing so creates duplicate writes or sends. Either declare the side effect (rename to e.g.Audit:or<Domain>:, document it indescription, return a result the caller can branch on) or move the side effect out of this sub-workflow. → n8n-subworkflows-official "Stateless vs stateful" - ~30-node workflow with no extraction. Extract logical sections into sub-workflows. → n8n-subworkflows-official
AI Agents and tools
-
options.maxIterationsleft at default 10 on a multi-tool agent. Likely too low for modern agents with flexible tool sets; throws "Max iterations reached" workflow error. Raise to 30-50+. → AI_NODES.md "Iteration cap" - Generic tool names (
doStuff,runQuery). Model can't tell which tool to pick, skips them or hallucinates parameters. Use verb-first specific names. → TOOLS.md - Default, Empty, or one-line tool descriptions. Model has no clue when to invoke. Tool descriptions are part of the prompt. → TOOLS.md
-
outputParserStructuredwithoutautoFix: true. One bad model output and the workflow fails. SetautoFix: truewith a coding-capable fixer model. → STRUCTURED_OUTPUT.md - Tools with user-visible side effects (send, pay, refund) without human review. Wrap with
slackHitlTool/discordHitlTool/telegramHitlTool/gmailHitlTool/ etc. → HUMAN_REVIEW.md - Approval message via
fromAi()instead of$tool.parameters.<name>. Model paraphrases; you approve text not values. → HUMAN_REVIEW.md - Hardcoded
sessionId: 'default'or no sessionId on memory. All conversations share one session or sessions won't be used properly. → MEMORY.md - Image / audio / video generation wrapped in an Agent. Binary doesn't flow through tools or the Agent's output formatter. Use the provider's native single-call node directly. → n8n-ai-nodes-official anti-patterns
- Agent + Switch to route on natural-language input when Text Classifier (
@n8n/n8n-nodes-langchain.textClassifier) is one node with N built-in branches. → n8n-ai-nodes-official - Agent (or Basic LLM Chain + structured output parser) used to pull fields out of a blob of text when Information Extractor (
@n8n/n8n-nodes-langchain.informationExtractor) is one node with a typed schema, no tools, no system prompt. Use the Agent only when the extraction needs tool calls or multi-turn reasoning. → n8n-ai-nodes-official
First-class n8n Agents: quality
- Node tool without a
descriptionin its JSON. It gets a generic "Execute node" text and is picked badly. → TOOLS.md - Tool
expressioninput that reads trigger or upstream data ($('Webhook'),$json.<event field>). Tools only see the model's arguments, so it's empty or wrong. → TOOLS.md "What expressions can see" - Vague
useWhenon sub-agents or vector stores, or skill descriptions that don't say "Use when ...". These are the triggers; vague ones never fire. → SKILLS.md - Task with no
timezone, or an objective that doesn't say where results go. Fires at the wrong hour, or produces output nobody sees. → TASKS.md - Slack approval where the approver needs the values (amount, recipient). Channel cards don't show parameters. → APPROVALS.md
- MCP server without
toolFilter, exposing a whole catalog when the Agent needs a few tools. → TOOLS.md
System prompts (AI Agents)
The system prompt is the load-bearing config of an agent. Severity ranges by how badly the issue degrades behavior.
- Hardcoded date / missing date in the system prompt. Stale immediately. Agents making time-sensitive decisions (deadlines, eligibility windows, "is X expired?") get wrong answers. Use
Current date: {{ $now }}. → SYSTEM_PROMPT.md "Always include the current date" - Long system prompt with per-tool usage instructions buried inside. Modular split violation. Brittle to edit, and tools become unreusable across agents. Move tool-specific instructions into each tool's description. → SYSTEM_PROMPT.md "The modular split" and n8n-ai-nodes-official "What goes in the system prompt vs the tool description"
- "You are a helpful assistant" preamble with no role specifics. Generic responses, agent has no identity. Replace with a specific role and scope. → SYSTEM_PROMPT.md "What it's for"
- No refusal/safety boundary when one is needed (the agent has tools that touch user-visible state, sends, payments). Define explicit boundaries: "only answer questions about X, redirect otherwise". → SYSTEM_PROMPT.md
Data Tables
System columns and identifiers
- Set node before Data Table Insert/Update. Map directly in per-column slots. → n8n-data-tables-official strong defaults
-
id,createdAt, orupdatedAtdeclared increate_data_table. System-managed; declaring them errors or shadows. → n8n-data-tables-official non-negotiable - Auto-
idused as a cross-system identifier. Resets on table recreate / instance migration. Add a domain ID column (arxivId,customerId,requestId). → SCHEMA_DESIGN.md "system-managed columns"
_object postfix discipline (the most error-prone area)
- Column holds stringified JSON (array, object) without the
_objectpostfix. Readers have no contract telling them to parse. → SCHEMA_DESIGN.md "the_objectconvention" - Column has
_objectpostfix but isstringtype holding native (non-stringified) values. Contract violation: postfix promises stringified content. → SCHEMA_DESIGN.md - Insert/Update writes to an
_objectcolumn withoutJSON.stringify(...). A[object Object]literal lands in the row. → SCHEMA_DESIGN.md - Read from an
_objectcolumn withoutJSON.parse(...). Downstream gets a string where it expects array/object; templates and tools choke. → SCHEMA_DESIGN.md - Sub-workflow returns
_objectcolumns as strings to callers. Storage format leaking through the interface. Parse before returning so callers receive arrays as arrays and objects as objects. → SCHEMA_DESIGN.md "Storage format ≠ interface format" - Sub-workflow's "fresh" path stringifies to "match" the cached path. Wrong instinct. Parse the cached path so both branches return natural shapes. → SCHEMA_DESIGN.md
-
_objectcolumn holds data that needs to be queried (filter ontopicscontent, find rows by tag). Strings can't be queried structurally. Refactor to a relational child table or move to a real DB. → SCHEMA_DESIGN.md "When NOT to use_object"
Schema design
- String column acting as boolean (
'yes'/'no','true'/'false'). Use thebooleantype. → SCHEMA_DESIGN.md "Picking column types" - Mixed casing within one table or query (
createdAtANDarxiv_idtogether). Match camelCase to the system columns. → n8n-data-tables-official strong defaults - Table named with snake_case, lowercase, or in singular for a set. Title Case with spaces (
Papers,Recent Events). Plural for sets, singular for one-row-per-global-thing only. → SCHEMA_DESIGN.md "Naming" - Boolean column not named affirmatively (
completedinstead ofisCompleted). Affirmative names read better in filters and IFs. → SCHEMA_DESIGN.md - Table with more than ~17 columns. Consider splitting; the table is probably trying to be multiple things. → SCHEMA_DESIGN.md "A healthy table"
- User-declared
datecolumn duplicatescreatedAt/updatedAt. Use the system columns where they fit; only add explicitdatecolumns when the timestamp's meaning differs from "row created" or "row updated". → SCHEMA_DESIGN.md
Relational design (when the data has shape)
- Genuine parent-child data crammed into one wide table (papers + summaries in one
Paperstable, customers + orders in oneCustomerstable). Split into parent + child tables, reference parent byid(paperId,customerId). → SCHEMA_DESIGN.md "Designing relationally" and n8n-data-tables-official "Relational design" - Child arrays stored in
_objectcolumns when they need to be queried or filtered individually. Refactor to a relational child table. → SCHEMA_DESIGN.md "When NOT to use_object" - Cascade strategy unclear (no defined behavior on parent delete). Pick one per relationship: cascade-delete via a separate Delete on children, soft-delete (
archivedflag), or orphan. Mixed strategies cause silent bugs. → SCHEMA_DESIGN.md "Enforce integrity in the workflow" - Multi-table write sequence (parent Insert + child Insert) without partial-failure handling. No transactions exist; a child failure leaves the parent orphaned. Pick: compensating writes, idempotent retry with
upsert+ stable domain IDs, or soft state marker (status: 'pending' → 'complete'). → SCHEMA_DESIGN.md "No transactions, plan for partial failure" - Child rows pointing at deleted parents (orphan detection missing). Either soft-delete by default, or run a periodic cleanup workflow. → SCHEMA_DESIGN.md "Watch for child without parent"
- 3+ joined tables with transactional writes. Past Data Tables' wheelhouse. Use a real SQL DB. → SCHEMA_DESIGN.md "When Data Tables are the wrong tool"
Operation gotchas
- Multi-column filter without explicit
matchType: 'allConditions'. Defaults toanyCondition(OR) in some versions; surprising when intent is AND. → OPERATIONS.md "matchType" -
GetwithoutalwaysOutputData: truefollowed by an IF that branches on result presence. No-match produces zero items, the IF doesn't fire at all. → DEDUP_PATTERNS.md "Pattern 3: Get + IF" - Get + IF branches produce different JSON shapes (cached path vs. freshly-processed path). Downstream
$json.xresolves to the wrong field depending on which fired. Insert a Set/NoOp anchor to normalize. → n8n-expressions-official "Combine Inputs convergence" -
Updatewith no match silently does nothing. No error. Either follow with aGetto confirm, or useupsertfor create-or-update. → OPERATIONS.md "Update with no match" -
Insertwith no dedup in a workflow that can re-fire (webhook retry, scheduled re-run). Creates duplicates. Useupsert,rowNotExists+ Insert, or upstream dedup. → DEDUP_PATTERNS.md -
returnAll: falsewithout explicitlimit. Defaults to 50 in many versions; downstream may expect more and silently truncate. → OPERATIONS.md "returnAll" - Plain "have I seen this value?" dedup using a Data Table. The
Remove Duplicatesnode ("items seen in previous executions" mode) handles this with no schema. Reach for Data Tables only when the dedup state needs to be queryable, has row-level logic, or has TTL/per-tenant scoping. → DEDUP_PATTERNS.md - Idempotency-key workflow without TTL cleanup. Markers shouldn't live forever; run a daily cleanup. → DEDUP_PATTERNS.md "Idempotency keys"
Mapping mode and evolution
-
autoMapInputDatamode without a stable 1:1 between upstream field names and column names. Drift on either side silently breaks the mapping. Default todefineBelow. → SCHEMA_DESIGN.md "Mapping mode" - Workflow attempts an in-place column type change. Not supported. Add a new column, copy via workflow, drop the old, rename the new. → SCHEMA_DESIGN.md "Schema evolution"
Wrong tool for the job
- Cross-app shared data in Data Tables. Awkward to query from outside n8n. Use a real DB. → SCHEMA_DESIGN.md "When Data Tables are the wrong tool"
- Millions of rows or write-heavy volume in a Data Table. Performance degrades; use a real DB. → SCHEMA_DESIGN.md
Binary handling
- Reading file content from
$jsoninstead of$binary. → BINARY_BASICS.md - Agent tool returning raw binary directly. Tool output is JSON-only. Upload to storage, return key/URL in JSON. → AGENT_TOOL_BINARY.md
- Uploaded chat files passed to a tool via
fromAi.fromAidoesn't carry binary. Pre-stage to storage, inject keys in the system prompt. → AGENT_TOOL_BINARY.md - Binary lost after a JSON transform. Use Merge to combine the JSON output with the binary stream. → MERGE_FOR_CONTEXT.md
- Image sent to a chat surface from raw
$binary. Chat surfaces need a URL-referenced image (or platform-native file upload). → CDN_REQUIREMENT.md
Public trigger auth
- Webhook trigger with
parameters.authentication: 'none'even on read-only / lookup paths. The URL is publicly callable; no auth invites abuse (rate-limit exhaustion, scanning, scraping). Use Basic / Header / JWT auth unless the workflow is genuinely meant to be public. (If the action is sensitive, this is a MUST FIX, see above.) → n8n-credentials-and-security-official - Form Trigger fronting a sensitive action with no auth gate. Forms that create accounts, mutate data, send external messages, or trigger paid operations should require real auth at the trigger. An obscure URL is not auth. → n8n-credentials-and-security-official
Webhook / Respond to Webhook
- Fallible nodes with no error path. HTTP / DB / API / file nodes need
output(1)wired to a 5xx Respond. Without it, the failure is unhandled: the workflow halts and the caller gets whatever n8n's generic error response is (no controlled status code, no useful body), and the operator only learns about it if a workflow-level error workflow is configured separately. → n8n-error-handling-official non-negotiables and API_WORKFLOWS.md - Error response returns 200. Caller's HTTP client treats it as success; downstream error handling never fires. Always 4xx (caller error) or 5xx (server error). → RESPONSE_SHAPES.md
- Generic 500 for every failure. Validation errors should be 400, auth issues 401/403, conflicts 409, rate limits 429. Caller can't distinguish their bug from your outage. → RESPONSE_SHAPES.md
-
respondWith: 'json'body usingJSON.stringify(...)instead of an object literal (produces double-encoded body). → WEBHOOK_NODES.md
HTTP Request
- Headers set both via
headerParametersand a credential'shttpHeaderAuth. They conflict. → HTTP_NODES.md - Untrusted external API call without
options.timeoutset. Runtime default is 5 minutes; a hung request stalls the workflow. → HTTP_NODES.md
Schedule trigger
- Business-critical schedule with no explicit timezone at the workflow level. DST and instance moves cause timing shifts. → TRIGGER_NODES.md
- Schedule-triggered workflow not idempotent for missed-run scenarios. Restarts or downtime can miss runs. → TRIGGER_NODES.md
NICE TO HAVE
Naming
- Workflow name doesn't follow verb-first pattern (
Send weekly customer reportvs.Customer report sender). → NAMING_CONVENTIONS.md - Untagged sub-workflow (missing
subworkflow, a domain tag, ortool). Tags are the discovery mechanism; an untagged sub-workflow won't surface under anytagsfilter. → NAMING_AND_DISCOVERY.md
Readability
- Canvas over 7 top-level boxes (n8n 2.28+) whose logical steps aren't grouped into node groups. Boxes are the trigger, each group, and each ungrouped node; sub-nodes and stickies don't count. Collapsed groups make the canvas read as steps, not nodes. Skip on older instances, where node groups don't exist. → NODE_GROUPS.md
- Group with no
description, or one written to restate its title. Groups are created collapsed, so title plus description is all a reader gets. Max 145 characters. → NODE_GROUPS.md - An Agent grouped apart from its sub-nodes. Any non-main connection crossing the boundary drops the group; all in or all out. → NODE_GROUPS.md
- Sticky note used to fake a group instead of a node group. Stickies annotate (callouts, TODOs, warnings); they don't group. → SKILL.md "Readability"
- Sticky title re-states what's visible (
Set, If, Set). Title with the callout's point. → SKILL.md "Readability" - Sticky color used for variety instead of meaning. Color should say what happens there (green creates or involves a person, red destructive or irreversible, blue routing, gray documentation), one meaning per color, matching whatever nearby workflows already use. → STICKY_NOTES.md
- Sticky sitting away from, or on top of, what it describes. On create, anchor it with
sticky(content, [nodes])instead of positioning by hand. A note at[0, 0]is the usual tell, though saved JSON can't distinguish an omittedpositionfrom a deliberate one, so check where it should sit rather than how it got there. → STICKY_NOTES.md - Workflow
descriptionis empty, one sentence, or doesn't capture the why. Two sentences: what it does, why it exists. → SKILL.md "Readability" - Code node without a one-line note explaining its purpose. → SKILL.md "Readability"
- Workflow ignores existing house style (sticky palette, naming convention used in nearby workflows). Match what's there. → SKILL.md "Readability"
Sub-workflow conventions
- Sub-workflow without a final
ReturnSet / Edit Fields node shaping the return contract. The legitimate exception to the Set-node antipattern. → n8n-subworkflows-official "Other conventions" - Inputs / outputs not documented in the sub-workflow's
description. Field names, types, purpose. → n8n-subworkflows-official "Sub-workflow inputs and outputs"
Conventions
- Per-execution context (user identity, files, current task) buried in a static system prompt instead of injected via expressions or piecing. Hard to update. → SYSTEM_PROMPT.md "Storing the prompt"
- Generic safety boilerplate language in the system prompt for risks the model already handles. Reinforcement adds tokens without changing behavior. Reserve safety language for specific, named risks. → SYSTEM_PROMPT.md anti-patterns
Reporting findings
When reporting, group by severity, then within severity by domain. For each finding include:
- The specific node(s) or section affected.
- A one-sentence description of the issue.
- The link to the canonical skill ref for the fix.
MUST FIX
Security
- Node `Send Webhook`: bearer token in headerParameters value field. → n8n-credentials-and-security-official
- Node `Lookup user`: SQL string concat with $json.email. → DATABASE_NODES.md
Connections
- Node `Validate input`: `connections.Validate input.main[0]` has only 1 entry, but the workflow's logic expects fan-out to 3 downstreams. → check the SDK code (likely a missed `.add(...)` call)
SHOULD FIX
...
A review agent should not auto-fix MUST FIX items without user confirmation: security and connection fixes have blast radius and the user should know what's changing.
Open this reference as its own page
Sticky notes
Read before placing or editing one. The two entry points take different shapes, and only the create path computes geometry for you.
| Tool | Shape | Geometry |
|---|---|---|
create_workflow_from_code |
SDK sticky(content, nodes?, config?) |
Derived from the anchors, after layout |
update_workflow |
addNode with type: 'n8n-nodes-base.stickyNote' |
Yours to compute, in full |
On create: anchor, never position
const note = sticky('### Enrich order\nCustomer lookup feeds the tier multiplier used by pricing.', [lookup, price], { color: 5 });
workflow('id', 'name').add(lookup.to(price)).add(note);
The anchor list only sizes and places the note. Listing a node does not add it, and wrapping nodes does not add the sticky: all of it still needs .add(...).
Anchored, the note is a background zone. Layout runs first, then the box wraps wherever the anchors landed:
x = anchors.x - 32 # STICKY_PADDING
y = anchors.y - 96 # STICKY_PADDING + STICKY_HEADER_HEIGHT
width = anchors.width + 64 # STICKY_PADDING both sides
height = anchors.height + 128 # both sides, plus the header
snapped to the 16px grid. The 64px of headroom is where the title renders clear of the nodes, which then draw on top of the note. That is the intended look, not an overlap bug. Anchors are recorded by node id, so renaming a member is safe.
Every sticky gets anchors. A hand-written position is guessing: coordinates are fixed before layout runs. Omitting both is worse, because the fallback centers the note under the whole graph (pre-layout every node sits at the origin, so it counts as covering all of them) then pushes it down past any sticky it hits. That is how notes end up floating below the flow, related to nothing. If you cannot name the nodes a note is about, it does not belong on the canvas.
Where a note goes: pick the role, the role picks the anchors
The anchor set is the placement decision, so picking it at random is what makes a canvas look randomly annotated. Three roles, each fixing its own anchors:
| Role | Anchors | Color | Title |
|---|---|---|---|
| Stage zone | every node of one stage | what the stage does, below | ### Stage name |
| Callout | the single node it is about | 3 red for a warning, else 1 yellow | ### Point, and nothing else: over a plain node the box is only 160px wide |
| Title band | every node in the flow | 7 gray | ## What this workflow is |
The band is rare: it only earns its place on a large canvas you are deliberately leaving ungrouped, since a grouped canvas gets its heading from the group names and a small one already has the workflow name in the breadcrumb. Nesting needs no care, because n8n z-orders stickies by area, largest behind.
A color is a symbol, not decoration. It stands for what happens where it sits, so a reader can decode a workflow from color alone. Decide each meaning once and hold it:
| 4 green | something is created, or a person is in the loop: form intake, approval gate, manual review |
| 3 red | destructive or irreversible: deletes, error paths, anything that pages a human, critical config |
| 5 blue | routing and data transformation, the neutral middle of a pipeline |
| 7 gray | the documentation layer: title band, reference panel |
| 2 gold | an outer frame |
| 6 purple | domain accents, sparingly |
| 1 yellow | the default, a note with no particular role |
Precedence: what the user asked for, then the palette in nearby workflows (search_workflows plus get_workflow_details), then the table. A convention the reader already knows beats a better one they do not.
How many, and at what scale
Count boxes the way the grouping rule does: the trigger, each group, and each ungrouped node.
- Under about 5 nodes. None. The canvas reads in one glance; annotating it is noise.
- 5 to 7 boxes. One zone per stage, 2 to 4 of them.
- Over 7 boxes. Node groups section it (
NODE_GROUPS.md) and document it through their owndescription. Anchor nothing to a grouped node: with groups present, layout places collapsed chips and packs members into chip-sized slots, so member positions are cramped (adjacent members can overlap) and are not what the reader sees. A note anchored to them draws over the expanded group and matches nothing collapsed. Stickies have almost nothing to do on a grouped canvas, which is correct.
Giving the zone room
The derived 32px measures the node box only. A node's name renders below it, and a URL subtitle below that, so both hang off the edge. Two fixes, one at each step.
At create, declare a height (this keeps the derived width and position). Node boxes are 96 tall, rows 192 apart:
| Anchors | Derived | Declare |
|---|---|---|
| one row | 224 | height: 272 |
| branch fan, two rows | 416 | height: 464 |
Each extra row adds 192 to both; Message an Agent v2 and up is 128 tall, so add 32.
Once the canvas is final, widen the zones. A declared width can't do this: it holds the left edge and grows right, eating the gutter. So read the node positions with get_workflow_details and set each zone absolutely, in one batched update_workflow:
zone.x = min(node.x) - 56
zone.width = max(node.x + node.width) - min(node.x) + 112
Computing from the nodes rather than nudging the current box makes this idempotent, so a re-run is harmless. Still, run it once, at the end: it is a finishing step, not something to repeat after every edit.
That gives 56px sides and a 16px gutter. 56 is the ceiling. The subtitle overhangs its node by about 45px, and the 128px between node boxes splits as padding + gutter + padding. It also puts zone edges 8px off the 16px grid, which is deliberate: on-grid leaves only 48px sides (subtitle on the border) or a zero gutter (adjacent same-color zones merge). Nothing re-snaps on save; dragging one zone shifts it 8px.
The rules that still produce a mess
- Declared size wins dimension by dimension.
{ width: 400 }keeps your width and takes the derived height. Give both and anchoring only positions it. - A pinned note never moves, including out of another note's way. Pinned means an explicit
positionor anchors. Only free-floating notes are de-overlapped, and that pass walks them down past other stickies only, never past nodes. So a free note can land on nodes, and two anchored notes over interleaved runs overlap forever. Anchor each to a disjoint run. - Stickies are invisible to layout. Nodes are never spread apart to make room.
- Two zones cannot sit on vertically adjacent rows. A zone always reaches 96px above its anchors. Below them it reaches 32px at the derived height, or 80px once you declare the
height: 272above, so stacked zones need 128px of clear space between the node boxes, or 176px with the declared height. Dagre stacks sibling branchesNODE_Y_SPACINGapart, which is 96. Both numbers are larger than 96, so giving each branch of an If or Switch its own zone overlaps every time (by 32px, or 80px with the declared height) and both are pinned, so neither yields. Anchor the whole fan as one zone, or zone one branch and leave the other bare. - Anchor whole stages, not single nodes. A note per node reprints the node names in a second typeface and buries the one callout that mattered.
On update: there is no sticky operation
update_workflow offers addNode, setNodePosition, and updateNodeParameters, and runs no layout pass. A sticky is an ordinary node:
{ "type": "addNode", "node": {
"name": "Note: retry policy", "type": "n8n-nodes-base.stickyNote", "typeVersion": 1,
"position": [-320, 160],
"parameters": { "content": "### Retry policy\nThe API 429s above 10 rps.", "width": 480, "height": 240, "color": 3 }
}}
content, width, height, and color live in parameters, not at the top level. An omitted position becomes [0, 0], dropping a 240x160 note at the origin on top of whatever is there.
To frame a run of nodes, build the box by hand. get_workflow_details gives positions but not sizes, and a position is the node's top-left, so you need dimensions too: a plain node is 96x96, one with configurable inputs 256x96, Message an Agent v2 and up 320x128.
left = min(x) top = min(y)
right = max(x + width) bottom = max(y + height)
sticky.x = left - 32 sticky.width = right - left + 64
sticky.y = top - 96 sticky.height = bottom - top + 128
Round every value to a multiple of 16.
Content, and where the overflow goes
### for a zone or callout, ## for a title band, carrying the point rather than the node names under it: a reader can already see Set, If, Set. Then one short line.
One line is the budget, and it is a budget at the zone's width. Text renders from the top-left and only the top 64px clears the anchors, so more renders behind the nodes. A taller box just extends further behind them. A zone over one plain node is 96 + 64 = 160px wide, where even a short sentence wraps three ways, so single-node zones get a title and nothing else.
Prose that does not fit goes to node notes (why this node is configured this way: a retry policy, a rate limit, a workaround) or the workflow description (why the workflow exists). Neither competes for canvas space.
Constants
GRID_SIZE 16, DEFAULT_STICKY_SIZE 240x160, STICKY_PADDING 32, STICKY_HEADER_HEIGHT 64, NODE_Y_SPACING 96.
Open this reference as its own page
Testing workflows
Two tools, used together. prepare_workflow_pin_data returns JSON Schemas (no actual data) for every node that needs pinning. You generate sample values matching the schemas and pass them to test_workflow as the pinData parameter. Inspect results via get_workflow_execution.
What test_workflow actually pins
Three categories are pinned (return your supplied data instead of executing): trigger nodes, nodes with credentials, and HTTP Request nodes. Everything else runs.
| Node category | Behavior under test_workflow |
|---|---|
| Trigger node | Pinned, never fires |
| HTTP Request | Pinned, does NOT hit the URL |
| Slack / Gmail / Discord / SMTP / Telegram | Pinned (credentialed), does NOT send |
| Postgres / MySQL / Mongo / Supabase | Pinned (credentialed), does NOT read or write |
| LLM nodes (OpenAI, Anthropic, etc.) | Pinned (credentialed), no API call, no cost |
| Data Tables (built-in n8n storage) | Real reads AND writes (no credential, not pinned) |
| Code node | Executes as written |
| Edit Fields / Set / If / Switch / Merge / Filter | Execute normally |
| Wait node | Actually waits |
| Execute Workflow (sub-workflow call) | Runs the sub end-to-end, and the sub's pinning rules don't apply |
The auto-pin covers most of the obvious side-effect surface (sends, third-party writes, paid API calls). It does NOT cover:
- Data Tables, since they're n8n's built-in storage and have no credential. Insert / Update writes for real.
- Execute Workflow calling a sub. Test mode does not propagate into sub-workflows. The sub runs normally with all its credentialed nodes firing for real (it's its own execution).
- Execute Command and File Read/Write nodes, which are credential-free I/O.
- Code nodes that touch external state (filesystem, child processes, network via Node APIs on self-hosted Code nodes).
Non-negotiable
Ask the user before test_workflow if any of the not-auto-pinned categories would fire downstream. A short message before the call:
"This workflow writes to the
customersData Table and calls sub-workflowprocess-payment(which charges Stripe). Both will fire for real. Want me to run the test?"
Many users will say yes (sandbox table, test sub, trust the inputs). Some will pin or disable specific nodes first. The conversation costs nothing, but running an irreversible operation against the wrong account costs everything.
Skip the ask when EVERY non-pinned downstream is read-only or stateless: Get / Search / Lookup, pure compute (Set / If / Code shaping data), MCP-extension tools that only read.
If you're unsure whether a node has side effects, ask. False-positive asks waste a turn, but false-negative side effects waste real resources.
Generating pin data
prepare_workflow_pin_data returns JSON Schemas describing the expected shape for each node that needs pinning. It does not return actual data, you generate it. Merge sample values into a single pinData object keyed by node name, with every item wrapped in { "json": { ... } }:
{
"Webhook": [{ "json": { "headers": {...}, "body": {...} } }],
"Postgres1": [{ "json": { "id": "123", "email": "a@b.com" } }],
"OpenAI Chat": [{ "json": { "message": { "content": "..." } } }]
}
Pin every key the generator returns. Skipping a credentialed node leaves it without input data, and the test won't represent real behavior. For keys where the generator can't infer a schema (no past executions, no node-type hint), use an empty default or hand-build based on what the next node expects.
Mocking trigger input by type
prepare_workflow_pin_data generates a representative trigger input. Hand-build when the generator's defaults don't match real callers.
| Trigger | Pin shape |
|---|---|
| Webhook | { headers, params, query, body, webhookUrl } |
| Schedule | Empty or timestamp-shaped. Default usually fine. |
| Manual | Arbitrary, whatever the first downstream expects. |
Chat (chatTrigger) |
{ chatInput, sessionId, files }. Pin files: [] unless testing file handling. |
| Execute Workflow Trigger | The typed inputs declared on the trigger node. |
| Polling | One item shaped like what polling normally yields. Polling logic is bypassed. |
For per-trigger config details, see n8n-node-configuration-official references/TRIGGER_NODES.md.
Strategies when a non-pinned downstream isn't safe
In order of preference:
- Ask the user first (the protocol above). Many concerns dissolve once the user explicitly OKs the test or names which nodes worry them.
- Pin individual node outputs. Add the node to your
pinDataobject even though it's not auto-pinned. The pinned response is returned and the node body never runs. Works on any node. - Disable specific nodes (
disabled: true) for the test run.test_workflowskips disabled nodes. Useful when nothing meaningful would be pinned and you just want to skip the side effect. - Sandbox credentials. A separate credential pointing at staging (Stripe test mode, sandbox Slack workspace, dev DB). The user owns creating these, suggest, don't implement without permission.
Pinning and disabling are revertable. Sandbox credentials are infrastructure and persist.
Inspection after testing
test_workflow returns an execution ID. get_workflow_execution({ executionId, workflowId, includeData: true }) exposes per-node input/output. Walk through:
- Per-node output shape matches intent.
- Errors caught by error branches fired correctly, not silently.
- Webhook response shape (status, body, headers) matches the contract.
The full pre-publish checklist that includes testing is in VALIDATION_CHECKLIST.md §5.
After test_workflow: announce what was pinned
Pin data passed to test_workflow is per-execution only. It is not written to the workflow definition, and the n8n execution viewer currently shows no visual indicator (no pin icon, no badge) on the nodes that were pinned. The only programmatic signals are:
- The
pinDatablock inget_workflow_execution's response, which lists the pinned node names. executionTime: 0on each pinned node.
Because the user has no canvas confirmation that a destructive-looking node was actually mocked, always tell the user which nodes were pinned after the call. Especially for nodes whose live execution would be destructive (Postgres DELETE, payment capture, file write, email send). A one-liner is enough:
"Test ran. Pinned (did NOT execute):
Webhook,Delete inactive customers. Ran for real:Format report,Send summary."
Without this, the user has to either trust the protocol or open the execution payload to verify. The reassurance costs one sentence, but the cost of the user assuming a destructive node fired (or of assuming it was pinned when it wasn't) is much higher.
test_workflow vs execute_workflow
| Tool | Trigger | Credentialed / HTTP nodes | Other downstreams |
|---|---|---|---|
test_workflow |
Pinned via your data | Pinned via your data | Run for real |
execute_workflow |
Real (kicked off ad-hoc) | Run for real | Run for real |
execute_workflow is not a safer test_workflow. It's the opposite. test_workflow covers the credentialed surface automatically, but execute_workflow runs everything end-to-end with real auth and cost. "Run this once for me" means execute_workflow. "Test this" means test_workflow (and ask about the not-auto-pinned downstreams first).
Both want the same ask-before-running discipline when user-visible side effects are at stake.
Re-test after iteration
After fixing something, re-run test_workflow on the SAME pin data before claiming the fix works. Same pin, same expected output, every iteration.
If a test passes but production fails, check whether the pin data covers the failing case. Usually it doesn't, and the pin needs updating to match the real-world shape that broke things.
Open this reference as its own page
Pre-publish validation checklist
Run before every publish_workflow. The whole list. Skipping items is how broken workflows ship.
The checklist
1. validate_workflow passed
Run validate_workflow. Schema and shape errors must be zero. If validation fails, fix and re-validate.
If a failure points at a single node's params, validate_node_config on that node alone returns per-parameter errors without full-graph noise. For tool subnodes, set isToolNode: true. Best used as a per-node spot-check during BUILD.
2. Antipattern scan (the build-time discipline check)
Walk the workflow with these questions in mind. These are patterns that recur across builds even when relevant skills are loaded, so making this explicit catches them.
Set nodes:
- For each Set node, count how many downstream nodes reference its output fields.
- If only 0 or 1 downstream consumer references each field, delete the Set node and inline the expression at the consumer. The most common antipattern (
n8n-expressions-officialnon-negotiable #2). - Common offender: a Set node right before a Data Table Insert / Update node, mapping fields to match schema. Map directly in the Insert/Update node's expression slots.
- Common offender: a Set node building a body before an Email/Slack node. Build the body in the body field with an expression.
Code nodes:
- For each Code node, ask: could this be an expression or arrow-function-in-Edit-Fields?
- If it's pure data shaping (
.map,.filter,.find, field renaming, optional chaining), rewrite as expression or Edit Fields with arrow function. Code's bar is multi-source aggregation, external libraries, or stateful transforms (n8n-code-nodes-official). - For each operation the Code does, check separately for a native node. A Code node doing 4 things probably has 4 native answers. Read its body and ask:
this.helpers.httpRequest(...)→ use the HTTP Request node.- Manual pagination loop (
while (more) { start += page; ... }) → use HTTP Request's Pagination option. - Regex parsing structured response (
/<id>...<\/id>/g, etc.) → use the XML node for XML,JSON.parsefor JSON. crypto.createHash(...)orcrypto.createHmac(...)→ use the Crypto node.- Status-code retry logic (
if (status === 429) throw) → HTTP Request'sretryOnFail(retries on any error, no per-status filter, capped at 5 tries / 5000ms wait). For 429-only or 5xx-only retry, use the error output + IF on$json.error.httpCodeinstead.
- Identity Code nodes (
return $('Some Node').all();orreturn $input.all();) are always wrong. They re-emit upstream data, which means the workflow shape is wrong: the downstream consumer should branch off the upstream directly, or the per-item-vs-aggregate context mismatch should be solved with fan-out, not a Code-node bridge. - Common offender: flattening a single API response's nested structure. That's Edit Fields with arrow function, not Code.
Merge nodes:
- Count wires going in. Confirm
numberOfInputsmatches. - For Merges using
useDataOfInput, walk through the off-by-one rule (n8n-node-configuration-officialreferences/MERGE_NODE.md).
Fan-out branches:
- If the design assumes branches run in parallel, it's wrong. n8n runs them sequentially top-to-bottom by Y-position. For real concurrency, dispatch via
Execute Workflowwithmode: 'each'+waitForSubWorkflow: false.
DateTime nodes:
- Replace with a Luxon expression (see
n8n-expressions-official). DateTime nodes are almost always wrong.
Sub-workflow triggers:
- For each
Execute Workflow Trigger, confirm "Define Below" mode with typed fields. Passthrough is only correct for (a) binary-receiving sub-workflows that won't be agent tools or (b) sub-workflows that genuinely take no inputs (Define Below requires at least one field). For (b), verify the body opens with aSet("Keep Only Set", no fields) and a sticky noting no inputs are expected. Seen8n-subworkflows-officialnon-negotiable #2.
Message an Agent nodes (calling a first-class n8n Agent):
- The Agent is published (production runs use the published version), has a memory block if
sessionKeyis set, and has no approval-required tools: approvals fail under Message an Agent. sessionKeyis prefixed per Agent (support-<telegramId>, not the bare id): keys are project-wide, so a second Agent called with a key the first already used fails. Max 74 chars.onError: 'continueErrorOutput'with a handled error branch on anything user-facing. Seen8n-agents-officialreferences/MESSAGE_AN_AGENT.md.
Data references:
- Search for
$json.in expressions. Replace with$('Node Name').item.json.unless the node is directly downstream of a single source with no intermediates (n8n-expressions-officialnon-negotiable #1). - Search for
$env.in expressions. Doesn't work, throws at runtime. Replace with$vars.X(paid plans), a Data Table, or a credential if it's a secret.
Skipping it is how build-time slips slip past validation.
3. Error handling is wired
For workflows that are webhook-triggered, production-bound, or otherwise user-facing, every fallible node should have its error path handled. This isn't about catching bugs. It's about returning a clean response when an upstream is down.
Invoke n8n-error-handling-official if any of these are true:
- Webhook trigger with a respond-to-webhook pair.
- Unattended (scheduled, cron, queue-driven).
- A failure would silently drop user-visible work.
For internal one-off scripts (manual trigger), error handling can be looser.
4. Credentials, not tokens in text fields
Walk every node config for tokens, API keys, or auth values pasted into text parameters. They should be referenced via the credential system.
If you find any, invoke n8n-credentials-and-security-official and migrate before publishing.
5. test_workflow produced expected output
Use prepare_workflow_pin_data, then test_workflow. Inspect outputs via get_workflow_execution.
Before running: test_workflow auto-pins triggers, credentialed nodes, and HTTP Request. Code, Edit Fields, If, Data Tables, Execute Command, file ops, and sub-workflow calls run for real. If any of those have user-visible side effects, ask the user before running. See TESTING.md for the side-effect protocol, mocking by trigger type, pinning individual nodes, and the post-run announce-what-was-pinned protocol.
Check:
- Output shape matches what consumers expect.
- No unexpected errors swallowed by error branches.
- Fan-outs all produced data, none collapsed to empty.
- For webhook responses, the shape is correct (status, body, headers).
Fix and re-test if anything's off.
6. Naming, descriptions, structure
Quick pass:
- Workflow name follows the verb-first pattern (
NAMING_CONVENTIONS.md). Sub-workflows are tagged (subworkflow, a domain tag,tool) since that's howsearch_workflows({ tags })finds them. descriptionis set and captures both what and why, with searchable keywords.- Nodes are renamed from defaults.
- Canvases over 7 top-level boxes (trigger + groups + ungrouped nodes) group their logical steps. Ungrouped still runs, but a large ungrouped canvas is hard to read, and from n8n 2.40.0 the server warns about it. See
NODE_GROUPS.md. - The last save reported no unresolved group problem:
skippedGroupson a create,skippedOperations/removedGroupson an update, or an over-ceiling warning from either (one marked[pre-existing]was already true before your change: leave it). A group op can be skipped, and an existing group can be removed by unrelated edits, without the save failing. SeeNODE_GROUPS.md"Failure modes".
These don't block publish technically, but workflows without them rot faster.
7. Folder placement
If the user requested a specific folder, confirm via search_folders that the workflow ended up there. If the folder didn't exist, you should have surfaced that before building (FOLDER_LIMITATIONS.md). Don't silently dump at root.
8. MCP access (if applicable)
Workflows created via create_workflow_from_code default to MCP-accessible. No toggle step needed. Only ask the user to flip the toggle when:
- They built the workflow in the n8n UI and you need to operate on it.
- They want to revoke MCP access on an agent-created workflow (the toggle is on by default).
See MCP_ACCESS_PER_WORKFLOW.md.
Order matters
Top-to-bottom. Items 1-4 are gates: failing any means the workflow shouldn't publish. Items 5-8 are quality checks: failing means the workflow ships and rots, but won't break immediately.
The most common skip is item 2 (the antipattern scan). It feels like polish, but it catches things validate_workflow doesn't.
What to do if something fails after publish
Post-publish is high-stakes: run every operation through the user. Once a workflow is published, it may be receiving real traffic, holding state, or being depended on by other systems. Do not take autonomous action: no
publish_workflow, nounpublish_workflow, noupdate_workflow, noarchive_workflow, no triggering executions to "see what happens." Surface the problem, propose the fix, and wait for explicit approval before each step. The guidance below is what to recommend to the user, not what to do without asking.
n8n keeps versions: get_workflow_details returns both versionId (the current draft) and activeVersionId (the version that's live). They diverge when you save changes via update_workflow. Those changes only go live on the next publish_workflow call. Saving is not publishing.
- Consider rolling back first.
get_workflow_historylists saved versions (newest first);get_workflow_versionfetches a known-good one, andrestore_workflow_versionre-applies it as the draft (or pass itsversionIdtopublish_workflowto go straight live). (n8n 2.29.0+.) Rollback no longer needs the user to copy aversionIdfrom the UI, but per the guardrail above, recommend it and let the user approve before you restore. - Recommend
unpublish_workflowonly if no rollback target exists and the workflow is actively running and broken. A scheduled or webhook workflow with broken connections shouldn't keep firing. Surface the problem and the recommendation, let the user pull the trigger. - Fix-forward path:
update_workflowsaves the draft, thenpublish_workflowmakes it live. Two separate steps:update_workflowdoes NOT auto-publish, the change sits as an unpublished draft untilpublish_workflowruns against it. Re-run this checklist before the publish step. Don't trust that "just one fix" doesn't ripple.
A note on speed
The cost of skipping is higher than the cost of checking. Debugging a broken production workflow is much more time consuming, stressful, and can cause damage.
More in this playbook
Safe to turn on
Use this skill when an agent or person is about to create, change or enable an automation inside someone else's account or a shared environment: "create this workflow", "build it in the customer's account", "turn it on", "go live", "deploy this automation". Produces a proposal the human approves, an automation created in the off state, and a short list of what only the human can finish.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.
Workflow buildingMITn8n agents
Design n8n AI agents the right way. Use when building or editing any @n8n/n8n-nodes-langchain.* AI node — an AI Agent, LLM chain, Text Classifier, or Information Extractor — and whenever the user mentions AI agents, LLM with tools, tool calling, $fromAI, system prompts, agent memory, sessionId, structured/JSON output, output parser, RAG, vector store, a chat assistant/bot, or human-in-the-loop review. Covers Agent-vs-chain-vs-classifier choice, the model/memory/tools/outputParser slots, tool names/descriptions as prompt, structured output with autoFix, memory, RAG, human review, and chat topologies.


