BPMN — Business Process Model and Notation — стандарт графического моделирования процессов. Он показывает кто выполняет работу, в каком порядке идут действия, где процесс ждёт события, где ветвится, где идёт параллельно, где возникает ошибка, какое сообщение пересекает границу участника и как процесс завершается.
№81 IDEF0 — functional structure and ICOM; BPMN — executable/process dynamics. №68 Durable Workflow — runtime engine semantics such as replay/timers/checkpoints; BPMN can specify the business flow it executes. №57 Queues, №58 Scheduler, №59 Broker — execution infrastructure, not process logic. №42 Events & Triggers define event semantics; BPMN shows how process reacts to them.
Полезные соседи: №10 State Management, №11 Workflows, №42 Events & Triggers, №49 HITL, №50 Contracts, №57–59 execution fabric, №63 Resilience, №68 Durable Workflow, №69 Reliability, №77 Production Architecture, №81 IDEF0.
CONTROL PLANE: process definitions, versions, timers, role/pool mapping, error policies. DATA PLANE: process instances, messages, variables, task results, correlation IDs. RUNTIME: workflow engine or orchestrator executes equivalent semantics. OFFLINE: process design, review, optimization, conformance and incident analysis.
Success: process has explicit start/end, every wait has wake-up event, every consequential task has failure path, participants are clear, branches are semantically correct, and long-running instances can resume. Failure: generic diamonds, implicit waits, sequence flow across pools, swallowed errors, no cancellation semantics, or diagrams that cannot map to real system state.
BPMN does not define internal reasoning, model routing, queue delivery guarantees, API schemas, database state or retry implementation details. It owns PROCESS SEMANTICS: ORDER, PARTICIPANTS, EVENTS, WAITING, BRANCHING, HANDOFF AND TERMINATION.
Start, intermediate, end; message, timer, error, signal, escalation etc.
Task or subprocess performed by human/system/service.
Exclusive, parallel, inclusive, event-based and other routing semantics.
Defines order of execution within a pool/process.
Represents communication across pool boundaries.
Organization, external system, customer, provider or process participant.
Team, role, subsystem or responsibility grouping.
Cross-participant communication uses Message Flow.
POOL: CUSTOMER [Submit request] ──message──▶ POOL: AI PRODUCT Lane: API Lane: Orchestrator Lane: Human Reviewer POOL: EXTERNAL PROVIDER [Model/API]
Approval, review, manual correction, data entry.
API call, model invocation, deterministic backend operation.
Small local transformation in engine/runtime when supported.
Manual offline action or rules engine decision where appropriate.
Shows meaningful process unit without visual overload.
Use when child steps/events matter to current audience.
Invoke a separately defined reusable process rather than copying it.
┌── yes ──▶ [Human approval]
[Check risk] ──▶ ◇
└── no ──▶ [Auto continue]
Exactly one outgoing path
should be selected
for a given token.
Use when:
mutually exclusive conditions.
Do not use parallel gateway
to represent alternatives.
┌──▶ [Retrieve internal knowledge] ──┐
[Prepare task] ─▶ ✚ ✚ ─▶ [Synthesize]
└──▶ [Fetch external evidence] ─────┘
Split:
activates all branches.
Join:
waits for all active branches
arriving at that synchronization point.
Use when:
branches are independent
and all are required.
Need internal RAG and/or web research and/or code calculation.
More complex than XOR/AND because not all paths necessarily start.
If logic can be expressed more clearly with explicit subprocess/rules, prefer simpler model.
┌── message: approval received ──▶ [Continue]
[Wait] ────────▶ ◇
└── timer: 24h elapsed ──────────▶ [Escalate]
The gateway does NOT inspect data.
It waits for competing events.
This is ideal for:
human response vs timeout
external callback vs deadline
webhook vs cancellation
Use when trigger semantics do not matter in diagram.
Email/API/message arrives and starts process.
Daily report, recurring reconciliation, SLA check.
Use only when actual semantics match.
External callback, human response, provider notification.
Delay, timeout, scheduled continuation.
Error usually interrupts current scope; escalation can route higher-level handling.
One signal may be caught by multiple interested processes.
Current path ends with no special throw behavior.
Process ends while emitting a message.
Propagate failure to enclosing scope when modeled accordingly.
Ends all active paths in the current process scope; use deliberately.
boundary timer
◷
│
▼
┌─────────────────┐
sequence ───────▶ │ Wait for Human │ ───────▶ approved
└─────────────────┘
│
└────────▶ timeout escalation
Interrupting boundary event:
cancels attached activity.
Non-interrupting boundary event:
starts side path
while activity continues.
Use for:
timeout
error
escalation
message
compensation-related handling
| Flow | Meaning | Where |
|---|---|---|
| Sequence Flow | Order of activity/event execution. | Within same pool/process. |
| Message Flow | Communication between separate participants. | Across pool boundaries. |
| Association | Links artifacts/annotations/data to elements. | Documentation/data relation, not execution order. |
run_id, order_id, approval_id, job_id, callback token.
Process instance waits for matching external event.
Expired/cancelled process should not blindly resume from stale callback.
[Prepare action]
↓
[Create approval task]
↓
◇ event-based
├── message: APPROVED
│ ↓
│ [Execute action]
│
├── message: REJECTED
│ ↓
│ [Cancel / revise]
│
└── timer: SLA EXPIRED
↓
[Escalate / expire]
Important:
process state is durable;
worker need not stay alive;
approval carries exact frozen operation;
late approvals are checked against current state.
Short call with timeout and typed result. Error boundary handles failures.
Submit job, persist external job ID, wait for callback/message, timeout if needed.
SHORT:
[Call API] → [Use result]
LONG:
[Submit job]
↓
[Wait callback]
├─ message success → [Consume artifact]
├─ message failed → [Handle failure]
└─ timer deadline → [Cancel / fallback]
Provider timeout, rate limit, temporary network failure.
Retry must stop after explicit bound or remaining deadline.
Timer event/subprocess can represent delayed retry.
Schema invalid, permission denied, policy block, unsupported request.
Process:
reserve hotel
reserve flight
charge card
If later step fails:
may need compensation:
cancel hotel
cancel flight
refund
Compensation means:
execute business reverse action
for already completed side effect.
It is NOT:
database transaction rollback
guaranteed exact reversal
automatic for every task.
Each action needs:
compensability semantics
operation identity
current-state checks.
Long-running group of actions that may need compensation.
Handle failed business process via compensation handlers.
External APIs rarely provide one atomic transaction across all systems.
Process 20 documents serially when ordering/resource limits matter.
Process multiple items at once, bounded by real runtime concurrency.
For example, stop research branches after enough verified evidence exists.
Investigation/research where several activities may occur in varying order until condition is met.
If order/conditions can be formalized, explicit flow is easier to operate and test.
Request, report, approval packet, evidence set.
Database, artifact store, knowledge store.
Does not imply sequence flow.
Large artifacts should be referenced, not embedded in workflow state.
START: message "new task"
↓
[Authenticate / create run]
↓
[Formulate task]
↓
◇ XOR: evidence required?
├─ no ───────────────────────┐
│ │
└─ yes │
↓ │
[Retrieve evidence] │
↓ │
◇ XOR: sufficient? │
├─ yes ───────────────┐ │
└─ no │ │
↓ │ │
[External research] │ │
↓ │ │
└────────────────┘ │
↓
[Generate answer]
↓
[Verify result]
↓
◇ XOR: verification
├─ PASS → [Commit output] → END
├─ REVISE → [Revise] ─────┐
│ │
└─ HIGH RISK │
↓ │
[Human approval] │
◷ timeout │
├ approved →────────────┘
├ rejected → END rejected
└ timeout → END escalated
START:
webhook OR scheduler
↓
[Discover changes]
↓
[Fetch source]
↓
[Parse / extract]
↓
◇ XOR: parse valid?
├─ no → [Quarantine / retry policy]
└─ yes
↓
[Persist source version]
↓
[Update index]
↓
[Write provenance]
↓
[Publish ingestion completed]
↓
END
SEPARATE TIMER PROCESS:
nightly reconciliation
↓
[Compare source vs local checkpoint]
↓
[Repair missed updates]
[Prepare exact operation]
↓
[Persist operation_id + immutable args]
↓
[Create approval request]
↓
◇ event-based
├─ APPROVED
│ ↓
│ [Re-check permission / current state]
│ ↓
│ [Execute once]
│ ↓
│ [Verify outcome]
│ ↓
│ END success
│
├─ REJECTED
│ ↓
│ END rejected
│
└─ TIMER EXPIRED
↓
[Expire approval]
↓
END expired
Late approval after expiry:
ignored/rejected by state check.
Human/message/timer waits survive worker restart.
Wake-up not tied to one process thread staying alive.
Replay cannot repeat external commit.
Workflow definition changes need migration/version compatibility strategy.
“Approval received”, “payment failed”, “deadline reached”.
Kafka/SQS/Rabbit/worker queue moves message/work.
Versioned event/message envelope maps runtime delivery to BPMN event semantics.
Defines major functions, inputs, controls, outputs and mechanisms.
Choose where temporal behavior, waits and handoffs matter.
Model event order, branching, participants, timers, exceptions and completion.
User task queues, external callbacks, timers.
Pool/lane boundaries reveal ownership transitions.
Telemetry on BPMN stages can reveal real system constraint.
Which task, gateway, wait or participant is associated with deviation?
Use IS/IS NOT, distinctions and changes to diagnose cause at that process point.
Main participants and message exchanges.
Major tasks, gateways, waits and outcomes.
Retries, approvals, evidence acquisition, exception handling.
Exact timer/event/error semantics and mappings to runtime contracts.
Identify participants, activities, decisions, messages, timers and exceptions.
Convert vague “then maybe” descriptions into candidate gateways/events.
What happens on timeout, rejection, failure, cancellation, duplicate callback?
If SLA or approval rule is missing, mark it as a requirement gap rather than fabricating it.
{
"process_id":"approve_action_v3",
"participants":["ai_system","human_reviewer"],
"start":{"type":"message","name":"approval_requested"},
"steps":[
{"id":"freeze","type":"service_task"},
{"id":"wait","type":"event_based_gateway"},
{"id":"approved","type":"message_catch"},
{"id":"rejected","type":"message_catch"},
{"id":"expired","type":"timer_catch","after":"24h"},
{"id":"execute","type":"service_task"}
],
"end_states":[
"success","rejected","expired","failed"
]
}Tooling can detect unreachable nodes, missing end states, invalid cross-pool sequence flows, tasks with no error handling and waits with no resume event.
Task/event cannot be reached from any start.
Path has no terminal or durable wait state.
Multiple branches can be true when model expects one.
External message lacks stable business key.
Task can retry but has no operation/idempotency semantics.
Long external/human task can hang forever.
Sequence Flow crosses participant boundary.
Join waits for branches that may never have been activated.
Start → terminal outcome.
Human/external/timer waiting by step.
Failures by task/subprocess and cause class.
Transient retries and success after retry.
Share of instances routed to human/escalated path.
Human/tool waits that hit timer deadline.
Business reversals triggered after partial completion.
Instances with no valid terminal/wait transition beyond expected SLA.
| Time | Action |
|---|---|
| 0–3 min | Define process start, end and scope. |
| 3–7 min | Identify participants/pools and responsibility lanes. |
| 7–13 min | Draw happy-path tasks and sequence flows. |
| 13–18 min | Add real gateways: XOR/AND/event-based. |
| 18–23 min | Add message/timer/error boundary events and explicit wait states. |
| 23–26 min | Review side effects, retries, cancellation and compensation. |
| 26–30 min | Check terminal outcomes, correlation keys, subprocess boundaries and runtime ownership. |
BPMN WORKSHEET ========================================================= PROCESS NAME → PURPOSE → START EVENT [ ] none [ ] message [ ] timer [ ] signal Other: → END STATES 1. 2. 3. PARTICIPANTS / POOLS 1. 2. 3. LANES / RESPONSIBILITIES 1. 2. 3. --------------------------------------------------------- HAPPY PATH 1. 2. 3. 4. 5. --------------------------------------------------------- DECISIONS / GATEWAYS Gateway: [ ] XOR [ ] AND [ ] OR [ ] Event-based Condition/event: → Branches: → Join behavior: → --------------------------------------------------------- WAITS Human wait: → Resume message: → Timeout: → External callback: → Correlation key: → Timeout: → --------------------------------------------------------- ERRORS Task: → Retryable errors: → Permanent errors: → Retry count/deadline: → Fallback: → --------------------------------------------------------- SIDE EFFECTS Consequential action: → operation_id: → Can retry safely? → Compensation available? → Cancellation semantics: → --------------------------------------------------------- SUBPROCESSES Reusable subprocess: → Long-running subprocess: → --------------------------------------------------------- STATIC CHECK [ ] every path starts from valid start [ ] every path reaches end or durable wait [ ] no sequence flow crosses pools [ ] all waits have wake-up events [ ] XOR conditions are exclusive/default exists [ ] parallel joins cannot deadlock [ ] consequential retries are idempotent [ ] timeout/error path exists where needed [ ] late message handling defined [ ] diagram maps to real runtime state
You are assisting with BPMN process modeling.
1. Define process scope, start and terminal outcomes.
2. Identify participants as pools and responsibilities as lanes.
3. Build the happy path using activities and sequence flows.
4. Distinguish:
- sequence flow inside participant;
- message flow between participants.
5. Use explicit gateway semantics:
XOR = one branch,
AND = all branches,
OR = one or more,
event-based = whichever event occurs first.
6. Model waits explicitly with message/timer events.
7. Model human approval as a durable wait state.
8. For long external jobs:
submit → wait callback → timeout/failure/success.
9. For every task with external side effects:
define idempotency/operation identity,
retry class,
cancellation semantics,
compensation if available.
10. Add boundary events for timeout/error where material.
11. Do not invent missing SLA, approval rule or business condition;
mark it as a requirement gap.
12. Check every path reaches:
terminal outcome
OR explicit durable wait.
13. If functional decomposition rather than timing is the main question,
recommend IDEF0 instead.
14. If model is intended to execute,
map every activity/event to a concrete runtime contract.
| Question | Answer |
|---|---|
| Стоит ли использовать? | Да. Для multi-step workflows with waits, events, human handoffs, branching, retries and external participants. |
| Separate Component? | N/A. BPMN is notation/specification; a workflow engine may execute equivalent semantics. |
| Минимум 80% ценности? | Start/end, pools/lanes, tasks, sequence/message flow, XOR/AND/event-based gateways, timers, error/timeout boundaries and explicit human/external waits. |
| Когда overkill? | Simple function decomposition with no meaningful sequence/waits; tiny synchronous call chain that code expresses more clearly. |
| Trigger? | “What happens after this?”, “Who waits?”, “What if approval never arrives?”, “What if two branches run in parallel?”, “How does cancellation work?”. |
| Как измерить uplift? | Fewer stuck workflows, clearer ownership, lower timeout/escalation ambiguity, fewer duplicate side effects and faster implementation/review. |
| Можно ли использовать AI? | Да. AI drafts/normalizes process models; deterministic validators and runtime tests must verify semantics and implementation mapping. |
Every process instance has a lifecycle.
Respect participant boundaries.
XOR, AND and event-based are not interchangeable diamonds.
Human/external delay must become explicit process state.
“Eventually” is not an operational contract.
Technical failure, negative decision and timeout need separate semantics.
Permanent errors and policy blocks should not loop.
External side effects are not automatically reversible.
Diagram, workflow engine, contracts and observability should agree.
START
↓
DEFINE PROCESS SCOPE
↓
WHO PARTICIPATES?
POOL A
POOL B
POOL C
within pool:
lanes = responsibility
between pools:
MESSAGE FLOW
within pool:
SEQUENCE FLOW
────────────────────────────────────────
PROCESS ELEMENTS:
EVENT
something happens
TASK
work happens
GATEWAY
flow decision / synchronization
SUBPROCESS
grouped process behavior
DATA OBJECT / STORE
process data context
────────────────────────────────────────
GATEWAYS:
XOR
exactly one path
AND
all paths
OR
one or more
EVENT-BASED
whichever event happens first
────────────────────────────────────────
WAITING:
human approval
external callback
timer
message
signal
WAIT IS STATE.
A WORKER
DOES NOT NEED TO STAY ALIVE.
────────────────────────────────────────
FAILURE:
service task
↓
boundary error
├─ transient → bounded retry
├─ fallback
└─ permanent → fail path
timer:
task waits too long
↓
timeout path
business rejection:
separate from technical error
────────────────────────────────────────
CONSEQUENTIAL ACTION:
prepare exact operation
↓
freeze arguments + operation_id
↓
approval if required
↓
execute once
↓
verify
↓
if later failure:
compensation only if defined
────────────────────────────────────────
AI WORKFLOW EXAMPLE:
message start
↓
formulate
↓
need evidence?
├─ no
└─ yes → retrieve
↓
sufficient?
├─ yes
└─ no → external research
↓
generate
↓
verify
↓
PASS?
├─ yes → commit → END
├─ revise → revise loop
└─ high-risk → human wait
├─ approved
├─ rejected
└─ timeout
────────────────────────────────────────
WITH OTHER METHODS:
IDEF0
what functions exist?
BPMN
how do they unfold over time?
TOC
where does flow constrain throughput?
KT
why did a process step deviate?
TRIZ
how can process conflict be redesigned?
DURABLE WORKFLOW
how does runtime persist/replay/wake?
QUEUES / BROKER
how does work/message move?
CONTRACTS
what exact payload crosses each boundary?
OBSERVABILITY
what actually happened in each instance?
────────────────────────────────────────
THE CENTRAL BPMN QUESTION:
“WHAT EXACTLY HAPPENS
WHEN THE HAPPY PATH
DOES NOT HAPPEN?”
WHO WAITS?
FOR WHAT?
FOR HOW LONG?
WHAT WAKES THE PROCESS?
WHAT IF THE MESSAGE IS LATE?
WHAT IF THE TASK FAILS?
WHAT IF THE USER REJECTS?
WHAT IF TWO BRANCHES RUN?
WHAT IF ONE SIDE EFFECT
ALREADY COMMITTED?
WHEN THOSE ANSWERS
ARE EXPLICIT,
THE PROCESS
STOPS BEING
A BOX-AND-ARROW STORY
AND BECOMES
AN OPERATIONAL MODEL.
A. Related ECC ideas. Context-as-cache, scoped memory, lifecycle hooks, selective capabilities, feature flags, deterministic enforcement, provider-neutral adapters and eval-gated learning are applied only where relevant to №82 BPMN.
B–E. Existing boundary and placement. The existing conceptual boundary, class METHODOLOGY, default N/A and owner Design-time / Problem Solving remain authoritative. Runtime/control/data/offline placement is unchanged; durable state stays outside model context.
F–H. Hooks and contracts. Use bounded PRE_MODEL/POST_MODEL, PRE_TOOL/POST_TOOL, CHECKPOINT and TASK_COMPLETED events as applicable. Illustrative fields and canonical contracts are defined in NEW_CONTRACTS_SPEC.md; no universal schema is implied.
I–J. Security and evaluation. Host-side schema, permission, secret, budget, idempotency and audit checks take precedence over LLM output. Optional mechanisms require a feature flag and WITH/WITHOUT ablation; measure quality, acceptance, correction, latency, cost, escalations and severe errors.
K–L. Task profiles and cross-references. A TaskProfile selects the relevant skill, tool/context slice, memory scope and enforcement profile independently from FAST/STANDARD/DEEP. See cross-reference map, hook spec and ablation plan. Provider adapters remain outside the core.