an object to apply the updates ONTO, defaulting to a fresh one. Pass the current
payload when the mapping must see what is already there — which is the only way name[] can
mean anything, since appending is defined relative to an existing list. A loop applying its
body's mapping once per pass needs exactly this: with a fresh object each pass, every append
produces a new one-element array that replaces the last, and the loop keeps only its final
iteration. The object is mutated, so callers that must not disturb the value they hold
should pass a copy.
Applies a step's output mapping, producing payload updates and any special fields.
This is what makes a branch condition possible. A workflow that branches on
payload.stockPricehas that value only because an earlier step mappedCurrentPrice -> stockPrice. Skip this and the condition readsundefined, which is merely falsy — so the workflow takes the wrong branch without anything reporting a problem.Values that resolve to
undefinedare skipped rather than written, so a step that did not produce an optional field leaves the payload as it was instead of stamping it with nothing.