PaulRentACar Docs
Administration

Workflow Configuration

Configure workflow definitions, versions, stages, transitions, assignment rules, approval rules, SLA rules, and notification rules.

Workflow Configuration

The workflow engine is a configurable state machine that controls how business entities (reservations, contracts, complaints, etc.) move through their lifecycle. Every status change goes through the workflow engine, ensuring consistent, auditable, and controllable business processes.

Workflow Configuration


Workflow Definitions

A workflow definition is the blueprint for a specific business process. Each entity type that uses the workflow engine has its own definition.

Pre-Seeded Workflow Definitions

DefinitionEntity TypePurpose
Reservation WorkflowReservationControls reservation lifecycle from draft to confirmation or cancellation
Rental Contract WorkflowRentalContractControls contract from checkout through active rental to return and closure
Complaint WorkflowComplaintCaseControls complaint handling from open to resolution
Customer Document VerificationCustomerDocumentControls document verification workflow
Driver Document VerificationDriverDocumentControls driver document verification
Refund WorkflowRefundControls refund approval and processing
Damage Assessment WorkflowVehicleDamageControls damage assessment and charge lifecycle
Maintenance WorkflowMaintenanceRequestControls vehicle maintenance request lifecycle

Workflow Definition Fields

FieldDescription
NameDisplay name (e.g., "Rental Contract Workflow")
Entity TypeThe business entity this workflow manages
DescriptionPurpose and scope of the workflow
StatusActive, Draft, Retired
Current VersionThe version currently in use
TenantWhich tenant this definition belongs to

Workflow Versions

Workflow definitions are versioned. When you need to change a workflow, you create a new version rather than modifying the active one.

Version Lifecycle

StatusDescription
DraftBeing designed, not yet in use
ActiveCurrently in use for new workflow instances
RetiredNo longer used; existing instances may still complete

Version Management Actions

ActionDescriptionPermission Required
Create VersionCreate a new draft version (cloned from active)workflow:configure
Edit VersionModify stages, transitions, or rules in a draftworkflow:configure
Activate VersionSet a draft version as active (deactivates previous)workflow:configure
Deactivate VersionStop using a version (must have a replacement)workflow:configure
Clone VersionDuplicate an existing version as a new draftworkflow:configure

Existing workflow instances always complete using the version they were created with. Changing the active version only affects new instances. This ensures backward compatibility.


Workflow Stages

Stages represent the status states an entity can be in. Each workflow definition includes a set of stages.

Example: Rental Contract Workflow Stages

Stage CodeDisplay NameDescription
draftDraftContract created, not yet finalized
checkout_pendingCheckout PendingWaiting for vehicle checkout process
activeActiveVehicle checked out, rental in progress
extension_requestedExtension RequestedCustomer requested contract extension
return_pendingReturn PendingVehicle return process initiated
damage_reviewDamage ReviewDamage assessed, awaiting resolution
billing_reviewBilling ReviewFinancial review before closure
closedClosedContract fully completed and closed
cancelledCancelledContract cancelled

Stage Configuration Fields

FieldDescription
CodeUnique identifier (used in transitions)
Display NameHuman-readable name
DescriptionWhat this stage means
Is InitialWhether this is the starting stage
Is TerminalWhether this stage ends the workflow
SLA RuleDefault SLA rule for tasks in this stage
ColorUI color for status badges

Workflow Transitions

Transitions define how an entity moves from one stage to another. Each transition is triggered by an action.

Example: Rental Contract Transitions

From StageAction CodeTo StageRequired PermissionApproval Rule
draftsubmitcheckout_pendingcontract:create
checkout_pendingcheckoutactivecontract:checkout
activerequest_extensionextension_requestedcontract:update
activeinitiate_returnreturn_pendingcontract:checkin
extension_requestedapprove_extensionactivecontract:updateextension_approval
extension_requestedreject_extensionactivecontract:update
return_pendingcomplete_returnbilling_reviewcontract:checkin
return_pendingflag_damagedamage_reviewcontract:checkin
damage_reviewresolve_damagebilling_reviewdamage:approve_charge
billing_reviewconfirm_billingclosedbilling:approve_entries
draftcancelcancelledcontract:cancel

Transition Configuration Fields

FieldDescription
From StageCurrent stage required for this transition
Action CodeUnique code for the action
Action LabelDisplay name for the action button
To StageStage to move to after the action
Required PermissionPermission needed to execute this action
Validation RuleBackend rule code to validate before transition
Approval RuleApproval required before transition executes
Post-Action CodeFunction to run after the transition
Requires CommentWhether the user must enter a comment
Requires AttachmentWhether a file upload is required
Is ReversibleWhether this transition can be undone
Sort OrderDisplay order of action buttons

