Send HTTP Request using FME Flow Automations

Tandra Geraedts
Tandra Geraedts
  • Updated

FME Version

Introduction

FME Flow can “push” or POST a message to a URL when a workspace is completed using the HTTP Request external action or the FMEFlowNotifier transformer in Workbench. This method replaces notifications and topic monitoring with the Automations writer and the REST API in FME Flow. For more information and examples, please see our article Getting Started with the FME Flow Rest API

Automation actions have simplified the method for sending HTTP requests. You might want to use this functionality to update a webpage outside of FME Flow to show a list of what workflows have been run and when, and if they were successful or failed. 

 

Step-by-step Instructions

1. Create a New Automation
Log into FME Flow. On the side menu expand Automations and click Create Automation. Double-click on the starting Trigger component to open the parameters, then change Trigger to Manual Trigger (max 1 per Automation). Any trigger will work but this example will use a manual trigger for ease of testing. Alternatively, you can use the project file attached to this article 

2. Configure a Workspace Action
Click on the plus icon to open the component menu and then add an action. Connect it to the success port on the Manual Trigger. Open the parameters and ensure Action is set to Run Workspace. Next, set the Repository to Samples and select the earthquakextrusion.fmw workspace. This can be any action but in this example, we are going to run a workspace.
ConfigureAction.png

3. Configure the HTTP Request
Click on the plus icon and add an external action. Configure it for an HTTP Request (send). Additionally, you could send a separate HTTP Request for failed runs by connecting another external action to the x port on the workspace action.
SucessOrFail.png

The details of the HTTP request are shown below. The Target URL is where you want the POST to go. For this example, the PostTestServer.dev service is used and it does not require any authorization. The accept Header and Content Type are automatically filled in and the HTTP Body can be customized with information from the job to provide the information you require. 
HTTPPost.png

4. Save and Run the Automation
The automation should look similar to the image below. Depending on the trigger and action chosen, the text will be different
SampleAutomation.png
Save the automation and click the green Start Automation button
startautomation.png

Once the automation is running, you will have to manually trigger the automation by clicking the Trigger button
Trigger.png

5. View the Results
After triggering the automation, go to the target URL to see the results. Of course, you can post a message to any web service but for demonstration purposes PostTestServer.dev is used to easily view the results.
PostDetails.png

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.