Flatten
INPUT CONTRACT
target: Collection (variable or ID)out: Variable name
REQUIREMENTS:
targetMUST be Collection
NOT SUPPORTED:
- ❌ Note (use
splitto convert Note → Collection first)
OUTPUT
Returns single Note containing merged content from all Collection items.
FAILURE SEMANTICS
Returns failed when:
- Target is Note (not Collection)
- Missing parameters
Empty Note ≠ error — indicates empty Collection, not failure.
REPRESENTATION INVARIANTS
- Collection ≠ Note containing array
flattenperforms inverse ofsplit(Collection → Note)- Use
splitto convert array → Collection
ANTI-PATTERNS
❌ flatten(target=$note) → Must be Collection
❌ Expecting structured output → Returns merged content, structure may be lost