I’m testing the measurement part of the local helper store used alongside my self-hosted n8n publishing project. The case is a metrics collection run that gets a real zero for one field and no value for others.
The failure I want to avoid is a later reporting step silently turning “not measured” into “no engagement”.
Synthetic input and observed result
Today’s focused local test supplied views: 4, posts_count: 1 and responses_from_others: 0, while omitting likes and followers gained.
| Field | Stored result |
|---|---|
| responses_from_others | 0 |
| likes | null |
| followers_gained | null |
The normalisation in my custom helper is equivalent to:
const storedValue = inputValue ?? null;
This preserves a measured zero. I keep unavailable values as null through storage rather than filling them with zero for the report.
The retry check
The same test reopens the file-backed store and submits the exact same observation again. The helper returns duplicate: true.
The observation identity in this implementation is:
channel + publication URL + source + captured_at
A genuinely later collection needs its own capture time. Replaying a collection should preserve the original capture time; creating a new timestamp during a retry would make it a different observation under this rule.
For a workflow calling this helper, my intended boundary is: retain the observation and capture time, write it, and retry that same observation after an uncertain response. That workflow-level uncertain-response path is not what today’s test exercised.
What this actually verifies
The single focused test passed: missing fields stayed null, a known zero stayed zero, and an identical observation was recognised after reopening the store. It uses synthetic data and my own helper code; it does not verify live platform analytics, n8n’s built-in storage, concurrent collectors, or end-to-end publishing.
My next check is how an unavailable metric is displayed downstream, so a chart or spreadsheet does not undo the storage distinction.
If your n8n reporting workflow writes to Sheets or a database, how do you distinguish a measured zero from a metric the source did not provide?