n8n-io/n8n · error · Error

Conversation ID is required

Error message

Conversation ID is required

What it means

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.

Source

Thrown at packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v2/actions/conversation/update.operation.ts:39

	},
	{ ...metadataProperty, required: true },
];

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 [
		{

View on GitHub (pinned to 5ac6606e81)

Solutions

  1. Provide a valid conversation ID (e.g. 'conv_abc123') in the conversationId field
  2. If using an expression, verify the upstream data has the conversation ID field populated
  3. Add an IF node before this operation to skip items missing a conversation ID

Example fix

// before — conversationId: '' or conversationId: {{$json["missingField"]}}
// after  — conversationId: 'conv_abc123'
Defensive patterns

Strategy: validation

Validate before calling

const conversationId = this.getNodeParameter('conversationId', i, '') as string;
if (!conversationId || !conversationId.trim()) {
  throw new UserError('Conversation ID is required to update a conversation.');
}

Type guard

function isNonEmptyString(value: unknown): value is string {
  return typeof value === 'string' && value.trim().length > 0;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12). Data as JSON: /api/errors/4bd21e96f5432c7b. Report an issue: GitHub.