Camunda Process depdency

Hi team,

I am using camunda process for Orchestration. For example, each child flows for Opportunity Line items 1,2,3, making callouts and doing business tasks. All 3 are completed in their own time frame, once the child process is completed I need to kick off the parent Process. How can it be achieved in an automated & Scalable way?

Note: I can have millions of Opportunity/Opportunity Line Item can be orchestration on our platform

Opportunity - Camunda Main Process

  • Opportunity Line Item 1 - Camunda Child Process1
  • Opportunity Line Item 2 - Camunda Child Process2
  • Opportunity Line Item 3 - Camunda Child Process3

Hi,

I’m uncertain whether I understand your requirements 100%. So, feel free to correct me.
If you have a parent process that spawns a child process one or multiple times and needs to synchronize afterwards, you can use Multi-Instance Call activities. When the parent process reaches the call activity, it can instantiate another process for each opportunity line in a collection. The parent will continue, once all child processes are complete. You can then start another process from the parent process (via a second call activity or via a message event).
You can read more about call activities and call activities in our documentation:

Thanks @StephanHaarmann

I have an independent parent Process and Independent N no of child Processes & No way related to each other.

Each gets completed on its own time, but N no of child Processes are completed I have to trigger the Parent Any Out of the box mechanism available to achieve this mechanism.

As far as I know, there is no out-of-the box solution. How could there? If the processes are fully independent, i.e., there is no relation between the processes, they cannot know about each other without explicit communication.
However, using explicit communication, you can model a process that is started and waits for a certain number N of processes to be completed. When any one of the N process completes, it sends a message to the first process, which counts them up until the threshold N is reached.

Thanks, @StephanHaarmann - I understand there is no out-of-the-box solution, N is driven dynamically it might have 1 or it might have 100 during the Deals journey.

is there any alternative way to handle this dependency in addition to the one suggested above?

There are many ways. We may have explicit coupling or a hidden coupling. Explicit coupling can be strong or weak:
Strong explicit coupling uses subprocesses and call activities to link different processes instances. The number can be determined dynamically.
Weak explicit coupling uses messages and signals.

Hidden coupling can be realized by

  • having one process setting variables in another process.
  • one process querying the state of another process
  • one process triggering another process from within a service task or listener

I strongly recommend using explicit coupling if possible, even if this requires you to refactor your models.
If this is not possible, you can for example implement an execution listener that checks at the end of a child process whether more child processes exist. If not, it triggers the next process:

1 Like