Skip to content

Accumulation Get Length

Returns the number of items currently stored in an Accumulation. If the input is not a valid Accumulation object, the node safely returns 0.
Preview

Usage

Use this node when you need the count of items collected in an Accumulation, for example to control downstream logic, validate that items have been collected, or to drive iteration counts in a workflow. Typically paired with nodes that build or manipulate Accumulations (e.g., Accumulate, Accumulation Head/Tail, Accumulation To List).

Inputs

FieldRequiredTypeDescriptionExample
accumulationTrueACCUMULATIONThe Accumulation object whose item count will be measured. Internally expected to be a structure containing a list under the 'accum' key.{'accum': ['item1', 'item2', 'item3']}

Outputs

FieldTypeDescriptionExample
lengthINTThe number of items in the provided Accumulation. Returns 0 if the input is invalid or empty.3

Important Notes

  • Graceful fallback: If the input is not a valid Accumulation or lacks the expected structure, the node returns 0 instead of raising an error.
  • Type expectation: The Accumulation should be produced by compatible nodes (e.g., Accumulate) to ensure correct structure.
  • Category: SALT/Logic/Lists

Troubleshooting

  • Always returning 0: Ensure the input is a valid Accumulation produced by compatible nodes and that it contains an 'accum' list.
  • Unexpected small count: Verify that upstream steps actually appended items to the Accumulation before this node runs.
  • Downstream type mismatch: The output is an INT; if another node expects a different type (e.g., STRING), add a conversion step.