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. Here, you configure three simple activities such as the Invoke REST Service activity to invoke an external service, a log message activity to register a message about the status of the first activity and a return activity to produce the results of the flow executed.

Tip: Each activity in the Add Activity dialog box realizes specific action in the flow and each action has a specific configuration. For more information on specific activities, refer to Activities.

To invoke a rest service, configure the activity and map the status of the same to the log message activity.

Configure Invoke Rest service activity

  1. On the right of the Flow Inputs & Outputs tab, click on the plus tab.

  2. In the Add Activity dialog, go to the General tab and select the Invoke Rest Service activity.

  3. The Invoke Rest Service activity’s configuration window opens with the Settings tab selected by default.

  4. On the Settings page, in the URL field, provide the URL for the Rest API that is to be invoked, set the method as GET, and click save.

    Here, the URL is set as https://reqres.in/api/users/2

Add a Log Message activity

  1. Beside the Invoke REST Service activity, click on the plus tab.

  2. On the Add Activity page, go to the General tab and click the Log Message.

  3. The LogMessage activity’s configuration window opens automatically after its creation. By default, the Settings tab is selected.

  4. 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:
    1. Click the Input tab. The Available data and Activity inputs columns are displayed on the right side of the LogMessage activity tabs.
    2. Select the message in the Activity Inputs column. Configure the message to print in the logs. This will open the text editor of the message.
    3. Configure this log message activity to log the status code received from the InvokeRESTService activity. To use a function in the editor, click the Functions button, expand the string and select coerce.tostring(value).

    4. 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.

    5. Close the LogMessage dialog box.

      Now, the flow has two configured activities: