{"record":{"id":"7fcf5ca9abb1ebe2","repo":"n8n-io/n8n","slug":"nodes-from-fromjson-do-not-support-input","errorCode":null,"errorMessage":"Nodes from fromJSON() do not support input()","messagePattern":"Nodes from fromJSON\\(\\) do not support input\\(\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/workflow-sdk/src/workflow-builder/workflow-import.ts","lineNumber":97,"sourceCode":"\t\t\t\tdisabled: n8nNode.disabled,\n\t\t\t\tnotes: n8nNode.notes,\n\t\t\t\tnotesInFlow: n8nNode.notesInFlow,\n\t\t\t\texecuteOnce: n8nNode.executeOnce,\n\t\t\t\tretryOnFail: n8nNode.retryOnFail,\n\t\t\t\tmaxTries: n8nNode.maxTries,\n\t\t\t\twaitBetweenTries: n8nNode.waitBetweenTries,\n\t\t\t\talwaysOutputData: n8nNode.alwaysOutputData,\n\t\t\t\tonError: n8nNode.onError,\n\t\t\t\textendsCredential: n8nNode.extendsCredential,\n\t\t\t},\n\t\t\tupdate(config) {\n\t\t\t\treturn { ...this, config: { ...this.config, ...config } };\n\t\t\t},\n\t\t\tto() {\n\t\t\t\tthrow new Error('Nodes from fromJSON() do not support to()');\n\t\t\t},\n\t\t\tinput() {\n\t\t\t\tthrow new Error('Nodes from fromJSON() do not support input()');\n\t\t\t},\n\t\t\toutput() {\n\t\t\t\tthrow new Error('Nodes from fromJSON() do not support output()');\n\t\t\t},\n\t\t\tonError() {\n\t\t\t\tthrow new Error('Nodes from fromJSON() do not support onError()');\n\t\t\t},\n\t\t\tgetConnections() {\n\t\t\t\treturn [];\n\t\t\t},\n\t\t};\n\n\t\tconst connectionsMap = new Map<string, Map<number, ConnectionTarget[]>>();\n\t\tlet mapKey = nodeName || `__unnamed_${unnamedCounter++}`;\n\n\t\t// Handle duplicate node names: generate unique key for duplicates\n\t\t// The first instance keeps the original name (connections reference it)\n\t\tif (nodes.has(mapKey)) {","sourceCodeStart":79,"sourceCodeEnd":115,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/workflow-sdk/src/workflow-builder/workflow-import.ts#L79-L115","documentation":"Imported (fromJSON) node handles do not implement the fluent input() selector. input() is a builder-only construct used to select a specific input index on an authored node for targeted wiring; imported nodes carry their full connection graph verbatim from JSON and cannot be re-pointed this way. The method is present only to give a precise, actionable error rather than a generic 'not a function'.","triggerScenarios":"Calling node.input(1) on a handle obtained from a fromJSON()-imported workflow, then chaining .to(target) or passing it to workflow.add().","commonSituations":"Generic helper functions that iterate node handles and call input()/output() uniformly across authored and imported nodes; refactoring that switches a workflow from builder-authored to JSON-imported without updating the wiring calls.","solutions":["Re-author the node with the builder node() factory if you need input selection.","Use workflow.connect(importedNode, 0, target, targetInput) to wire inputs explicitly.","Branch helper logic on whether the handle came from fromJSON() vs an authored factory."],"exampleFix":"// before\nconst n = wf.getNode('X'); // imported\nn.input(1).to(target); // throws\n\n// after\nwf.connect(n, 0, target, 1);","handlingStrategy":"type-guard","validationCode":"function isImportedNode(n: any): boolean {\n  return typeof n.input === 'function' && n.input.toString().includes('fromJSON()');\n}\n// Prefer tracking origin explicitly rather than introspecting function bodies.","typeGuard":"function isImportedNode(n: { __imported?: boolean }): boolean {\n  return n.__imported === true;\n}","tryCatchPattern":"try {\n  n.input(1).to(target);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('fromJSON()')) {\n    wf.connect(n, 0, target, 1);\n  } else throw e;\n}","preventionTips":["Use workflow.connect() to wire inputs of imported nodes.","Branch generic helpers on node origin (authored vs imported).","Re-author nodes that need input selection via the builder factories."],"tags":["workflow-builder","fromjson","import","connections"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}