Best approach to use external tasks to Integrate any programming language microservice architecture with Camunda workflow

Radhika Kulkarni
2 min readMar 31, 2021

In this article we will see use of external task while connecting with multiple system and microservices which defined in different language

What is External task?

Camunda component provides list of task service task, user task similarly external task is

Known task type which typical execute from external activity/handler.

external task pattern is:

1. In workflow or process where task defined while process execution it will add the task in task table

2. External activity Fetcher/Completer will trigger engine to push the task before that it will assigning the task to himself.

3. After processing the task, the activity return the result if it is successful or unsuccessful.

How to create an external task:

1. Add normal task.

2. update it to a service task.

3. Set it to external.

4. Mention the Topic name.

Topic is the queue, in which tasks will be added and to which the external activity will subscribe.

Tasks worker

External task is good choice when business processing language defined in other

Programming language task can process with simple Rest API call with HTTP request.

One can implement an external activity in .net, JavaScript that trigger/call camunda every 80 seconds to fetch the list of tasks to be processed.

fetchAndLock and complete are methods for processing external tasks. The first method requests a list of tasks and commits their execution to itself, while the second method informs you when the task is complete.

Camunda external task client

To implement external tasks processing, camunda provided clients in Javascript and Java, which allow us to create external task handlers literally in a few lines.

To execute external tasks, need to implement processing logic in external activity that one can implement with Javascript and Java

camunda provided clients in Javascript and Java,

· External handler implementation using the ExternalTaskClient

· Run the entire process through RuntimeService::

Benefits of using an external task

· No need to call external service one can avoid call just by publishing task on topic

· High fault tolerance

· Can implement with any programming language

· Easily scalable

--

--