{"record":{"id":"4d8b5557d36edc08","repo":"n8n-io/n8n","slug":"at-least-one-attribute-must-be-specified","errorCode":null,"errorMessage":"At least one attribute must be specified","messagePattern":"At least one attribute must be specified","errorType":"exception","errorClass":"NodeOperationError","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/chains/InformationExtractor/InformationExtractor.node.ts","lineNumber":251,"sourceCode":"\t\t\t0,\n\t\t)) as BaseLanguageModel;\n\n\t\tconst schemaType = this.getNodeParameter('schemaType', 0, '') as\n\t\t\t| 'fromAttributes'\n\t\t\t| 'fromJson'\n\t\t\t| 'manual';\n\n\t\tlet parser: OutputFixingParser<object>;\n\n\t\tif (schemaType === 'fromAttributes') {\n\t\t\tconst attributes = this.getNodeParameter(\n\t\t\t\t'attributes.attributes',\n\t\t\t\t0,\n\t\t\t\t[],\n\t\t\t) as AttributeDefinition[];\n\n\t\t\tif (attributes.length === 0) {\n\t\t\t\tthrow new NodeOperationError(this.getNode(), 'At least one attribute must be specified');\n\t\t\t}\n\n\t\t\tparser = OutputFixingParser.fromLLM(\n\t\t\t\tllm,\n\t\t\t\tStructuredOutputParser.fromZodSchema(makeZodSchemaFromAttributes(attributes)),\n\t\t\t);\n\t\t} else {\n\t\t\tlet jsonSchema: JSONSchema7;\n\n\t\t\tif (schemaType === 'fromJson') {\n\t\t\t\tconst jsonExample = this.getNodeParameter('jsonSchemaExample', 0, '') as string;\n\t\t\t\t// Enforce all fields to be required in the generated schema if the node version is 1.2 or higher\n\t\t\t\tconst jsonExampleAllFieldsRequired = this.getNode().typeVersion >= 1.2;\n\n\t\t\t\tjsonSchema = generateSchemaFromExample(jsonExample, jsonExampleAllFieldsRequired);\n\t\t\t} else {\n\t\t\t\tconst inputSchema = this.getNodeParameter('inputSchema', 0, '') as string;\n\t\t\t\tjsonSchema = jsonParse<JSONSchema7>(inputSchema);","sourceCodeStart":233,"sourceCodeEnd":269,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/chains/InformationExtractor/InformationExtractor.node.ts#L233-L269","documentation":"Thrown by the Information Extractor node when schemaType is 'fromAttributes' but the 'attributes.attributes' fixedCollection is empty. The node builds a Zod schema from the user-supplied attribute definitions; with zero attributes the schema (and the extraction task) would be empty, so it refuses to proceed.","triggerScenarios":"User selected 'From Attributes' as the schema source on the Information Extractor but added zero attribute rows. The attributes array length is 0 and the guard throws.","commonSituations":"User forgot to add attributes; attributes were removed but schema source not switched; workflow imported with the attributes fixedCollection cleared.","solutions":["On the Information Extractor node, add at least one attribute row under 'Attributes' (each with a name and description).","If you have no attributes to define, switch the Schema Type to 'fromJson' or 'manual' and supply a JSON schema instead.","Verify the attributes were not lost during a workflow import/export."],"exampleFix":"// before\nif (attributes.length === 0) {\n  throw new NodeOperationError(this.getNode(), 'At least one attribute must be specified');\n}\n\n// after — suggest the alternative schema sources\nif (attributes.length === 0) {\n  throw new NodeOperationError(this.getNode(), {\n    message: 'At least one attribute must be specified when Schema Type is From Attributes.',\n    description: 'Add attribute rows, or switch Schema Type to From JSON / Manual.',\n  });\n}","handlingStrategy":"validation","validationCode":"if (schemaType === 'fromAttributes') {\n  const attributes = this.getNodeParameter('attributes.attributes', 0, []) as AttributeDefinition[];\n  if (attributes.length === 0) {\n    throw new Error('Add at least one attribute, or switch Schema Type to From JSON / Manual');\n  }\n}","typeGuard":"function hasAttributes(a: unknown[]): a is AttributeDefinition[] {\n  return Array.isArray(a) && a.length > 0;\n}","tryCatchPattern":null,"preventionTips":["When choosing 'From Attributes', immediately add at least one attribute row.","Switch to From JSON / Manual if you have no discrete attributes.","Validate workflow imports include the attributes fixedCollection."],"tags":["configuration","schema","information-extractor","parameter-validation"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}