Microservices

Learn how to create and use microservices with FlowWright.

Last published at: July 27th, 2024

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.  

 

The microservice usage statistics feature options.

 

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:

 

Drag an “evaluateExpression” step to the process designer and connect to the “Start” step:

 

Configure the “evaluateExpression” step with the following values: 

 

Once configured, save the process definition and navigate to the Microservices UI to create a new Microservice: 

 

Provide a name for the Microservice, select a workflow definition, map inputs and outputs to workflow variables, and select ON to save the process instance when the microservice is executed.
 

 

Once the Microservice is created, select the “API - Build” menu item:

 

Once the REST API is built, select the “API - View API” to render the Microservice REST API:

 

Let’s select the Microservice and execute the Microservice, provide values for the 2 inputs:

 

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. 

 

Click on the API menu and observe the ‘Build log’ and ‘View API’ feature options. 

 

The build log has information about any errors; otherwise, it's empty. 

 

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.