Overview
This node generates a UUID (Universally Unique Identifier) in two supported formats: with or without hyphens. It is useful when you need to create unique identifiers for records, transactions, or any entities requiring distinct IDs within workflows. For example, it can be used to generate unique user IDs, order numbers, or session tokens.
Properties
| Name | Meaning |
|---|---|
| ID格式 | Choose the format of the generated UUID: either 32 continuous characters without hyphens or 36 characters including hyphens. |
Options for "ID格式":
- 不带分隔符(32位): Generates a 32-character UUID without hyphens, e.g.,
550e8400e29b41d4a716446655440000 - 带分隔符(36位): Generates a 36-character UUID with hyphens, e.g.,
550e8400-e29b-41d4-a716-446655440000
Output
The node outputs a JSON object containing a single field:
{
"id": "string"
}
id: The generated UUID string in the selected format.
No binary data output is produced by this node.
Dependencies
- Uses the
uuidlibrary to generate version 4 UUIDs. - No external API keys or services are required.
- No special environment variables or n8n credentials needed.
Troubleshooting
- Error generating UUID: If an error occurs during UUID generation, the node throws an error with the message "生成UUID时出现错误" ("Error occurred while generating UUID"). This could happen due to unexpected internal issues but is generally rare.
- Ensure that the property "ID格式" is set correctly; invalid values might cause unexpected behavior.
- Since the node relies on a standard UUID library, conflicts or missing dependencies in the environment could cause failures.