Workflow Processing
When your integration gateway endpoint requires additional processing and the built-in processers do not suffice, you can bind a workflow to the endpoint to handle requests.
To bind a workflow to an integration gateway route, you first need to properly configure the workflow, and then bind it to the route’s workflow processer.
Workflow Configuration
If you wish for a workflow to be executable by the integration gateway, the workflow must define a proper trigger.
-
Create a new workflow or edit an existent workflow. Refer to the workflow documentation for details.
-
Assure that the workflow in question defines a trigger with the resource of
System
and an event ofonManual
.
Reading a Request Body via Function
The way the http.Request is wrapped allows us to use it in the JS environment processing function (see more at JavaScript processing) or the function designed specifically for request body content fetching.
Find the workflow for this example in the hyperlink.
Reading a Request Body via JS
Find the workflow for this example in the hyperlink.
try {
return JSON.parse(readRequestBody(input));
} catch (e) {
return 'could not parse request body: ' + e.message
}
string
and later parsed in the subsequent workflow steps:try {
return readRequestBody(input);
} catch (e) {
return 'could not read request body: ' + e.message
}
Integration Gateway Route Configuration
-
Create a new integration gateway endpoint or edit an existing endpoint. Refer to the integration gateway documentation for details.
-
Add a workflow processer to the endpoint.
-
Select the workflow you wish to bind from the dropdown in the modal window.
-
Confirm the selection and press on the save button to update the endpoint.
Testing
To test if the integration gateway route and the workflow are properly interacting, initiate an HTTP request using Postman or any other tool such as cURL.
Refer to the curl examples for details.