0CodeKit icon

0CodeKit

A toolbox of no-code utilities

Actions108

Overview

This node, part of a multifunctional toolbox, provides utilities to generate random numbers within a specified range. It supports generating either integer or decimal numbers between user-defined start and end values. This functionality is useful in scenarios such as creating randomized test data, generating unique identifiers, or simulating numeric inputs for workflows.

For example, you could use this node to:

  • Generate a random integer between 1 and 100 for sampling purposes.
  • Create a random decimal number between 0.5 and 5.5 for financial simulations.

Properties

Name Meaning
Code Variables A collection of named variables defined in the code editor that can be assigned specific values. Useful for passing dynamic values into custom code functions.
Range Start The minimum value (inclusive) of the generated number range.
Range End The maximum value (inclusive) of the generated number range.
Type Specifies whether the generated number should be an "Integer" or a "Decimal".

Output

The output JSON contains the generated number(s) based on the input parameters. Each execution returns one or more numbers within the specified range and type.

If multiple input items are processed, the output will be an array of generated numbers corresponding to each input item.

No binary data output is produced by this operation.

Dependencies

  • Requires an API key credential for authentication with the external service powering the node's operations.
  • The node makes HTTP POST requests to an external API endpoint under the path generate/number with parameters specifying the type and range.

Troubleshooting

  • Common issues:

    • Providing a Range Start value greater than Range End may cause unexpected results or errors.
    • Omitting required properties like Range Start, Range End, or Type will prevent successful execution.
    • Incorrect API credentials or network issues can lead to failed requests.
  • Error messages:

    • Errors related to invalid parameter values typically indicate misconfiguration of input properties.
    • Authentication errors suggest missing or invalid API key credentials; ensure proper setup in n8n.
    • Network or timeout errors require checking connectivity to the external API service.

Links and References

  • n8n Expressions Documentation — for using expressions in variable definitions.
  • No direct external links to the underlying API are provided in the source code.

Discussion