Microservices are becoming very popular these days. Build a process definition and turn it into a Microservice—it's that simple. It’s a very powerful concept but very easy to implement using FlowWright. The UI lets you manage Microservices, export and import microservice XML files from other FlowWright environments, and understand usage statistics and call logs.
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1695810000039-image.png)
The microservice usage statistics feature options.
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1695810134054-image.png)
Microservices can be defined, updated, removed, and copied using the above UI. So, how do you build a Microservice? Let’s build a Microservice that takes two numbers and returns the sum of the two numbers.
Build a workflow definition called “addTwoNumbers,” and define 2 variables as shown below:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1695810344600-image.png)
Drag an “evaluateExpression” step to the process designer and connect to the “Start” step:
![](https://s3.amazonaws.com/helpjuice-static/helpjuice_production%2Fuploads%2Fupload%2Fimage%2F8802%2Fdirect%2F1624817235920-1624817235920.png)
Configure the “evaluateExpression” step with the following values:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1695810296074-image.png)
Once configured, save the process definition and navigate to the Microservices UI to create a new Microservice:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717568173853-image.png)
Provide a name for the Microservice, select a process definition from the drop-down list, map the Inputs and Outputs to workflow variables, and select ON to save the process instance when the microservice is executed. NOTE: We recommend selecting only process definitions with no human-required steps, such as routeForm, Tasks, etc., as this workflow is more apt to be executed by a Microservice.
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717568206615-image.png)
Once the Microservice is created, select the “API - Build” menu item:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717572178045-image.png)
Once the REST API is built, select the “API - View API” to render the Microservice REST API:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717568997523-image.png)
Let’s select the Microservice and execute the Microservice, provide values for the 2 inputs:
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717569155183-image.png)
The user can now view the ‘Build log’ directly, Statistics (By User and By Microservice) under the API menu, and ‘View Call Logs’ under the API menu.
You may use the navigation icons to Render Definition and View API on the new page.
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717572807881-image.png)
Click on the API menu and observe the ‘Build log’ and ‘View API’ feature options.
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717572228252-image.png)
The build log has information about any errors; otherwise, it's empty.
![](https://static.helpjuice.com/helpjuice_production/uploads/upload/image/8802/direct/1717572310549-image.png)
All dates/times are stored within the database as UTC and displayed based on the user's local timezone.
Note: Engine runtime data are in ISO + UTC format.