Web Service
A web service is similar to a webhook in that other systems can trigger the execution of automations instantly when specific events occur by sending data to a specified URL.
Unlike webhooks, a web service automation can return output data from the automation back to the caller that invoked the URL. The caller waits until the web service automation returns its output data.
It is also possible to build Web Service assemblies with the assembly editor, see Web Services
The Web Service system utility app provides a single trigger for receiving input data from the calling system:
A Web Service receives data via a specified URL. The Web Service can be configured to receive URL query parameters by entering one or more query parameter names.
The Web Service can also be configured to receive a POST payload. If JSON or XML is entered, the system will automatically parse it and create mappable data fields as output from the trigger that can be mapped to actions in the automation.
After configuring the inputs, click the Fetch Data Fields button. The system will then display the Web Service's URL. Click the copy icon to copy the URL to your clipboard and provide that to the calling system.
Build the logic of your automation normally. To return output data back to the calling system, use the "return HTTP response" action:
Configure an HTTP status code to return and the response data to return back to the caller.
This action can be used to return error responses back to the caller. Generally error responses use HTTP status codes >= 400. For an explanation of HTTP status codes, see here.
Your automation logic should only execute a single "return HTTP response" action. If multiple of these are executed, the last one takes precedence.
If other actions in the automation raise an error, the system automatically halts the automation and returns an error response back to the caller with the error message logged by the automation.
Web Service automations do not perform auto-retry logic for any failed actions that are normally configured to be auto-retried, b/c the caller system is expecting an immediate response from the web service. It would be up to the calling system to determine if it wants to retry the failure or not.
Web service automations in the dashboard will display the execute icon:
Clicking it generates a curl command that can be used to test the web service automation:
The curl command includes any query parameters and POST payload configured in the web service trigger.