Skip to main content
Version: 2024.2

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.

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

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 the subject on which action is started and to the context which contains the job run context.
  • content_type: Content type of the request. Default: text/plain, supported values: text/plain, text/html, application/json

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 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 %}'