{"record":{"id":"4bd21e96f5432c7b","repo":"n8n-io/n8n","slug":"conversation-id-is-required","errorCode":null,"errorMessage":"Conversation ID is required","messagePattern":"Conversation ID is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.ts","lineNumber":39,"sourceCode":"\t},\n\t{ ...metadataProperty, required: true },\n];\n\nconst displayOptions = {\n\tshow: {\n\t\toperation: ['update'],\n\t\tresource: ['conversation'],\n\t},\n};\n\nexport const description = updateDisplayOptions(displayOptions, properties);\n\nexport async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {\n\tconst conversationId = this.getNodeParameter('conversationId', i, '') as string;\n\tconst metadata = this.getNodeParameter('metadata', i, '') as string;\n\n\tif (!conversationId) {\n\t\tthrow new Error('Conversation ID is required');\n\t}\n\n\tif (!metadata) {\n\t\tthrow new Error('Metadata is required');\n\t}\n\n\tconst body: IDataObject = {};\n\n\tbody.metadata = jsonParse(metadata, {\n\t\terrorMessage: 'Invalid JSON in metadata field',\n\t});\n\n\tconst response = await apiRequest.call(this, 'POST', `/conversations/${conversationId}`, {\n\t\tbody,\n\t});\n\n\treturn [\n\t\t{","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/n8n-io/n8n/blob/5ac6606e81f67bb9534255570cd4e86fd8101eee/packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.ts#L21-L57","documentation":"The v2 Conversation Update operation reads conversationId from the node parameter with a default of ''. If the value is falsy (empty string), it throws a raw Error. Note: this should ideally be a NodeOperationError or UserError per n8n conventions — a raw Error loses node/item context. The parameter is marked required:true in the node definition, so the UI should prevent this, but programmatic/API usage can bypass UI validation.","triggerScenarios":"The 'conversationId' parameter is empty when the Update Conversation operation executes. This can happen when the parameter is populated via an expression that resolves to empty, or when the workflow is constructed via API without the required field.","commonSituations":"Expression {{$json[\"id\"]}} resolves to empty from upstream; the conversation ID field was cleared; the workflow was imported with a missing conversationId value; upstream node didn't output the expected ID field.","solutions":["Provide a valid conversation ID (e.g. 'conv_abc123') in the conversationId field","If using an expression, verify the upstream data has the conversation ID field populated","Add an IF node before this operation to skip items missing a conversation ID"],"exampleFix":"// before — conversationId: '' or conversationId: {{$json[\"missingField\"]}}\n// after  — conversationId: 'conv_abc123'","handlingStrategy":"validation","validationCode":"const conversationId = this.getNodeParameter('conversationId', i, '') as string;\nif (!conversationId || !conversationId.trim()) {\n  throw new UserError('Conversation ID is required to update a conversation.');\n}","typeGuard":"function isNonEmptyString(value: unknown): value is string {\n  return typeof value === 'string' && value.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Always provide a valid conversation ID from a prior Create/Get operation","Add an IF node to filter items with missing conversation IDs","Use expressions with upstream field references and verify the field exists"],"tags":["openai","conversation","missing-id","validation","v2"],"backgroundTag":null,"analyzedSha":"5ac6606e81f67bb9534255570cd4e86fd8101eee","analyzedAt":"2026-08-12T05:26:35.080Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}