Tutorials / Glossary / Boundary Event

Boundary Event

An event attached to a task's edge that interrupts it — commonly used for errors, timeouts, and cancellations.

Charge Card On Fail

A boundary event is drawn as a small circle sitting on the border of a task or sub-process. It catches an event — an error, a timeout, a message — while that task is active, and diverts the token onto a separate path.

An interrupting boundary event (solid circle) cancels the task it's attached to when it fires; a non-interrupting one (dashed circle) lets the task keep running alongside the new path. Error boundary events are the standard way to model failure handling in BPMN.

Example

Bpmn.createProcess("payment-flow")
  .startEvent("start")
  .serviceTask("charge", { name: "Charge Card", taskType: "payment-charge" })
  .withBoundary("on-fail", { errorCode: "PAYMENT_FAILED" }, (p) =>
    p.serviceTask("notify", { taskType: "send-email" }).endEvent("end-failed"),
  )
  // main flow continues from "charge" — not from the boundary
  .serviceTask("fulfill", { taskType: "warehouse-pick" })
  .endEvent("end-ok")
  .withAutoLayout()
  .build();
Try it hands-on: Handling failures gracefully →