Step 6: Add invoke REST Service and Log Message Activity to the flow
Activities perform specific tasks within the flow. A flow typically contains multiple activities. Configure three simple activities such as:
-
The Invoke REST Service Activity to invoke an external service,
-
The Log Message Activity to register a message about the status of the first Activity,
-
The Return Activity to produce the results of the flow that are run.
To invoke a rest service, configure the Activity and map the status of the same to the Log Message Activity.
Configuring Invoke Rest service Activity
- Procedure
- On the right sidebar, click Activities.Note: The
represents the StartActivity. The subsequent Activities can be placed anywhere in the canvas.
- You see the Activity palette open, that has a list of different Activites to choose from. Go to the General category and select the Invoke REST Service Activity from the group of Activities listed there.
Drag this Activity from there to anywhere in the canvas. Drop a connection line between the StartActivity and the Invoke REST Service Activity. This represents the order in which the Activities are performed.
-
On the Settings page, in the URL field, provide the URL for the Rest API that is to be invoked. Then, click Save and close the configuration window.
Here, the URL is set as
https://reqres.in/api/users/2
.
Click the Invoke Rest Service Activity tile to open the configuration window. It opens with the Settings tab selected by default.
Adding a Log Message Activity
- Procedure
- Beside the Invoke REST Service Activity, we add the LogMessage Activity. To do so, go to the Activity palette and click the General category. A dropdown displays which shows the list of activities that are grouped under this tab. Drag the LogMessage Activity from there to anywhere in the canvas. Add the connection line between the two Activities.
-
Click the LogMessage Activity tile to display the configuration window. It opens with the Settings tab selected by default.
- To configure the LogMessage Activity with a message to log when it receives an incoming request from the ReceiveHTTPMessage trigger about the status of the Invoke rest service:
- Click the Input tab. The Available data and Activity inputs columns are displayed.
- Select the message in the Activity Inputs column. Configure the message to print in the logs. This opens the text editor of the message.
- Configure this Log Message Activity to log the status code received from the InvokeRESTService Activity. To use a function in the editor, click Functions, expand the string and select coerce.tostring(value).
- The newly added function appears in the editor with a default placeholder (value) as an argument. Replace the placeholder with the status code:
In the Available data pane, expand InvokeRESTService, drag StatusCode and drop it in place of Value, and click Save. Alternatively, you can also select the placeholder and double click on StatusCode in Available data and save it.
- Close the LogMessage dialog box.
Now, the flow has two configured activities:
- Configure this Log Message Activity to log the status code received from the InvokeRESTService Activity. To use a function in the editor, click Functions, expand the string and select coerce.tostring(value).
- The newly added function appears in the editor with a default placeholder (value) as an argument. Replace the placeholder with the status code:
In the Available data pane, expand InvokeRESTService, drag StatusCode and drop it in place of Value, and click Save. Alternatively, you can also select the placeholder and double click on StatusCode in Available data and save it.
- Close the LogMessage dialog box.
Now, the flow has two configured activities:
- Configure this Log Message Activity to log the status code received from the InvokeRESTService Activity. To use a function in the editor, click Functions, expand the string and select coerce.tostring(value).
.
- The newly added function appears in the editor with a default placeholder (value) as an argument. Replace the placeholder with the status code:
In the Available data pane, expand InvokeRESTService, drag StatusCode and drop it in place of Value, and click Save. Alternatively, you can also select the placeholder and double click on StatusCode in Available data and save it.
- Close the LogMessage dialog box.
Now, the flow has two configured activities:


