There are several reasons to delete resources from a cluster:
- It frees up storage space, as Zeebe no longer needs to keep track of this definition in its state.
- It improves the overview in Operate, as deleted processes are no longer shown in the UI.
- It is more secure, as it prevents creation of process instances for a faulty process definition.
You can use resource deletion to remove resources from Camunda. There are two types of resources that can be deleted:
Deleting a process definition
You can delete a process definition by sending a delete resource command
process definition key as the
It's possible to delete any version of a process instance. Once you have deleted a process definition, it no longer
Zeebe's state. As a result, it is not possible to create new process instances for this process definition. Trying
to create one will result in a
NOT_FOUND exception. Deleting a process definition also deletes historical data.
Zeebe will never reuse a process version. When deleting a process definition, it keeps track of the version number. Deploying a new process with the same id will increment the version as usual.
Deleting the latest version
When deleting the
latest known version of a process definition, the previous version becomes the new
version. Imagine there are three versions of a process deployed, where
Version 3 is the latest version. Deleting this
- No more instances can be created for
- Creating a new process instance of the
latestversion of this process will create a new process instance of
Version 2, as this version became the new
Version 2contains any timer start event(s), they are reactivated. They are triggered according to the defined schedule.
Version 2contains any message and/or signal start event(s), they are reactivated. Publishing a message or broadcasting a signal causes correlation and creates a new process instance of
Version 2 before
Version 3 results in the same thing. The only difference is that
Version 1 becomes the
A call activity references a process by id. It's possible that all process definitions for this process id are deleted. In this case, Zeebe creates an incident on the call activity, informing you that the process cannot be not found.
As of now it is not possible to delete a process definition that has one or more running process instances. If you want to delete the process definition you must first terminate/complete any running instances.
Deleting a decision requirements graph
You can delete a decision requirements graph (DRG) by sending
a delete resource command and providing the
decision requirements key
Upon deleting a DRG, Zeebe also deletes decisions contained within. Trying to evaluate such a decision will result in
NOT_FOUND exception. Deleting a DRG also deletes historical data.
Business rule tasks
A business rule task references a decision by id. It's possible that all versions of this decision are deleted. When this happens, an incident is created on the business rule task with the message that no decision with the given decision id is found.