Skip to content

Part 10 — System Blueprint

Workflow Specs

Workflow is the executable layer over the state machines. Every queue item must reference one of the exact states below, one owner actor from actors permissions, one due timestamp, one escalation rule, and one event that can move the file forward. A screen status such as “with credit” is not enough for code generation; the system must know whether the file is in credit_in_review, deviation_pending, on_hold, or returned_for_rework.

The workflow engine owns workflow_task, queue_assignment and SLA timers. Business modules own evidence: KYC owns kyc_profile, document service owns document_instance, credit owns credit_assessment, LMS owns loan_account, and collections owns collection_case.

For the executable policy layer behind prescreen, data_fetch, deviation_approval, sanction conditions and monitoring triggers, use BRE functional specification and BRE runtime architecture.

FieldTypeRequiredRule
workflow_task_iduuidYesPrimary key.
subject_typeenumYeslead, application, kyc_profile, document_requirement, credit_assessment, deviation, sanction, sanction_condition, disbursement_request, loan_account, collection_case, service_request, partner.
subject_iduuidYesPrimary id of the subject.
application_iduuidConditionalRequired for all pre-booking application tasks.
loan_account_iduuidConditionalRequired for post-booking loan and collections tasks.
current_stateenumYesMust equal current application.application_state, loan_account.account_state, delinquency state, or collections case state.
task_typeenumYesprescreen, dedupe_review, kyc_cdd, bo_verification, document_collection, document_verification, data_fetch, cam_prepare, rcu_review, legal_review, valuation_review, deviation_approval, sanction_generation, borrower_acceptance, documentation_execution, cp_clearance, mandate_setup, disbursement_check, booking_rework, collections_call, field_visit, ptp_followup, legal_recovery, settlement_review, restructure_review, partner_reconciliation.
owner_roletextYesActor code such as sales_ops, kyc_checker, credit_analyst, ops_checker, collections_manager.
assigned_user_iduuidConditionalRequired after allocation unless the queue is deliberately unallocated.
assignment_basisenumYesround_robin, branch_owner, source_owner, skill_based, amount_authority, geography, vendor_panel, manual_supervisor, system_batch.
priorityenumYeslow, normal, high, critical, computed from amount, channel, DPD, hold age and VIP policy.
sla_start_attimestamptzYesSet on queue entry.
sla_due_attimestamptzYesComputed from the stage table below.
sla_pause_reason_codetextConditionalRequired when state is on_hold or when waiting on borrower, partner, court, registry, government API, or bank rail.
escalation_levelintYesStarts at 0; increments on each escalation.
last_escalated_attimestamptzConditionalRequired when escalation_level > 0.
terminal_event_expectedenumYesThe state-machine event that can complete the task.
task_statusenumYesopen, in_progress, waiting_external, returned, completed, cancelled, expired.
SituationClock behaviorAudit requirement
Normal queue entryStart at state entry timestamp.Store current_state, owner queue and computed sla_due_at.
returned_for_reworkStop current task; create rework task for prior owner with a new SLA.Store rework reason, target state and returning actor.
on_hold for external dependencyPause operational SLA but continue ageing counter.Store hold reason, external provider, ticket id and next retry time.
Borrower delayPause only if required evidence is genuinely outside lender control.Store communication attempt and borrower response due date.
Regulatory or compliance holdPause business SLA but show breach-risk clock to compliance.Store screening_hit_id, compliance_hold reason or legal/court reference.
SLA breachDo not auto-approve.Create escalation task; preserve original owner and missed deadline.
Application stateEntry eventQueueAssignment ruleBase SLATerminal eventsEscalation
lead_createdpartner_application_received, dsa_lead_submitted, manual lead captureSales/CRM owned by sales_rm or dsa_userSource owner; branch by pincode and product4 business hours for first contact; 1 business day for login decisionlead_submitted_for_prescreen, lead_withdrawn, lead_ttl_elapsedAt 75% SLA notify sales_manager; at breach reassign to branch sales_manager; at 3 business days no contact auto-route to expired by lead_ttl_elapsed.
prescreen_pendinglead_submitted_for_prescreenSales ops/BRE owned by sales_ops and system_serviceSystem batch for BRE; manual dedupe to sales_ops15 minutes for automated rules; 4 business hours for fuzzy dedupepre_screen_passed, hard_reject_triggered, data_or_identifier_deficientAt 30 minutes integration failure opens on_hold; at 4 hours manual dedupe escalates to sales_manager; no credit approval can bypass a hard reject.
prescreen_passedpre_screen_passedApplication setup queue owned by sales_opsBranch, source and product program4 business hourskyc_required_parties_created, docs_collection_started, borrower_withdrawnAt breach notify sales_manager; at 1 business day return to sales_rm for missing party or product data.
kyc_pendingkyc_required_parties_createdKYC maker/checker queue owned by kyc_maker, kyc_checker, aml_complianceConstitution type and risk category; high-risk to aml_compliance1 business day for individual CDD; 2 business days for legal entity plus beneficial owners; 4 business hours for sanctions hit triagekyc_verified, sanctions_or_aml_hold, kyc_rejectedAt 75% SLA notify KYC team lead; unresolved high-risk hit after 1 business day escalates to aml_compliance; true positive can only exit through kyc_rejected or hold resolution.
docs_pendingkyc_verified or docs_collection_startedDocument collection and verification queue owned by sales_rm, sales_ops, ops_makerRequirement owner from document_requirement.required_for_role1 business day for unsecured BL; 2 business days for secured SME; 4 business hours for document deficiency markingdocument_pack_locked, deficiency_raised, borrower_withdrawnDeficiency older than 1 business day escalates to sales_manager; waiver request creates deviation and routes to ops_checker plus function owner.
data_pendingdocument_pack_lockedIntegrations and credit ops queue owned by credit_analyst and system_serviceData type: bureau, AA, GST, ITR, bank statement, Udyam, collateral registry30 minutes for bureau; 2 hours for AA/GST/vendor fetch after consent; 1 business day for uploaded financial parsingdata_pack_finalized, provider_retry_exhaustedRetry schedule follows integration catalog; after retry exhaustion route provider_retry_exhausted to on_hold; credit manager can approve waiver only through deviation_pending.
credit_in_reviewdata_pack_finalizedCredit workbench owned by credit_analyst, credit_manager, rcu_officer, legal_user, valuer_vendorAmount, product, collateral and risk grade; vendor allocation by panel/geography1 business day for unsecured up to ₹10 lakh; 2 business days for unsecured above ₹10 lakh; 3 business days for LAP/secured with legal/valuationdeviation_raised, credit_approved_without_deviation, sanction_direct_generated, credit_rejected, fraud_confirmedAt 75% SLA notify credit_manager; at breach notify next DoA level; RCU negative older than 1 business day escalates to RCU manager and cannot be closed by sales.
deviation_pendingdeviation_raisedApproval service owned by credit_manager, national_credit_head, credit_committee_member, aml_compliance, legal_userauthority_rule resolves required level from amount, risk, severity and product4 business hours for low/medium; 1 business day for high; 2 business days for committeeall_deviations_approved, deviation_rejected, deviation_rejected_finalAt breach escalate to next authority_level; if severity=critical, notify national_credit_head; no auto-approval on timeout.
approvedcredit_approved_without_deviation or all_deviations_approvedSanction generation queue owned by credit_analyst and ops_checkerProduct template and KFS coverage4 business hourssanction_letter_generated, credit_rejected, sanction_expiredIf KFS computation fails, route to on_hold with APR error; if sanction not issued in 1 business day, notify credit_manager and ops_checker.
sanctionedsanction_letter_generated or sanction_direct_generatedBorrower acceptance queue owned by sales_rm, borrower_user, guarantor_userBorrower and authorised signatory action; assisted acceptance monitored by sales_opsValidity from sanction.valid_until; operational follow-up every 1 business dayborrower_acceptance_recorded, sanction_expired, borrower_negotiation_rework, borrower_withdrawn2 business days before expiry notify sales_manager; expiry triggers sanction_expired; material borrower change routes to returned_for_rework.
sanction_acceptedborrower_acceptance_recordedDocumentation setup queue owned by ops_makerProduct, collateral and constitution checklist4 business hoursdocumentation_started, sanction_expiredAt breach notify ops_checker; expired KFS/sanction cannot proceed to documentation.
documentation_pendingdocumentation_startedDocumentation, legal and CP queue owned by ops_maker, ops_checker, legal_user, guarantor_user, borrower_userChecklist item owner; legal tasks by branch/geography1 business day unsecured; 3 business days secured; 4 hours for eSign/eStamp callback processing; 1 business day for CP verificationdocuments_executed_and_cps_cleared, document_exception_holdStamping/signing failure after two attempts routes to on_hold; legal/security exception escalates to legal_user; CP waiver requires deviation and ops_checker approval.
disbursement_pendingdocuments_executed_and_cps_clearedDisbursement maker-checker queue owned by ops_maker, ops_checker, treasury_financeMaker prepares; checker verifies; finance releases4 business hours for single-tranche unsecured; 1 business day for secured or supplier payoutloan_booked, booking_failed, freeze_account where post-booking hold is neededAt 75% SLA notify ops_checker; failed payment retries as payment rail rule; final failure triggers booking_failed and returned_for_rework.
returned_for_reworkAny rework eventPrior owner queue from rework_target_stateOriginal owner unless conflict or SLA breach caused reassignment4 business hours for data/document fixes; 1 business day for credit structure changesTarget-state event specified in rework taskIf same reason repeats twice, escalate to functional manager; third repeat requires approval_request for exception or final rejection.
on_holdsanctions_or_aml_hold, provider_retry_exhausted, document_exception_hold, legal/court/fraud holdHolding owner queue: aml_compliance, credit_manager, legal_user, ops_checker, system_serviceHold reason codeReview every 1 business day; external retry follows integration catalogPrior active state, rejected, withdrawnHolds older than 3 business days go to function head; compliance/fraud hold has no auto-release.
Account stateTriggerQueueAssignment ruleBase SLAExit eventEscalation
pending_bookingloan_booking_requestedLMS booking queue owned by system_service and ops_checkerProduct and facility type15 minutes system booking; 2 business hours manual exceptionloan_booked_without_disbursement, loan_booked_with_first_disbursement, booking_failedAt 30 minutes open booking incident; at 2 hours notify ops_checker and treasury_finance.
active_undisbursedloan_booked_without_disbursementDrawdown queue owned by ops_makerTranche schedule and CP status1 business day for first drawdown requestfirst_disbursement_posted, first_disbursement_posted_full, account_cancelled_before_disbursementUndisbursed older than product TTL escalates to credit_manager for cancellation or revalidation.
partially_disbursedfirst_disbursement_posted or tranche_postedTranche monitoring queue owned by ops_maker and credit_analysttranche_number, CP and end-use evidence1 business day after tranche request; monthly review for idle limitsfinal_tranche_posted, cancel_undisbursed_balance, recallTranche CP overdue escalates to ops_checker; idle sanctioned amount beyond validity escalates to credit_manager.
active_currentloan_booked, cure_completed, performance_curedServicing queue owned by servicing_agent, LMS batch and treasury_financeService request category and branchStatement/certificate 1 business day; bank change 2 business days; foreclosure quote 3 business days; rate reset same day batchdemand_overdue, freeze_account, foreclosure_posted, maturity_paidSR breach notifies servicing manager; bank-account change breach notifies ops_checker; rate reset failure blocks demand generation and notifies finance.
active_overduedemand_overdue or default_after_restructureCollections intake queue owned by collections_managerDPD, exposure, risk grade, product and geographySame day case creation after day-end DPD; allocation by 10:00 next business daycure_completed, npa_classified, restructure_approved, recall, writeoff_postedAllocation breach escalates to collections head; NPA risk at dpd_61_90 alerts credit_manager and treasury_finance.
frozenfreeze_accountHold control queue owned by function that froze accountHold reasonDaily review for fraud/compliance/security; same day review for payment errorunfreeze_account, unfreeze_account_overdue, recall, close_accountHolds older than 7 calendar days require function head note; AML/fraud hold requires aml_compliance or RCU checker release.
restructuredrestructure_implementedMonitoring queue owned by policy_risk and servicing_agentRestructure package and schedule versionMonthly performance review; missed revised due same day alertperformance_cured, default_after_restructure, close_accountMissed due opens collections case immediately; performance cure requires risk review before state change.
preclosedforeclosure_posted or settlement_implementedClosure queue owned by ops_checker, legal_user, treasury_financeProduct and collateral status3 business days for unsecured NOC; 7 business days for secured release initiationno_dues_generated, closure_reversedSecurity release delay escalates to legal_user; GL mismatch escalates to finance head.
matured_pending_closurematurity_paidClosure queue owned by ops_checkerLoan account and charge status3 business daysno_dues_generatedSame as preclosed.
written_offwriteoff_postedRecovery-after-writeoff queue owned by collections_manager and treasury_financeRecovery policy and legal statusMonthly review until closed or transferredrecovery_after_writeoff_postedRecoveries must post to LMS/GL within same business day; reconciliation breach escalates to finance.
Collections stateEntry eventQueueAssignment ruleBase SLATerminal/progress eventsEscalation
open_unallocateddelinquency_snapshot_receivedCollections supervisor queue owned by collections_managerStrategy engine using DPD, exposure, risk, geography and channelSame day for 1+ DPD; within 2 hours for 60+ DPDauto_allocate_tele, auto_allocate_fieldAllocation breach escalates to bucket manager; high exposure skips tele-only queue.
allocated_teleauto_allocate_tele, reallocate_tele, partial_payment_receivedTele collections queue owned by collections_agentCampaign, language, contact window and broken PTP countFirst call within 1 business day for dpd_1_30; same day for dpd_31_60ptp_recorded, dpd_crossed_30_or_high_risk, arrears_clearedNo contact after three attempts over two days escalates to field review; abusive/contact-policy breach locks agent and alerts compliance.
allocated_fieldauto_allocate_field, escalate_fieldField/agency queue owned by collections_agent and collections_managerGeography, exposure and agency contractVisit within 2 business days for dpd_1_30; 1 business day for dpd_31_60 or skip riskptp_recorded, negative_visit_or_skip, arrears_clearedMissed visit escalates to agency manager; negative visit opens RCU/legal review.
ptp_activeptp_recordedPTP follow-up queue owned by assigned collections_agentPTP date, amount and payment modeReminder T-1 day; confirmation on PTP due date; LMS match same daypayment_received_matching_ptp, partial_payment_received, ptp_due_missed, arrears_clearedBroken PTP creates ptp_broken; repeated broken PTP routes to field or hard bucket.
ptp_brokenptp_due_missedCollections supervisor queueBroken PTP count and DPDSame business day reviewreallocate_tele, escalate_fieldTwo broken PTPs or exposure above policy escalates to collections_manager.
escalated_hard_bucketdpd_crossed_30_or_high_risk, negative_visit_or_skipHard bucket queue owned by collections_managerDPD, exposure, secured/unsecured, fraud and borrower responseSame day for 60+ DPD; 1 business day for 31-60 DPDlegal_route_requested, settlement_offer_received, restructure_request_received, arrears_cleareddpd_61_90 triggers legal readiness; npa_90_plus triggers finance, provisioning and partner alerts.
legal_reviewlegal_route_requestedRecovery legal queue owned by legal_recovery and legal_userProduct, collateral, cheque/NACH bounce, SARFAESI eligibility and arbitration clause2 business days for route decision; statutory notice timelines by lawenforcement_approved, legal_hold_or_defectLegal defect returns to hard bucket; no route decision by SLA escalates to legal head.
settlement_reviewsettlement_offer_received, ots_approvedSettlement approval queue owned by collections_manager, credit approver, treasury_finance, legal_userWaiver amount and DoA2 business days for proposal; fund realisation tracked to OTS letter datesots_approved, ots_funds_realized, ots_rejectedExpired token payment cancels proposal; waiver above threshold escalates per DoA.
restructure_reviewrestructure_request_receivedCredit/risk queue owned by credit_analyst, policy_risk, credit_managerViability, stress reason and asset classification5 business days for complete filerestructure_implementedMissing viability evidence returns to collections; approval requires new schedule_version.
repossession_or_enforcementenforcement_approvedLegal/recovery queue owned by legal_recoveryCollateral and legal routeTask-level due dates from notice, possession, auction, arbitration, DRT or Lok Adalat calendarrecovery_completed, writeoff_posted, approved_uncollectable_closureStatutory deadline breach alerts legal head and compliance.
GuardRequired implementation
Maker-checkerops_maker cannot complete a task checked by the same user as ops_checker; kyc_maker cannot approve own KYC; settlement negotiator cannot approve own waiver.
Conflict of interestsales_rm and dsa_user cannot approve credit, KYC, disbursement, DPD correction, settlement or write-off.
Vendor scopevaluer_vendor, legal_vendor and field agency users can see only assigned collateral_asset, legal_opinion, valuation_report or collection_case records.
Partner scopepartner_api_client can see applications where api_client.partner_id == application.source_partner_id; no direct access to CAM, bureau variables, RCU findings or internal deviations.
Regulatory holdNo state can move to disbursement_pending or loan_booked while true-positive screening_hit or active compliance hold is open.
DPD sourceCollections users cannot edit loan_account.current_dpd, asset_classification or delinquency state; LMS publishes dpd_changed and asset_classification_event.
TestExpected result
kyc_pending with one unverified beneficial_ownerkyc_verified event rejected; task remains with kyc_checker or aml_compliance.
docs_pending with mandatory document_requirement.status=pendingdocument_pack_locked rejected unless approved waiver exists.
data_pending with AA timeout but bureau optionalRequired-data matrix decides whether retry, waiver, or provider_retry_exhausted is legal.
deviation_pending low-severity SLA breachEscalation created; no auto-approval.
disbursement_pending with mandate.mandate_status=rejectedloan_booked rejected unless product permits disbursement before mandate and deviation approved.
active_overdue at dpd_61_90Collections case must be at least escalated_hard_bucket or legal_review; partner status event must be queued for co-lending accounts.
Collections arrears_clearedCase closes only after LMS confirms cure; collector promise or bank screenshot is not enough.