once

Declares the F004 effect-key on a step using the conversational once per { } syntax.

Equivalent to calling builder.effectKey { ctx -> key } on the typed ca.acendas.kstate.saga.SagaBuilder. The lambda receives the saga context and must return a non-blank string uniquely identifying the step's side effect within a run. Blank keys are rejected at Intent-append time.

On replay, if a prior ca.acendas.kstate.saga.journal.EntryPhase.Effect entry with a matching key exists in the journal, the step short-circuits (F004 behavior — not new here).

once per can appear before or after otherwise { } in the chain — ordering does not matter.

Example

first call Step.CHARGE with { ctx ->
chargeService.charge(ctx.orderId, ctx.amount)
} once per { ctx ->
"charge:${ctx.orderId}:${ctx.amount}"
} otherwise { result ->
chargeService.refund(result.txId)
}

Return

This step configuration for further chaining.

Parameters

key

A PerKey produced by per { ctx -> key }.