A debtor who cannot pay in full often agrees to pay in parts. For the collection team that is good news, but for the software it is a new process inside the case: a series of due dates, payments that arrive late or short, and a rule for the broken promise. This article shows how to build that payment plan workflow in BPMN 2.0 with timer events, so the plan runs as drawn and changes without a release.

It builds on modelling a debt collection process in BPMN 2.0, which covers the amicable stage and the court paths. Here we zoom in on one box of that model: the payment plan.

What a payment plan is in a collection system

A payment plan is an agreement on how an open claim is paid: the total amount, the instalments, their due dates, and what happens when one is missed. A promise to pay is the simplest case, with one amount and one date. A plan is a series of them.

In the data model, keep three things apart:

EntityWhat it holds
PlanThe agreement: case, total, start date, status, version, the rule for missed instalments
InstalmentOne due date and one amount, with its own status: open, paid, partly paid, missed
Payment allocationWhich incoming payment, or which part of it, settled which instalment

The allocation table matters more than it seems. A debtor who pays twice in one month, or pays one large amount that covers three instalments, must be handled without guessing. The rule for allocation (oldest instalment first, for example) is a business decision; write it down and keep it in configuration.

The terms of a plan, such as interest, fees, and what the creditor may do after a missed instalment, can have legal consequences for the debtor. Check the current rules in each country before you build them into a process.

Modelling instalments with timer events

BPMN 2.0, a specification of the Object Management Group, defines three kinds of timer: a date (timeDate), a duration (timeDuration), and a cycle (timeCycle). Engines such as Camunda read their values as ISO 8601 strings. The Camunda 7 documentation on timer events, used here as an example engine, gives 2011-03-11T12:13:14Z for a date, P10D for a duration of ten days, and R3/PT10H for three repetitions of ten hours. It also accepts expressions, such as ${duration}, that resolve to such a string.

A repeating cycle looks like the natural fit for monthly instalments. It is usually the wrong one. Instalment dates are calendar dates, not equal intervals; the amounts can differ; and the plan can change halfway. Model each instalment as its own wait instead:

  1. A sequential multi-instance sub-process runs once per instalment, in order, over the list of instalments of the plan.
  2. Inside it, a service task calculates two instants for the instalment: the due date (dueAt) and the reminder date (remindAt).
  3. An embedded sub-process, "Wait for instalment", holds the wait. Inside it, an event-based gateway waits for whichever comes first: a payment message for this instalment, or a timer intermediate catch event with timeDate set to dueAt.
  4. When the payment arrives, an exclusive gateway checks whether it covers the instalment. If it does, the instalment is paid and the loop moves on.
  5. When the due date timer fires first, the wait ends and the instalment goes to the grace path described below.
XML
<bpmn:intermediateCatchEvent id="InstalmentDue" name="Instalment due">
  <bpmn:timerEventDefinition>
    <bpmn:timeDate>${instalment.dueAt}</bpmn:timeDate>
  </bpmn:timerEventDefinition>
</bpmn:intermediateCatchEvent>

The values of dueAt and remindAt are calculated in that service task, not in the diagram. That is where the calendar belongs: the time zone of the debtor or the creditor, the end of the business day, and what to do when a date falls on a weekend or a public holiday. A timer only knows the instant it is given.

Reminders before a due date are a non-interrupting boundary timer on the "Wait for instalment" sub-process, with timeDate set to remindAt. Boundary events attach to activities, such as tasks and sub-processes, not to gateways or intermediate events; that is why the wait sits in a sub-process of its own. In Camunda 7 a boundary timer interrupts by default; setting cancelActivity="false" lets the sub-process keep waiting while a second path sends the reminder.

XML
<bpmn:boundaryEvent id="ReminderDue" name="Reminder due"
    attachedToRef="WaitForInstalment" cancelActivity="false">
  <bpmn:timerEventDefinition>
    <bpmn:timeDate>${instalment.remindAt}</bpmn:timeDate>
  </bpmn:timerEventDefinition>
</bpmn:boundaryEvent>

Broken promise workflow: grace periods and partial payments

A missed due date is not yet a broken promise. Plans usually allow a grace period, because a payment made on the due date can be booked and matched days later. Model the grace period as a second timer with a duration, such as P5D, that starts when the due date passes. The event-based gateway pattern repeats: payment or grace timer, whichever comes first.

Partial payments need a rule too. A payment that is short by a small amount, below a tolerance you configure, can count as paid, with the difference carried to the next instalment. A larger shortfall marks the instalment as partly paid.

When does the plan break? That is a policy, and it should be data on the plan, for example:

  • one instalment unpaid after the grace period, or
  • two instalments missed in total, or
  • the outstanding amount behind schedule by more than a threshold.

When the rule is met, the sub-process ends with an escalation end event or sends a message to the main collection process. The main process decides the next step, which can be a new contact attempt, a new plan, or the court path. The plan itself does not decide that.

Two other ways out of a plan should interrupt it at once. Attach interrupting message boundary events to the plan sub-process for a payment in full and for a cancellation, for example after notice of the debtor's insolvency. Without them, cases keep waiting for timers that no longer make sense.

Rescheduling without losing history

Debtors ask to move a date, lower an amount, or add instalments. The tempting fix is to edit the running timer. Engines allow it: Camunda 7 lets an operator change a timer's due date through its API or Cockpit, and notes that a change to one timer instance does not affect the following ones unless a cascade flag is set. That is useful for operations, but it rewrites the plan without a record of why.

A cleaner model treats a reschedule as a new plan version:

  1. A message, such as "plan changed", interrupts the running plan sub-process.
  2. The old plan version gets the status "replaced", with the date, the reason, and the user who agreed to it.
  3. Paid instalments stay as they are. The open balance moves to the new version.
  4. A new plan sub-process starts with the new schedule.

Nothing is overwritten. Months later, anyone can see the original plan, every change, and which payments belonged to which version. That history is what a dispute, a creditor report, or an audit asks for.

Reporting on plans

If every step above writes an event (plan agreed, instalment paid, instalment missed, grace expired, plan broken, plan replaced), reporting becomes a query instead of a project. Useful questions to answer from those events:

  • How many plans are kept, broken, or replaced, by portfolio and by agent?
  • After which instalment do plans usually break?
  • How late do payments arrive, and is the grace period long enough?
  • How much of the planned amount has been collected so far?

The answers feed back into configuration: the length of the grace period, the tolerance for short payments, the timing of reminders. Changing those values is a configuration change, not a new process model.

How we can help

We build debt collection software with payment plans and instalment tracking: plans and their versions, matching of incoming payments, reminders, and clear rules for what happens when an instalment is missed, all running as versioned BPMN processes.