Skip to content

Stack Rows

Aggregation

Concatenate rows from two or more inputs into a single output. In union mode the output schema is the union of all input columns and missing fields are filled with null; in strict mode every input must already share the same columns. Use it to combine monthly exports, append archived rows to live data, or merge per-region files before further processing.

Stack Rows is a multi-input batch transform: it accepts an arbitrary number of input streams and emits one combined output. Inputs are read fully into memory and concatenated in input order (input 1’s rows first, then input 2’s rows, etc.); within each input, original row order is preserved.

In union mode, the executor scans every row across every input to build the union of column names, then normalizes each row to that full column set with missing keys set to null. This means the output rows always have identical shape, even if the source files had different columns.

In union_strict mode, no normalization happens — rows are concatenated as-is. The schema check happens at design time via getOutputSchema; if you connect inputs with mismatched columns the flow editor surfaces an error before execution.

Input: Two or more tabular data connections. Output: All rows from all inputs, in input order, with the union (or strict) column set.

OptionTypeDefaultDescription
mode"union" | "union_strict""union""union" fills missing columns with null. "union_strict" rejects schema mismatches at design time.

Combine two monthly exports with the same columns

Section titled “Combine two monthly exports with the same columns”

You have January and February sales exports with identical columns and want a single combined dataset.

Input 1 (January):

order_idcustomeramount
1001Acme Corp250
1002Beta Inc750

Input 2 (February):

order_idcustomeramount
1003Gamma LLC1100
1004Delta Co500

Configuration: mode: union (or union_strict — both produce identical output when schemas match).

After:

order_idcustomeramount
1001Acme Corp250
1002Beta Inc750
1003Gamma LLC1100
1004Delta Co500

Stack inputs with different columns (union mode fills nulls)

Section titled “Stack inputs with different columns (union mode fills nulls)”

The 2025 export added a region column that wasn’t in the 2024 export. You want both years stacked.

Input 1 (2024):

order_idcustomeramount
901Acme Corp200

Input 2 (2025):

order_idcustomeramountregion
1001Beta Inc800EU

Configuration: mode: union.

After:

order_idcustomeramountregion
901Acme Corp200
1001Beta Inc800EU

The first row’s region is null because the 2024 input did not have that column.

  • Union mode rebuilds every row. The executor walks every row across every input twice — once to discover column names, once to normalize — so memory and CPU scale with total row count, not just unique-column count. For very large stacks where you know the schemas already match, prefer union_strict to skip the second pass. See apps/web/src/transforms/stack-rows/logic.ts:45-65.
  • Missing columns are null, not empty string. Filter Rows’ is empty operator matches both, but downstream Change Type rules on null skip the parser and write null; on "" the string target writes "". The distinction matters when exporting to CSV where the two render differently. See apps/web/src/transforms/stack-rows/logic.ts:53-58.
  • Strict mode is enforced at design time, not at run time. union_strict does not error if rows have unexpected keys — it concatenates them as-is and downstream sees a ragged schema. The schema-mismatch error comes from getOutputSchema in the flow editor. See apps/web/src/transforms/stack-rows/logic.ts:41-43 and apps/web/src/transforms/stack-rows/logic.ts:78-87.
  • Lookup — join rows by a key column instead of stacking them vertically.
  • Group By — collapse stacked rows into per-key aggregates after combining.
  • Filter Rows — remove unwanted rows from a stacked dataset.