Assignment Rules

Assignment rules determine who receives tasks created by workflow transitions.

Assignment Rule Types

Rule TypeDescriptionExample
Role-BasedAssign to anyone with the specified role"Branch Manager" role at the branch
Branch-BasedAssign to staff at the originating branchAll staff at DXB-Marina
Round-RobinDistribute evenly among eligible staffCycle through available agents
Workload-BasedAssign to the person with fewest open tasksLeast busy team member
Specific UserAlways assign to a designated personThe branch manager
Creator-BasedAssign back to the person who triggered the actionThe agent who created the reservation

Example: Task Assignment Configuration

WorkflowTrigger StageTask TypeAssignment Rule
Reservationpending_confirmationReservation ReviewRole: Reservations Agent, Branch: origin
Contractcheckout_pendingPre-Checkout InspectionRole: Fleet Inspector, Branch: origin
Contractreturn_pendingPost-Return InspectionRole: Fleet Inspector, Branch: return
Contractdamage_reviewDamage AssessmentRole: Fleet Manager, Branch: origin
ComplaintassignedInvestigationRole: Customer Service, Branch: origin
Refundpending_approvalRefund ApprovalRole: Finance Manager

Approval Rules

Approval rules gate certain transitions behind an approval step.

Approval Rule Configuration

FieldDescription
Rule CodeUnique identifier
Rule NameDisplay name
Approver RoleRole required to approve
ThresholdAmount threshold that triggers approval
Auto-Approve BelowAmounts below this are auto-approved
Timeout ActionWhat happens if approval is not given within SLA

Example: Approval Rules

RuleApprover RoleThresholdAuto-Approve Below
discount_approvalBranch Manager> 10% discountAED 0
refund_approvalFinance Manager> AED 500AED 500
extension_approvalBranch Manager> 1 day free
deposit_releaseFinance SupervisorAny amount
damage_liabilityFleet Manager> AED 2,000AED 2,000
writeoff_approvalSenior Finance Manager> AED 1,000AED 1,000

SLA Rules

SLA rules define time-based expectations for tasks created by the workflow.

SLA Rule Configuration

FieldDescription
Rule CodeUnique identifier
Task TypeThe type of task this SLA applies to
Warning ThresholdPercentage of SLA time before warning (e.g., 50%)
Breach ThresholdPercentage of SLA time before breach (e.g., 100%)
Escalation ActionWhat happens on breach (notify, reassign, escalate)
Business Hours OnlyWhether SLA counts only during business hours

Default SLA Configuration

Task TypeSLA DurationWarningBreach Action
Reservation confirmation4 hours75% elapsedNotify Branch Manager
Pre-checkout inspection2 hours75% elapsedNotify Fleet Supervisor
Post-return inspection4 hours75% elapsedNotify Fleet Supervisor
Damage assessment24 hours50% elapsedEscalate to Fleet Manager
Complaint first response4 hours75% elapsedNotify CS Lead
Complaint resolution48 hours50% elapsedEscalate to Ops Manager
Refund approval24 hours75% elapsedNotify Finance Manager
Document verification8 hours75% elapsedNotify Compliance

Notification Rules

Notification rules define what notifications are sent at each workflow event.

Notification Rule Configuration

FieldDescription
EventThe workflow event that triggers the notification
Recipient RuleWho receives the notification (role, specific user, task assignee)
Channel(s)In-app, email, SMS
TemplateMessage template with variable placeholders

Notification Events

EventTypical RecipientsChannel
Task createdTask assigneeIn-app, email
Task assignedNew assigneeIn-app, email
Task overdueAssignee + managerIn-app, email
Task completedRequester / next person in workflowIn-app
Approval requestedDesignated approverIn-app, email
Approval decidedRequesterIn-app, email
Workflow stage changedEntity ownerIn-app
SLA warningTask assigneeIn-app
SLA breachedAssignee + managerIn-app, email, SMS

Version Management Best Practices

PracticeWhy
Never edit the active version directlyCould break in-progress workflow instances
Clone before modifyingCreates a safe copy to edit
Test in draft before activatingVerify transitions work as expected
Document version changesKeep a changelog of what changed and why
Gradual rolloutActivate new version during low-traffic period
Keep old version retired (not deleted)Existing instances may still reference it

Required Permissions

ActionPermission
View workflow definitionsworkflow:read
Configure workflowsworkflow:configure
Activate/deactivate versionsworkflow:configure
Clone versionsworkflow:configure
Configure assignment rulesworkflow:configure
Configure approval rulesworkflow:configure
Configure SLA rulesworkflow:configure
Configure notification rulesworkflow:configure

On this page