Best practices for invoking process deployed in other archives


#1

Hello,

we are running process A that needs to invoke process B and since the two are not strictly related, we would like to deploy them through two independently EmbeddedProcessApplications running two independent process engines using a Shared Database pattern.

We figured out some possible strategies:

  • Use a Call Activity Task

  • Develop a REST API for the EmbeddedProcessApplication deploying process B and invoke it from a Send Task / Service Task in process A

  • Use the ProcessEngine REST API to create an instance of process B from a Send Task or Service Task in process A

We already considered the following:

  • if we need to expose process B as a REST API for other purposes, then use the API, so we are not constrained to deploy the two processes on the same process engine
  • if we use the CallActivity, then for unit testing purposes we would need to deploy a “mock” process because the subprocess definition is resolved at runtime

Are there other important considerations we need to take into account ? It would be great if Bernd could write a blog post on the topic :slight_smile:


#2

Hi Edmondo.

Hmm - Blog as a Service :slight_smile: But sorry - I have some other tasks on the top of the list at the moment even if that would fit nicely in the Workflow Automation Cheat Sheet.

I think you should ask yourself what kind of isolation you want to achieve. If the two processes are contained in different applications it probably means these are different microservices under different ownerships? In this case this call should be a bespoke API - independant of Camunda at all - as it is an implementation detail that Service B also uses BPMN.

If both workflows are owned by the same team you can weaken this to save effort. A Call Activity works nicely (make sure that Workflow B starts asynchronously) and is easy to do and gives you some advantages in Cockpit - but the coupling is relatively high.
I cannot decide for your use case if that is a good deal.

My personal default is to not couple two processes of different engines via Call Activities, but use an API in between.

Does this help a bit?
Cheers
Bernd