Skip to content

Add CheckPrerequisite to WorkflowStep to validate state machine edges#374

Draft
Zoe Zhao (zoez7) wants to merge 1 commit into
agent-substrate:mainfrom
zoez7:check-prerequisite
Draft

Add CheckPrerequisite to WorkflowStep to validate state machine edges#374
Zoe Zhao (zoez7) wants to merge 1 commit into
agent-substrate:mainfrom
zoez7:check-prerequisite

Conversation

@zoez7

Copy link
Copy Markdown
Collaborator

Fixes #369

Add a CheckPrerequisite method to the WorkflowStep interface, called by RunWorkflow after IsComplete returns false and before Execute, so that each workflow validates its actor state-machine edge up front while retried (reentrant) workflows still fast-forward past completed steps.

  • MarkPausingStep and MarkSuspendingStep now require STATUS_RUNNING and return FailedPrecondition instead of silently no-oping and failing later with an internal error.
  • AssignWorkerStep allows SUSPENDED, PAUSED, and RESUMING (the latter for client-driven forward recovery) and rejects other statuses.

Add a CheckPrerequisite method to the WorkflowStep interface, called by
RunWorkflow after IsComplete returns false and before Execute, so that
each workflow validates its actor state-machine edge up front while
retried (reentrant) workflows still fast-forward past completed steps.

- MarkPausingStep and MarkSuspendingStep now require STATUS_RUNNING and
  return FailedPrecondition instead of silently no-oping and failing
  later with an internal error.
- AssignWorkerStep allows SUSPENDED, PAUSED, and RESUMING (the latter
  for client-driven forward recovery) and rejects other statuses.

Fixes agent-substrate#369
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Actor state machine] Add CheckPrerequisite steps to WorkflowStep definition

1 participant