399
stateProvisionallyCompleted,
400
stateProvisionallyCompletedAfterAccepted,
402
>
// Provisional states are transient — they exist only between an event write
403
>
// and its OnAfterCommit callback within a single workflow task completion
404
>
// transaction. In practice, AttachCallbacks should never see these states because
405
>
// a new UpdateWorkflowExecution API call must acquire the workflow lock,
406
>
// which means the previous transaction has already committed and provisional
407
>
// states have resolved. This guard is kept defensively in case future code
408
>
// paths call AttachCallbacks within the same transaction.
409
>
return false, serviceerror.NewResourceExhausted(enumspb.RESOURCE_EXHAUSTED_CAUSE_BUSY_WORKFLOW, "workflow update is not yet accepted, please retry")
410
411
case stateSent: