Files
floci/docs/services
Ovidiu (Ovi) 917e94914f feat(sfn): apply ItemBatcher to distributed Map children (#3604)
* feat(sfn): apply ItemBatcher to distributed Map children

ItemBatcher was parsed and then ignored: every child execution received one
item regardless of MaxItemsPerBatch, so a state machine that batches ran with a
different payload shape locally than on AWS, silently.

Items are now grouped into batches and each child execution receives
{"BatchInput": ..., "Items": [...]}. A batch closes on MaxItemsPerBatch or
MaxInputBytesPerBatch, in their literal, Path and JSONata expression forms, and
with neither set every item lands in one batch. ItemSelector still runs per item
before grouping, so the transform sees $$.Map.Item as it did before.

MaxConcurrency now bounds concurrent batches, and DescribeMapRun separates the
two counters it used to share: itemCounts counts items, executionCounts counts
child executions.

* fix(sfn): cap a batch at the 256 KiB child-input ceiling

MaxInputBytesPerBatch being optional let MaxItemsPerBatch alone build a child
input larger than Step Functions would ever start, and the byte count measured
the items alone, so a declared cap could still be exceeded by the envelope,
BatchInput and separators.

Batching now measures the serialized child payload and closes a batch at the
declared limit or at 256 KiB, whichever is smaller.

* fix(sfn): fail an item too large to start a child execution

An item whose serialized batch input already exceeded 256 KiB was added anyway,
because the split branch is skipped while the batch is empty, producing a child
input AWS would refuse to start.

Such an item now fails the state with States.DataLimitExceeded, naming its size
and pointing at ItemSelector as the way to reduce it.

* refactor(sfn): resolve every integer Map field through one helper

MaxConcurrency and the ItemBatcher limits read the same three forms, literal,
Path and JSONata expression, through two near-identical methods. The batcher one
already parameterized the field name, so the pair collapses into a single
resolver with a minimum: 0 for MaxConcurrency, where it means the service
ceiling, and 1 for a batch limit, where it is meaningless.

The shared resolver also clamps an oversized value to Integer.MAX_VALUE, which
only the MaxConcurrency copy did before.
2026-09-15 07:43:59 -04:00
..
2026-05-10 11:53:31 -05:00
2026-08-21 00:09:04 -04:00