Utility Functions

Utility function components provide essential helper operations and common functionality for workflow enhancement and data management.

Current Date

The Current Date component returns the current date and time in a selected timezone. This component provides a flexible way to obtain timezone-specific date and time information within a BroxiAI pipeline.

Usage

Current Date features:

  • Timezone-aware date/time generation

  • Multiple format options

  • Real-time date retrieval

  • Locale support

  • Custom formatting

Inputs

Name
Display Name
Info

timezone

Timezone

Select the timezone for the current date and time.

format

Date Format

Custom date/time format string

locale

Locale

Locale for date formatting

Outputs

Name
Display Name
Info

current_date

Current Date

The resulting current date and time in the selected timezone.

timestamp

Timestamp

Unix timestamp of the current date/time

iso_format

ISO Format

ISO 8601 formatted date/time string

ID Generator

This component generates a unique ID.

Usage

ID Generator capabilities:

  • Unique identifier generation

  • Multiple ID formats

  • Collision-resistant IDs

  • Custom prefixes

  • Sequential numbering

Inputs

Name
Display Name
Info

id_type

ID Type

Type of ID to generate (UUID, sequential, custom)

prefix

Prefix

Optional prefix for the generated ID

length

Length

Length of the generated ID (for custom types)

unique_id

Value

The generated unique ID.

Outputs

Name
Display Name
Info

id

ID

The generated unique ID.

Advanced Utility Features

Date/Time Operations

  • Timezone Conversion: Convert between timezones

  • Date Arithmetic: Add/subtract time periods

  • Date Formatting: Custom date format strings

  • Relative Dates: Generate relative date strings

  • Date Validation: Validate date formats and ranges

ID Generation Strategies

UUID Types

  • UUID4: Random UUID generation

  • UUID1: Time-based UUID with MAC address

  • UUID3: Name-based UUID using MD5

  • UUID5: Name-based UUID using SHA-1

  • Short UUID: Shortened UUID for readability

Sequential IDs

  • Auto-increment: Sequential numeric IDs

  • Prefixed Sequential: Sequential with custom prefix

  • Date-based: IDs incorporating date/time

  • Counter-based: Thread-safe counter IDs

  • Hierarchical: Nested ID structures

Custom Formats

  • Alphanumeric: Letters and numbers

  • Numeric Only: Numbers only

  • Base64: Base64 encoded IDs

  • Hex: Hexadecimal IDs

  • Custom Pattern: User-defined patterns

Utility Patterns

Data Generation

  • Random Data: Generate random test data

  • Sample Data: Create sample datasets

  • Mock Data: Generate mock objects

  • Test Fixtures: Create test data fixtures

  • Seed Data: Generate seed data for databases

String Operations

  • Text Processing: Common string operations

  • Pattern Matching: Regular expression utilities

  • Text Transformation: Case conversion, trimming

  • String Validation: Validate string formats

  • Text Generation: Generate formatted text

Number Operations

  • Mathematical Functions: Common math operations

  • Number Formatting: Format numbers for display

  • Random Numbers: Generate random numbers

  • Statistical Functions: Basic statistical calculations

  • Number Validation: Validate numeric inputs

Configuration Options

Date/Time Configuration

{
  "timezone": "UTC",
  "format": "YYYY-MM-DD HH:mm:ss",
  "locale": "en-US",
  "include_milliseconds": false,
  "use_24_hour": true
}

ID Generation Configuration

{
  "type": "uuid4",
  "prefix": "user_",
  "length": 12,
  "charset": "alphanumeric",
  "case": "lowercase"
}

Use Cases

Workflow Timestamps

  • Audit Trails: Track when operations occurred

  • Log Entries: Timestamp log messages

  • Data Versioning: Version data with timestamps

  • Performance Monitoring: Measure execution times

  • Scheduling: Schedule future operations

Entity Management

  • User IDs: Generate unique user identifiers

  • Session IDs: Create session identifiers

  • Transaction IDs: Track transaction identifiers

  • Document IDs: Unique document references

  • Correlation IDs: Trace requests across systems

Data Processing

  • Batch Processing: Identify batch runs

  • Data Lineage: Track data processing steps

  • Error Tracking: Unique error identifiers

  • Version Control: Version data changes

  • State Management: Track state changes

Integration Benefits

Workflow Integration

  • Easy Connection: Simple input/output interface

  • Type Safety: Properly typed outputs

  • Error Handling: Robust error management

  • Performance: Optimized for high-frequency use

  • Caching: Cache results when appropriate

Development Productivity

  • Common Operations: Eliminate repetitive coding

  • Standardization: Consistent utility functions

  • Reusability: Reuse across multiple workflows

  • Testing: Well-tested utility functions

  • Documentation: Comprehensive usage examples

Reliability Features

  • Error Recovery: Handle edge cases gracefully

  • Input Validation: Validate all inputs

  • Output Consistency: Consistent output formats

  • Performance Monitoring: Track usage metrics

  • Logging: Comprehensive operation logging

Usage Notes

  • Thread Safety: All utilities are thread-safe

  • Performance: Optimized for high-frequency operations

  • Compatibility: Compatible with all workflow components

  • Extensibility: Easy to extend with custom utilities

  • Standards Compliance: Follow industry standards

  • Localization: Support for multiple locales and timezones

Last updated