Generator icon

Generator

Create Objects

Overview

The Generator node is designed to create a specified number of empty objects. This can be useful in workflows where you need to generate placeholder items, trigger downstream nodes multiple times, or simulate data for testing and development purposes.

Practical examples:

  • Generating N empty items to iterate over with an n8n Loop or SplitInBatches node.
  • Creating placeholders for later enrichment by other nodes.
  • Simulating input for workflow testing.

Properties

Name Type Meaning
Amount Number The number of empty objects to generate.

Output

The node outputs an array containing the specified number of items. Each item has an empty json object:

[
  { "json": {} },
  { "json": {} },
  ...
]

The number of items in the output array matches the value set in Amount.

Dependencies

  • No external services, API keys, or special n8n configurations are required.

Troubleshooting

  • Common issue: Setting the Amount property to a non-integer or negative value may result in unexpected behavior (e.g., no items generated).
  • Error messages: If an invalid value is provided for Amount, the node may throw an error such as "Parameter 'amount' is not valid." Ensure that Amount is a positive integer.

Links and References

Discussion