{"record":{"id":"30ff081cfb88fba5","repo":"n8n-io/n8n","slug":"sticky-notes-do-not-support-error-handlers","errorCode":null,"errorMessage":"Sticky notes do not support error handlers","messagePattern":"Sticky notes do not support error handlers","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder/node-builders/node-builder.ts","lineNumber":1164,"sourceCode":"\t}\n\n\tinput(_index: number): InputTarget {\n\t\tthrow new Error('Sticky notes do not support input connections');\n\t}\n\n\toutput(_index: number): OutputSelector<'n8n-nodes-base.stickyNote', 'v1', void> {\n\t\tthrow new Error('Sticky notes do not support output connections');\n\t}\n\n\tto<T extends NodeInstance<string, string, unknown>>(\n\t\t_target: T | T[] | InputTarget,\n\t\t_outputIndex?: number,\n\t): NodeChain<NodeInstance<'n8n-nodes-base.stickyNote', 'v1', void>, T> {\n\t\tthrow new Error('Sticky notes do not support connections');\n\t}\n\n\tonError<T extends NodeInstance<string, string, unknown>>(_handler: T): this {\n\t\tthrow new Error('Sticky notes do not support error handlers');\n\t}\n\n\tgetConnections(): DeclaredConnection[] {\n\t\treturn [];\n\t}\n}\n\n/**\n * Create a sticky note for workflow documentation.\n *\n * Like any other node, the returned sticky must be passed to\n * `workflow(...)` (or `.add(...)`) to appear on the canvas. The optional\n * `nodes` array is **only** used to size and anchor the sticky around the\n * given nodes — it does **not** add them to the workflow.\n *\n * @param content - Markdown content for the sticky note\n * @param nodesOrConfig - Optional nodes to wrap (sizes the sticky around them; the nodes themselves still need to be added to the workflow). Pass a config object to skip wrapping.\n * @param config - Optional configuration (color, position, size)","sourceCodeStart":1146,"sourceCodeEnd":1182,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/node-builders/node-builder.ts#L1146-L1182","documentation":"Thrown by StickyNoteInstance.onError(). Sticky notes carry no executable logic and have no error output, so attaching an error handler to one is meaningless and is blocked.","triggerScenarios":"Calling stickyNode.onError(handler); generic error-wiring pass that calls .onError() on every node including stickies.","commonSituations":"Applying a uniform error-handling policy across all nodes; assuming every NodeInstance supports onError.","solutions":["Do not call .onError() on a StickyNoteInstance.","Filter stickies out before applying a uniform onError pass.","Attach onError only to executable nodes (Code, HTTP, IF, etc.)."],"exampleFix":"// before\nfor (const n of allNodes) n.onError(handler); // throws on sticky\n// after\nfor (const n of allNodes.filter((x) => x.type !== 'n8n-nodes-base.stickyNote')) {\n  n.onError(handler);\n}","handlingStrategy":"type-guard","validationCode":"const STICKY = 'n8n-nodes-base.stickyNote';\n\nfunction safeOnError(node: NodeInstance, handler: NodeInstance): void {\n  if (node.type === STICKY) return; // skip stickies\n  node.onError(handler);\n}","typeGuard":"function isStickyNote(node: NodeInstance): node is NodeInstance<'n8n-nodes-base.stickyNote', 'v1', void> {\n  return node.type === 'n8n-nodes-base.stickyNote';\n}","tryCatchPattern":null,"preventionTips":["Attach onError only to executable nodes (Code, HTTP, IF, etc.).","Filter stickies out before a uniform onError pass.","Treat stickies as non-executable documentation."],"tags":["runtime","builder","sticky-note","error-handling"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}