Sizecheck icon

Sizecheck

Check if the current list exceeds a certain amount of data

Overview

The Sizecheck node evaluates the number of items in the incoming data list and compares it to a user-defined threshold. It can optionally ignore empty entries (items with no JSON keys). The node then routes the data to one of three outputs based on whether the count is less than, equal to, or greater than the threshold.

Common scenarios:

  • Branching workflow logic depending on the size of a dataset.
  • Triggering alerts or actions if a batch size exceeds or falls below a certain value.
  • Filtering out incomplete or empty records before counting.

Practical example:
If you want to send a notification only when more than 100 valid records are processed, you can use this node to check the count and connect the "more" output to your notification step.

Properties

Name Type Meaning
ThresholdValue Number The value to compare the list size to. Determines the branching point.
CountEmptyNodes Boolean Whether empty entries (data without JSON keys) should be ignored.

Output

  • The node has three outputs:

    • less: All input items are routed here if the (possibly filtered) count is less than the threshold.
    • equal: All input items are routed here if the count equals the threshold.
    • more: All input items are routed here if the count is greater than the threshold.
  • Each output returns an array of items, each with a json field containing the original item data. No additional fields are added or modified.

  • If the node is set to ignore empty entries, only non-empty items are counted for comparison, but all original items are passed through to the selected output.

Dependencies

  • No external services or API keys required.
  • No special n8n configuration or environment variables needed.

Troubleshooting

Common issues:

  • Unexpected output routing: If all items go to an unexpected output, check the values of "ThresholdValue" and "CountEmptyNodes". Remember that empty items may be ignored in the count.
  • All outputs empty: This should not occur unless there are no input items at all.

Error messages:

  • The node does not throw custom error messages under normal operation. Errors may occur if required parameters are missing, which would be handled by n8n's standard parameter validation.

Links and References

Discussion