Skip to main content

Definitions and Deployment

This page covers what happens between save and run: how BPMN files are stored as definition versions, what deployment does, how process versioning works, and how to start a new instance once a process is live.

Concepts​

ConceptIdentifierWhat it is
DefinitiondefinitionsID (from the BPMN XML's outer <definitions id="…">)The stable identity of a BPMN file across edits. Saving a new revision adds another version under the same definitionsID, the ID itself doesn't change
Resource versionresourceID (UUID)One stored revision of a definition. Carries the actual XML body, a name, and a deployed/draft flag
ProcessprocessID (the id attribute on <bpmn:process>)A single executable flow inside a definition. One definition can contain multiple processes
Process versionprocessID + version (integer)One deployed iteration of a process. Auto-incremented per processID each time the containing definition is deployed

The relationship: a definition has many resource versions, each deployed resource produces one new process version for every process declared inside it.

Lifecycle​

A BPMN file moves through three stages:

   ┌──────────────┐    save     ┌──────────────┐   deploy    ┌──────────────┐
│ In modeler │ ──────────► │ Draft │ ──────────► │ Deployed │
│ (browser) │ │ resource │ │ resource + │
│ │ │ (editable) │ │ new process │
└──────────────┘ └──────────────┘ │ version(s) │
▲ └──────────────┘
│
edit / save again
  • Draft - saved to the project but not yet executable. You can edit drafts, test-run them, and delete them.
  • Deployed - the resource version is locked and the processes inside it are now runnable.

A deployed resource version is immutable. To change a deployed process you upload a new resource version under the same definitionsID and deploy that.

The Definitions view​

Open BPMN Definitions from the BPMN navigation. One row per definitionsID, showing the latest version's metadata:

ColumnDescription
Definition IDThe stable ID from the BPMN XML
NameDisplay name from the latest version
VersionsHow many stored revisions exist
StatusWhether the latest version is deployed
Created atWhen the latest version was uploaded
ActionsEdit (open the latest version in the modeler) and view history

A New Process button (visible to project Editors and Admins) opens a fresh modeler tab.

The Versions view​

Drill into a definition to see all of its resource versions, newest to oldest:

ColumnDescription
NameDisplay name as set when that version was saved
StatusDeployed or Draft
Created atUpload timestamp
Created byThe user who saved that version
ActionsView contents, open in modeler, delete

A resource version can be deleted, deployed or not, while none of the process versions deployed from it has running instances. Otherwise the delete answers 409. Deleting a deployed resource version leaves its process versions deployed, and their past instances remain in history.

What deployment does​

The Deploy action on a saved draft does three things:

  1. Marks the resource version as deployed. The XML is now immutable.
  2. Registers a new process version for every <process> inside the resource. Each process's version number is auto-incremented per processID, starting at 1 the first time. Every process gets a new version, even when only one of them changed. Different processes inside the same resource can be at different version numbers.
  3. Activates typed start events on the new version. Message, signal, and timer start events register so an inbound message, signal, or scheduled tick can start an instance of the new version.

Deployment is one-way per resource version. You can't "undeploy" - to retire a process, deploy a new version that does nothing or stop sending traffic to it.

A file identical to the latest deployed resource of its definition is refused with 409, both when you save it and when you deploy a draft of it. Every deploy therefore registers new versions of all the resource's processes. Deploying the latest deployed resource again changes nothing. An earlier file can be saved and deployed again, and becomes the next version.

What re-deployment does​

When you deploy a new version of a definition that's already been deployed before:

What happensNotes
The new resource version is registeredSame as a first deploy
Each process inside gets a new process versionversion column bumps for that processID
Typed start-event registrations from the previous version are deactivatedInbound messages, signals, and timer fires now create instances of the new version, not the old one
Running instances of the previous version keep runningThey continue under the version they were started with - re-deploying does not automatically migrate them
The previous version remains "deployed"It can still be the source/target of an explicit instance migration. Call activities pointing at the old version still resolve

If you need to move running instances over to the new version, use instance migration - the API supports migration plans that map nodes between versions.

The Processes view​

The Processes view aggregates by processID across all of its deployed versions. One row per process:

ColumnDescription
Process IDThe BPMN id attribute on <bpmn:process>
NameProcess name from the most recent version
VersionsCount of deployed versions for this processID
RunningInstances with status RUNNING across all versions
Total InstancesInstances started in the selected time range (last 24 hours by default), across statuses

Use this view when thinking about a process as a long-lived unit, regardless of which version is deployed today.

The Process Versions view​

Drill into a process to see each deployed version and its instance counts:

ColumnDescription
VersionVersion number, starting at v1
NameProcess name from that version
ResourceThe resource version this process came from
RunningInstances of this version with status RUNNING
Total InstancesInstances of this version started in the selected time range (last 24 hours by default), across statuses
Created atWhen the version was deployed

This is the place to pick the source/target version when migrating running instances, or to see how traffic is distributed if you've shipped multiple versions over time.

A deployed version can be paused from here. Pausing a version stops every running instance of it and rejects new starts until it is resumed. Paused versions carry a badge in this view and both list endpoints accept a ?suspended= filter. See Pausing and resuming.

Starting an instance​

There are two paths.

Production instance (deployed only)​

POST /projects/{projectID}/bpmn/instances
FieldRequiredNotes
processIDyesThe id of the <bpmn:process> to start
versionnoThe deployed process version to start. Omit it for the latest
variablesnoInitial variables. Available to FEEL expressions and service tasks from the first activity onward
businessIdnoYour own reference, such as an order number, carried by the instance and everything it creates

Returns 201 Created with the new instance's instanceID, which you'll use to fetch state, send signals/messages, complete user tasks, and so on. A process with no deployed version, or without the requested one, answers 404.

curl -X POST "$API/projects/$PROJECT/bpmn/instances" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"processID": "order-fulfilment",
"variables": { "orderId": "ORD-123", "amount": 49.95 }
}'

