
👥 HR & Workforce · State Machine
The states of an employee leave request in an HRMS: submission, manager approval, HR escalation for long leave, and cancellation.
Drawing diagram…
State machine for a leave request: Draft, Submitted (after a balance check), Pending Manager. The manager approves or rejects; leaves longer than 5 days go to Pending HR. Approved leave is deducted from the balance and can be Cancelled before the start date (balance restored). Once the leave dates pass it is Taken. Requests not actioned in 3 days are escalated.
stateDiagram-v2 [*] --> Draft Draft --> Submitted: Balance available Submitted --> PendingManager PendingManager --> Rejected: Manager rejects PendingManager --> PendingHR: More than 5 days PendingManager --> Approved: Up to 5 days PendingManager --> Escalated: No action in 3 days Escalated --> PendingHR PendingHR --> Approved PendingHR --> Rejected Approved --> Cancelled: Before start date Approved --> Taken: Leave dates pass Taken --> [*] Rejected --> [*] Cancelled --> [*]
A hiring process from job requisition to the new joiner's first day: sourcing, screening, interviews, offer and background checks.
A human resource management system: employee records, attendance, leave, payroll, performance and the employee self-service app.
What happens between an accepted offer and a new joiner's productive first week: documents, background check, accounts, laptop and induction.
A schema for monthly payroll: employees, salary structures and components, pay runs, payslips and statutory deductions.
How candidates move through a hiring funnel for a quarter, by source, and where they drop out.
Every stage of an employee's time with a company: offer, onboarding, probation, active, leave, notice and exit.