OptionalinputValidate step input before execution
OptionaloutputValidate step output after execution
OptionalretryOptionaltimeoutOptionalcompensateA METHOD taking a permissively-typed context, and every part of that is load bearing. Three forms were measured against real handler shapes:
shape union method
Not a union (TypedCompensateHandler | CompensateHandler): TypeScript cannot
contextually type a parameter against a union of signatures, so the inline arrow
every documented example uses was an implicit any and failed noImplicitAny.
A method rather than a property so parameters stay bivariant under
strictFunctionTypes, which is what lets an explicitly annotated handler through.
any rather than TSteps for the step map, deliberately: with TSteps an
annotation naming a step this workflow does not declare is rejected, and the
published union accepted it. Keeping the looser map costs typed access to
ctx.steps inside a rollback, which handlers already narrow with a cast in
practice, and buys source compatibility with every handler written before.
Options for a single step.
TStepsis part of the signature for source compatibility and for symmetry withTypedStepHandler, even thoughcompensateno longer narrows on it (see below). Removing the parameter would break every explicitStepOptions<In, Steps>in user code.