Calling an API from task and returning its response to the user


I am new to Camunda and BPMN.

I want to create a BPMN having multiple tasks. Each task accepts input from the user calls an API and returns its response to the user. There can be multiple tasks in the BPMN and after completion of each task the BPMN must wait for next user input.

For example, there is a package is to be delivered from the mail hub to the user. So in this case the delivery boy would perform following tasks:

  1. Pick the package from the mail hub. Mark in the mobile app that he has picked up the package from hub.
  2. After picking up the package he would mark travel start.
  3. When he reaches the customer location he will mark travel end.
  4. After reaching the customer location he will deliver the package to the customer and complete all the formalities.
  5. Then at last he will complete the package delivery.

In each of the of the above tasks an external API needs to be called and the response of the api needs to be returned to the user.

How to perform this in BPMN?
What kind of task needs to be used in BPMN? User or service task?
If the service or user task is to be used then how to configure it?

I am using Camunda with SpringBoot

@Shruti Welcome to the :camunda: forum!!!

Regarding setup, two ways we can setup the camunda & spring boot:

  1. Adding required camunda & spring boot dependencies and configurations:

  2. Using pre-packaged distro of the Camunda BPM platform, including the Camunda webapps (Cockpit, Tasklist, Admin) and the REST API.

Regarding the usecase, choosing the type of bpmn tasks are depends on the activities involved in the process.

You can model the process something like below:

Video tutorials:

1 Like

how to handle it at code level?? I am trying to achieve the following:
1. Sending response
2. Completing the user task in code from the listener
Both of the above I am unable to do.