Skip to main content

Workflow Business Rules

Summary

This is the authoritative catalog of 30 verified Workflow business rules.

Business Purpose

Provide a reviewable source of truth for authoring, publication, routing, task decisions, tenancy and evidence behavior.

Actors

Workflow authors, approvers, delegates, process initiators, tenant administrators, product owners, support teams and owners of connected business modules.

Business Flow

IDRuleTriggerOutcomeValidationSource
WF-BR-01Tenant context is required for commandsCreate, update, publish, start or task actionOperation uses tenant scopeMissing tenant raises request errorApplication/Common/Abstractions.cs
WF-BR-02Definition key is requiredCreateInvalid resultNonblank checkWorkflowDefinitionCommands.cs
WF-BR-03Definition name is requiredCreateInvalid resultNonblank checkWorkflowDefinitionCommands.cs
WF-BR-04Key is tenant-uniqueCreateConflict if duplicateRepository existence check and unique indexWorkflowDefinitionCommands.cs
WF-BR-05Category defaults to GeneralCreate without categoryGeneral storedDomain factory fallbackWorkflowDefinition.cs
WF-BR-06Creation opens draft version 1CreateDefinition/Draft v1Domain factoryWorkflowDefinition.cs
WF-BR-07Submitted steps replace draft contentsCreate/update with stepsSteps and conditions rebuiltPublished guardWorkflowDefinition.cs
WF-BR-08Approver type must be recognizedBuild stepsInvalid result for unknown typeFlexible enum parseWorkflowDefinitionCommands.cs
WF-BR-09Step type defaults to ApprovalMissing/unknown step typeApproval storedParse fallbackWorkflowDefinitionCommands.cs
WF-BR-10Step mode defaults to SequentialMissing/unknown modeSequential storedParse fallbackWorkflowDefinitionCommands.cs
WF-BR-11Published versions are immutableReplace published stepsDomain rejectionIsPublished guardWorkflowDefinition.cs
WF-BR-12Editing steps after publish creates next draftUpdate with stepsVersion number incrementsEditable-draft selectionWorkflowDefinition.cs
WF-BR-13Publication needs a current draftPublishInvalid without draftDomain validationWorkflowDefinition.cs
WF-BR-14Publication needs at least one stepPublishInvalid empty draftStep-count checkWorkflowDefinition.cs
WF-BR-15Start needs definition ID or keyStartInvalid otherwiseInput branchWorkflowInstanceCommands.cs
WF-BR-16Start needs a published versionStartInvalid without published versionPublished-version lookupWorkflowInstanceCommands.cs
WF-BR-17Empty context is not serializedStartNull context JSONContext-count checkWorkflowInstanceCommands.cs
WF-BR-18Stages are considered in ascending orderStart/advanceEarliest later applicable stage opensOrdered distinct step ordersWorkflowInstanceCommands.cs
WF-BR-19All stage conditions must passStage evaluationFailed stage is skippedIterative all-condition checkWorkflowInstanceCommands.cs
WF-BR-20Conditions support equality and inequalityStage evaluationCase-insensitive comparisonne/neq; other values act as eqWorkflowInstanceCommands.cs
WF-BR-21No applicable stage auto-completesStart/advanceCompleted/ApprovedNull next-stage resultWorkflowInstanceCommands.cs
WF-BR-22Same-order steps open togetherOpen stageOne task per stepStep-order groupingWorkflowInstanceCommands.cs
WF-BR-23Stage advances after all tasks are nonpendingApprovalNext stage or completionStage completion checkWorkflowInstance.cs
WF-BR-24User approver uses configured userOpen stageAssignedTo populatedApprover resolverWorkflowInstanceCommands.cs
WF-BR-25Manager uses context then fallback valueOpen stageAssignedTo resolvedmanagerEmail/manager/value fallbackWorkflowInstanceCommands.cs
WF-BR-26Role, HR and Admin become role assignmentsOpen stageAssignedRole populatedApprover resolverWorkflowInstanceCommands.cs
WF-BR-27My tasks returns matching pending assignmentsQuery worklistCaller email/role tasksStatus and identity predicateWorkflowQueries.cs
WF-BR-28Decisions require Running/PendingApprove/reject/delegateConflict otherwiseStatus checksWorkflowInstanceCommands.cs
WF-BR-29Any rejection rejects the instanceReject taskRejected result and completion timeAggregate transitionWorkflowInstance.cs
WF-BR-30Delegation requires a destination and remains pendingDelegateUser reassigned; role clearedNonblank and status checksWorkflowInstanceCommands.cs

Responsibilities

Authors maintain valid draft steps before publication. Initiating modules supply a subject and routing context. Approvers act only on applicable pending tasks. Tenant and service owners govern access, integration enablement and operational support.

Business Rules

Catalog rules describe current implementation, not recommended policy. Audit/timeline/outbox atomicity and tenant query filtering are documented as control behavior outside the numbered execution catalog.

Integrations

Workflow Service owns definitions, versions, instances and tasks. Connected modules can synchronously start and read instances when their integration is enabled; lifecycle domain events are persisted to an outbox and relayed as integration events.

Limitations

Actor-to-assignment enforcement is absent; stored step mode does not alter execution; unsupported state enum values are not business capabilities.

Requires Confirmation

Production enablement, approver-role naming, upstream access enforcement, terminal decision propagation, notification ownership, retention and operating procedures require confirmation.

Source References

  • microservices/src/workflow-service/Domain/Workflow/WorkflowDefinition.cs
  • microservices/src/workflow-service/Domain/Workflow/WorkflowInstance.cs
  • microservices/src/workflow-service/Application/Commands/WorkflowDefinitionCommands.cs
  • microservices/src/workflow-service/Application/Commands/WorkflowInstanceCommands.cs
  • microservices/src/workflow-service/Application/Queries/WorkflowQueries.cs

See Also

Keywords

Workflow, approval, definition, version, task, delegation.

Revision Information

Draft source-backed business documentation reviewed on 2026-07-20; next quarterly review is 2026-10-20.