uuid

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

UUID node

The uuid node generates a fresh RFC 9562 UUID for every input message and writes it to a configured message property.

It is useful for correlation IDs, database keys, idempotency keys, file names, external API references, and other workflow-local identifiers.

Behavior

  • Exactly one new UUID is generated per executed input message.
  • UUIDs are emitted in canonical lowercase string form, for example 018f3d2c-ca7b-7f42-9e11-65c8a4f1d2ab, or in the dashless 32-character hex form when format is hex.
  • The input message object is preserved. Unrelated payload and metadata fields are left unchanged.
  • The node uses Go's standard-library uuid package. It does not require a third-party UUID dependency.

Configuration

Field Values Default Description
version v7, v4 v7 UUID version to generate. v7 is time-ordered and preferred for new identifiers. v4 is random and useful for compatibility with systems that expect random UUIDs.
target message property path payload Where the UUID string is written. Use payload to replace the payload, or a path such as msg.identifiers.correlation to write metadata.
format canonical, hex canonical Output format. canonical is the hyphenated RFC 9562 text form (36 characters); hex is the dashless 32-character form for systems with strict key formats.

Examples

With the default configuration:

version: v7
target: payload

an input message with any payload produces an output message whose payload is a newly generated v7 UUID string.

With metadata output:

version: v4
target: msg.identifiers.correlation

the original payload is unchanged and the generated v4 UUID is available at:

msg.identifiers.correlation

Validation

The node rejects unsupported versions, blank target property names, and unsupported formats during construction or execution. Configurations stored before the format field existed carry no value and keep producing the canonical hyphenated form.

Documentation

Overview

Package uuid contains the UUID node: RFC 9562 UUID generation using Go's standard-library uuid package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Version string `json:"version"`
	Target  string `json:"target"`
	Format  string `json:"format"`
}

Config holds the UUID node configuration.

type Node

type Node struct {
	*nodebase.BaseNode
	// contains filtered or unexported fields
}

Node writes a freshly generated UUID into each input message.

func NewNode

func NewNode(node nodestore.NodeInterface, cfg *Config) *Node

NewNode creates a UUID node.

func (*Node) Execute

Execute generates one fresh UUID for this input message. Generation is deliberately independent of the input payload so every retry, branch, and replay gets a new identifier unless the workflow itself persists one.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL