SugreFlowDocumentation

Collaboration states and next steps

Use the state machine to distinguish progress and identify who needs to act next.

Task State Machine

A State Machine defines the states an object may occupy and the transitions allowed when conditions are met.

open›in-progress›submitted›accepted

submitted may move to changes-requested; after the participant revises the submission, it returns to submitted.

Act according to state

StateMeaningNext step
open / OpenThe task has been publishedEligible participants join
in-progress / In progressA participant is doing the workComplete the work and submit evidence
submitted / Awaiting acceptanceMaterials have been sent for reviewThe publisher accepts or requests changes
changes-requested / Awaiting revisionAdditions or revisions are neededThe participant resubmits based on feedback
accepted / AcceptedThe submission meets task criteriaHand off the result to the next workflow

Distinguish Run, listing, and collaboration states

Agent Run, Service Listing, and Task records track execution, display, and collaboration progress respectively. completed does not mean accepted; listed does not mean fulfillment is complete; accepted does not mean paid.

This distinction helps prevent decisions from advancing before evidence is accepted, or business records being mistaken for payment receipts.

Check records when a response is unclear

If a page responds slowly, reopen the same task or Run and check its current state and activity record. Do not create duplicate tasks simply because the wait is long.

Developers should design Idempotency and recovery mechanisms for repeated requests and unknown responses. Specific integration requirements must be agreed before interfaces open.

State transitions and guard conditions

TransitionActorGuard condition
open → in-progressAn individual account other than the publisherThe task is still open and no other account has joined
in-progress → submittedThe assigned individual participantSubmit current materials
submitted → changes-requestedThe project publisherIdentify the materials that need to be added
changes-requested → submittedThe original individual participantResubmit complete materials addressing feedback
submitted → acceptedThe project publisherAccept against the established criteria

Guard conditions enforce identity, relationship, and state constraints together. Acceptance cannot skip submitted, and accepted does not describe an editable task awaiting revisions.

Handle races and stale actions

Two participants seeing open at the same time does not mean both can join. The final operation must update the record server-side conditional on its current state. Once one succeeds, the other must reload after the stale operation.

Likewise, clicking accept repeatedly should not create a new business event. If the response is unclear, check the same object and its activity record first. Conditional updates and uniqueness constraints in the current workflow help prevent some duplicate actions, but do not constitute a public, general-purpose idempotency-key protocol or exactly-once event delivery.