All guides

n8n AI result statistics: grouping and missing fields

Aggregate counts by existing labels and distinguish statistics from model summaries.

AINavWritten / Updated Sources checked
On this page

At a glance

This guide explains an AI workflow data task from official node documentation and checks public synthetic inputs locally. It does not run n8n, sign in or call a model API. Documented steps and local inspection are separate.

Input, conversion and checks

  1. Prepare input

    Inspect actual data, fields and prerequisites.

  2. Select conversion

    Choose the task mode and destination field.

  3. Inspect output

    Account for missing items and errors before continuing.

Establish input and receiver contracts before downstream work.

Count existing records

The fixture has keep, review and keep labels, each with count=1. Summarize aggregates items similarly to a pivot table; it does not call a model to write a summary. Establish grouping and numeric fields first. Counts do not establish label accuracy or model judgment quality.

Configure aggregation and grouping separately

Select Sum under Fields to Summarize and set Field to count. Set Fields to Split By to label; multiple fields are comma-separated. Output Format offers Each Split in a Separate Item or All Splits in a Single Item. Count counts values and Count Unique counts distinct values, so choose according to the intended statistic.

Do not silently treat absent fields as zero

By default, a summary field missing from every item causes an error; Continue if Field Not Found instead returns one empty item. Ignore items without valid fields to group by can exclude inputs lacking grouping fields. Local fixture summation gives keep=2 and review=1, without running the node. In actual inspection, account for inputs, excluded records and empty output before proceeding.

Article sources

Original editorial content; official descriptions and checking suggestions are distinguished.

  1. n8n · Official sources
    View details