In this tutorial, you will learn to use the CLI client
zbctl to interact with Camunda Cloud.
An installation can be done quickly via the package manager
npm. The corresponding package is here.
You can also download a binary for your Operating System from the Zeebe GitHub releases page.
zbctl it is recommended to define environment variables for the connection settings:
When you create client credentials in Camunda Cloud you have the option to download a file with above lines filled out for you.
Alternatively, use the described flags (
--clientSecret). with the zbctl commands.
Use this command to verify that everything is set up correctly:
As a result you will get a similar response:
Use this workflow model for the tutorial.
This workflow includes a service task and an XOR gateway. Select the service task and fill in the properties. Set the Type to
The worker will return a JSON object as a result, which is used to decide which path to take. Now, we can use the JSON object to route your process by filling in the condition expression on the two sequence flows after the XOR gateway.
Use the following conditional expression for the "Pong" sequence flow:
And for the else sequence flow:
Now you can deploy the workflow. Navigate to the folder, where you saved your workflow.
If the deployment is successful you'll get the following output:
Important here is the
bpmnProcessId, which you'll need for creating a new instance.
The workflow uses the worker with the type
test-worker. Register a new one by using the following command:
You can start a new instance with a single command:
As a result, you'll get the following output, which contains, among others, the
Navigate to Operate to monitor the workflow instance.
Because the worker returns
the workflow ends in the upper end event following the Ping sequence flow.
Changing the worker to
and creating a new instance leads to a second instance in Operate, which you'll see ending in the second end event following the else sequence flow:
As a next step you can now connect both workers in parallel and create more workflow instances:
In Operate you will see instances ending in both end events depending on which worker picked up the job.