Actions

After an event triggers a subscription, the subscription performs an action - such as using a webhook to send an HTTP request to an external system or sending an email.

Webhook Action

When you configure a webhook action, you specify the URI to send the request and the HTTP method to use. Some HTTP methods allow you to include a request body or payload. In the payload, you can use parameters to include information about the cause of the action, such as the text of the data SLA alert. You can also include request headers, content type, and authentication type as needed.

Tasks can be as simple as sending a message through an application API or as powerful as calling an external API to perform an action in another system.
Important: You must configure webhooks as expected by the receiving system. For details on how to configure incoming webhooks, check the receiving system's documentation. You might also need to enable webhook usage within that system.
When you set up a webhook action for a subscription, you select the HTTP request method to use. You can use the following methods in webhooks:
  • GET
  • POST
  • DELETE
  • PUT

You can include a request body or payload for a webhook action that uses a PUT, POST, and DELETE request. Depending on the receiving system, the payload might not be used.

Payload

You can use any valid content type when you define the payload. You then specify the content type in the subscription properties. When defining a payload message, be sure to consider when the subscription sends the webhook and include the information that the recipient needs.

You can use parameters in the payload to include information about the event that triggered the webhook action. For example, when configuring a webhook action that sends a text message when a job transitions to an inactive status, you might include the job name and changed job status in the message.

You can use a parameter that contains an object ID to construct URLs to the object. That way, the user receiving the message can click the URL to view the object that generated the event in the Control Hub UI.

For example, the following message includes the URL to the job that generated the event:
{
     "text":"The job {{JOB_NAME}} changed to a {{TO_STATUS}} status. \n https://cloud.streamsets.com/#/jobs/monitor/{{JOB_ID}}"
}

For more information, see Parameters.

Email Action

When you configure an email action, you specify the email recipient, a subject line and the message. In the subject line and message body, you can use parameters to include information about the cause of the action, such as the latest job status.

You can use parameters in the email subject line and body to include information about the event that triggered the action. For example, when configuring an email action when a report has been generated, you might include the report name.

For example, the following email message includes the name and URL to the report that generated the event:
The {{REPORT_NAME}} report has been generated and is now available. 
You can view the report here: {{REPORT_URL}}

For more information, see Parameters.