Webhook
This automation action allows to send an HTTP request to a given URL. The request can be configured to send data from the subject on which the action is started and also data from the job run context.
Available Context
For more information on context limitations refer to the Available Context section.
Multiselect: Yes Elements: Data Objects, Assets, Documents
Configuration Options
# (Required) URL to which the request should be sent.
host: 'https://your-webhook-url.com'
# HTTP method to be used for the request.
method: POST
# Payload to be sent with the request.
payload: '{"id": {{subject.id}}, "key": "{{subject.key}}"}'
# Content type of the request.
content_type: application/json
# Additional headers to be sent with the request.
custom_headers: []
Detailed Configuration Options
host
: Required URL to which the request should be sent.method
: HTTP method to be used for the request. Default:POST
, supported values:POST
,GET
.payload
: Payload to be sent with the request. It is a twig template with access to thesubject
on which action is started and to thecontext
which contains the job run context.content_type
: Content type of the request. Default:text/plain
, supported values:text/plain
,text/html
,application/json
custom_headers
: Optional additional headers to be sent with the request. It is a dictionary of key-value pairs. Default:[]
Examples
This example sends a POST request to a given URL with a payload containing the id and type of the subject on which the action is started. The payload will be rendered as plain text.
step_implementation: webhook
configuration:
host: 'https://your-webhook-url.com'
method: POST
payload: 'Webhook executed for id: {{ subject.id }} which has the type: {{ subject.type }}'
This example sends a POST request to a given URL with a payload containing the id and type of the subject on which the action is started. The payload will be rendered as plain text. In addition to the first example, this one also sends a custom header with the request.
step_implementation: webhook
configuration:
host: 'https://your-webhook-url.com'
method: POST
payload: 'Webhook executed for id: {{ subject.id }} which has the type: {{ subject.type }}'
custom_headers:
token: '123456'
additionalHeader: 'value'
This example sends a POST request to a given URL with a payload containing the id and key of the subject on which the action is started. The payload will be rendered as JSON.
step_implementation: webhook
configuration:
host: 'https://your-webhook-url.com'
method: POST
payload: '{"id": {{subject.id}}, "key": "{{subject.key}}"}'
content_type: application/json
This example sends a POST request to a given URL with a payload containing the id of the subject on which the action is started and data from the previous step stored in the job run context. The payload will be rendered as JSON.
step_implementation: webhook
configuration:
host: 'https://your-webhook-url.com'
method: POST
payload: '{"id": {{subject.id}}, "key": "{{subject.key}}", "data": {{context["previous_step"]["data"]}}}'
content_type: application/json
This example sends a GET request to a given URL with a payload containing the id and type of all items which have been selected with the workspace selection.
step_implementation: webhook
configuration:
method: GET
host: 'https://your-webhook-url.com'
payload: '{% for row in selectedItems %} {{row.id}} {{row.type}} {% endfor %}'