GUID V4 - Random-Based Identifier (Recommended)
GUID v4 is the most widely used random-based identifier. Learn about its structure, collision probability, advantages and why it is recommended for general-purpose applications.
Generate UUIDs in n8n Code nodes with JavaScript runtime features for v4. UUID v7 depends on whether your deployment allows the package or custom code path you need.
return [
{
json: {
id: crypto.randomUUID(),
},
},
];UUID v7 is possible only if your n8n environment allows the code or package path you need. In many setups, this is not available by default.
// Example only when your deployment allows the uuid package
import { v7 as uuidv7 } from 'uuid';
return [
{
json: {
id: uuidv7(),
},
},
];These articles expand on related concepts, formats and practical considerations.