n8n-io/n8n · error · NodeOperationError
An assistant with the same name '${name}' already exists
Error message
An assistant with the same name '${name}' already exists What it means
Before creating a new OpenAI assistant, the code paginates through all existing assistants (following has_more/last_id pagination) and collects their names. If the requested assistant name already exists on the account, it throws a NodeOperationError to prevent a duplicate. This is a client-side pre-validation check before the POST to /v1/assistants.
Source
Thrown at packages/@n8n/nodes-langchain/nodes/vendors/OpenAi/v1/actions/assistant/create.operation.ts:220
after,
},
})) as { data: IDataObject[]; has_more: boolean; last_id: string };
for (const assistant of response.data || []) {
assistants.push(assistant.name as string);
}
has_more = response.has_more;
if (has_more) {
after = response.last_id;
} else {
break;
}
} while (has_more);
if (assistants.includes(name)) {
throw new NodeOperationError(
this.getNode(),
`An assistant with the same name '${name}' already exists`,
{ itemIndex: i },
);
}
}
if (file_ids.length > 20) {
throw new NodeOperationError(
this.getNode(),
'The maximum number of files that can be attached to the assistant is 20',
{ itemIndex: i },
);
}
const body: IDataObject = {
model,
name,View on GitHub (pinned to 5ac6606e81)
Solutions
- Use a unique assistant name, or append a timestamp/UUID to the name
- Delete the existing assistant with the same name from the OpenAI dashboard before re-running
- Switch to an 'Update Assistant' operation if the intent is to modify an existing one
Example fix
// before — name: 'My Assistant'
// after — name: `My Assistant ${Date.now()}` Defensive patterns
Strategy: validation
Validate before calling
// Check for existing assistant name before creating
const existingNames = await listExistingAssistantNames(this);
if (existingNames.includes(name)) {
// Use a unique name or update instead
name = `${name}-${Date.now()}`;
} Try / catch
try {
await createAssistant(this, i);
} catch (error) {
if (error instanceof NodeOperationError && error.message.includes('already exists')) {
// Retry with a unique name or switch to update
name = `${name}-${Date.now()}`;
await createAssistant(this, i);
}
throw error;
} Prevention
- Use unique assistant names — append timestamps or UUIDs for programmatic creation
- Before creating, list existing assistants and skip or update if the name exists
- Use idempotent workflow patterns that check-then-create
When it happens
Trigger: The 'Create Assistant' operation is called with a name that matches an existing assistant on the OpenAI account. The code lists all assistants via paginated GET requests, and if the name is found in the list, it aborts before creating.
Common situations: Running the same create-assistant workflow multiple times without changing the name; migrating or replaying workflows that create named assistants; accidental duplicate workflow executions.
Related errors
- The maximum number of files that can be attached to the assi
- The maximum number of files that can be attached to the assi
- ${error.message}
- Invalid file_ids type
- The file content is not in JSONL format
AI-assisted analysis of n8n-io/n8n@5ac6606e81 (2026-08-12).
Data as JSON: /api/errors/d5336cce2049f35a.
Report an issue: GitHub.