0-CodeKit icon

0-CodeKit

A toolbox of no-code utilities

Overview

This node generates a random number within a specified range. You can choose whether the result is an integer or a decimal. This functionality is useful in scenarios where you need to create test data, simulate randomness, or automate processes that require randomization (e.g., generating lottery numbers, randomizing user assignments, or creating randomized tokens).

Practical examples:

  • Generating a random order number for testing.
  • Assigning users to groups randomly.
  • Creating randomized discount codes.

Properties

Name Meaning
Range Start The minimum value of the generated number (inclusive).
Range End The maximum value of the generated number (inclusive).
Type Specifies the type of number to generate. Options: Integer, Decimal.

Output

The output will be a JSON object containing the generated number. The structure typically looks like:

{
  "number": <generated_value>
}

Where <generated_value> is the random number generated according to your settings.

Dependencies

  • External Service: Requires access to the CodeKit API service.
  • Credentials: n8n credential named codeKitApi must be configured.

Troubleshooting

  • Common Issues:
    • If the Range Start is greater than Range End, the node may return an error or unexpected results.
    • Missing or invalid credentials (codeKitApi) will prevent the node from functioning.
  • Error Messages:
    • "Missing required parameter": Ensure all required fields are filled.
    • "Invalid range": Check that Range Start is less than or equal to Range End.
    • "Authentication failed": Verify your codeKitApi credentials.

Links and References

Discussion