n8n-io/n8n · error · Error
Metadata is required
Error message
Metadata is required
What it means
The v2 Conversation Update operation reads the metadata parameter with a default of ''. If the value is falsy (empty string), it throws a raw Error. Like error 897, this should be a NodeOperationError or UserError per n8n conventions. The metadata is required because the PATCH endpoint needs at least one field to update. The metadata is later parsed as JSON via jsonParse.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.ts:43
const displayOptions = {
show: {
operation: ['update'],
resource: ['conversation'],
},
};
export const description = updateDisplayOptions(displayOptions, properties);
export async function execute(this: IExecuteFunctions, i: number): Promise<INodeExecutionData[]> {
const conversationId = this.getNodeParameter('conversationId', i, '') as string;
const metadata = this.getNodeParameter('metadata', i, '') as string;
if (!conversationId) {
throw new Error('Conversation ID is required');
}
if (!metadata) {
throw new Error('Metadata is required');
}
const body: IDataObject = {};
body.metadata = jsonParse(metadata, {
errorMessage: 'Invalid JSON in metadata field',
});
const response = await apiRequest.call(this, 'POST', `/conversations/${conversationId}`, {
body,
});
return [
{
json: response,
pairedItem: { item: i },
},
];View on GitHub (pinned to 5ac6606e81)
Solutions
- Provide a valid JSON string in the metadata field (e.g. '{"key": "value"}')
- If metadata comes from upstream, ensure the source field is populated and is valid JSON
- If you don't need to update metadata, consider a different operation
Example fix
// before — metadata: ''
// after — metadata: '{"status": "resolved", "priority": "high"}' Defensive patterns
Strategy: validation
Validate before calling
const metadata = this.getNodeParameter('metadata', i, '') as string;
if (!metadata || !metadata.trim()) {
throw new UserError('Metadata is required to update a conversation.');
}
// Also validate it's valid JSON
try {
JSON.parse(metadata);
} catch {
throw new UserError('Metadata must be valid JSON.');
} Type guard
function isValidJsonString(value: string): boolean {
try { JSON.parse(value); return true; } catch { return false; }
} Prevention
- Always provide metadata as a valid JSON string
- Use a Code node to build metadata JSON from upstream fields
- Validate JSON.parse succeeds before this node if metadata comes from expressions
When it happens
Trigger: The 'metadata' parameter is empty or not provided when updating a conversation. Since metadata is the only updatable field for conversations, an empty value means there is nothing to update.
Common situations: Metadata field left empty; expression {{$json["meta"]}} resolves to empty; user didn't realize metadata is required for the update operation.
Related errors
- Conversation ID is required
- This model is not supported in ${version} version of the Age
- This fallback model is not supported in ${version} version o
- A non-empty prompt is required.
- A non-empty prompt is required.
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/ee4d1c000d27d4a9.
Report an issue: GitHub.