Without version the start runs the latest deployed version, so a new deploy takes over new starts at once. Pass version to pin a start to one version.

Test instance (drafts and deployed)​

The modeler's Run button uses a different endpoint that works against a resource version directly - drafts included:

POST /projects/{projectID}/bpmn/resources/{resourceID}/test
FieldRequiredNotes
processIDnoBPMN process ID inside the resource. Defaults to the first executable process
variablesnoInitial variables
businessIdnoYour own reference, as on a production start

Use test instances to try out an in-progress design before deploying. They run on the same engine as production but stay apart from it, and so do their call-activity children. An instance started this way stays a test run for life, also after a migration to a deployed version.

What production sharesFor a test run
Job task typesCarry the draft: prefix. A worker activates draft:issue-payout to work a test run's issue-payout jobs, and a worker of issue-payout never receives them
Message and signal namesCarry the draft: prefix. Publish draft:PaymentReceived to reach a test run waiting on PaymentReceived. The run panel adds the prefix itself
User tasks, jobs and incidentsListed only when the list names the instance (instanceID), so tasklists and job dashboards leave them out
Instance counts, analytics and job queue depthLeave test runs out
Instance listShows test runs, marked and with draft set. Filter with draft=true or draft=false

A suspended process version does not stop a test run of its resource, since the test run takes no deployed version.

From the UI​

The first-class start-from-UI path today is the modeler's Run button - see Testing from the modeler. For production starts, use the API directly or have an upstream system (typed start event, signal, timer) trigger them.

API reference​

EndpointUse
GET /projects/{projectID}/bpmn/resources/latestList the latest version of each definition (drives the Definitions view)
GET /projects/{projectID}/bpmn/resources/by-definitions-id/{definitionsID}List every version of a definition, newest to oldest
POST /projects/{projectID}/bpmn/resourcesCreate a new draft resource (first save)
PUT /projects/{projectID}/bpmn/resources/{resourceID}Update a draft's XML (drafts only - deployed versions are immutable)
DELETE /projects/{projectID}/bpmn/resources/{resourceID}Delete a resource version. Answers 409 while a process version deployed from it has running instances
POST /projects/{projectID}/bpmn/resources/{resourceID}/deployDeploy a draft, locking it and creating new process versions
POST /projects/{projectID}/bpmn/validateValidate BPMN XML without saving - same checks the modeler runs at save time
POST /projects/{projectID}/bpmn/resources/{resourceID}/testStart a test instance against any resource version
POST /projects/{projectID}/bpmn/instancesStart a production instance against a deployed process version
GET /projects/{projectID}/bpmn/processesList one entry per process with aggregate instance counts. Supports ?suspended=
GET /projects/{projectID}/bpmn/processes/{processID}/versionsList deployed versions of one process with per-version instance counts. Supports ?suspended=
GET /projects/{projectID}/bpmn/processes/{processID}/versions/{version}Read one deployed process version
POST /projects/{projectID}/bpmn/processes/{processID}/versions/{version}/suspendPause a deployed process version - stops its running instances and rejects new starts
POST /projects/{projectID}/bpmn/processes/{processID}/versions/{version}/resumeResume a paused process version