The Webhooks notification plugin is a builtin plugin that sends POST data to a URL when a job succeeds or fails.
- For more info about configuring jobs to use webhook notifications, see the chapter Job Notifications.
- For more info about webhooks in general see: https://webhooks.pbworks.com/w/page/13385124/FrontPage
When a Rundeck Job webhook notification is triggered, the server will send a POST request to one or more configured URLs. The request will contain XML content containing information about the Execution that has finished. The request will also contain special HTTP Headers to include some information about the notification and the Execution. You can also configure your URLs to have property tokens that will be replaced with specific details about the Job, Execution or Notification prior to the webhook request being submitted.
Execution Notification Content
The content of the POST request will be XML, with a single
<notification> root element. This element will contain
<executions..><execution>...</execution></executions> content. This inner content is of the same format as the XML returned from the Web API for Execution information. See the chapter [API – Listing Running Executions](/api/rundeck-api.md#listing-running-executions] for more information.
Attributes of the
notification element will include:
- The type of notification trigger. Either “success” or “failure”.
- The ID of the Execution
- The result status of the Execution. Either “succeeded”, “failed” or “aborted”.
<notification trigger="success" executionId="[ID]" status="[STATUS]"> <executions count="1"> <execution ...> ... </execution> </executions> </notification>
Execution Notification Headers
The POST request will also contain several custom HTTP headers, providing another way to receive some of the webhook information:
- The notification trigger type, either “success” or “failure”.
- The Execution ID
- The status of the execution, either “succeeded”, “failed”, or “aborted”.
Execution Notification URL Token Expansion
As well, the URLs configured for the webhook notification may contain tokens that will be expanded with values taken from the associated job and execution, such as
Available tokens for expansion are:
- Properties about the Job, including:
- the Job name
- The Job group, or a blank string
- the Job Id
- the Project name
- Properties about the Execution, including:
- The Execution ID
- The user who executed the job
- The execution status, one of “succeeded”,”failed”,or “aborted”
- The trigger associated with the notification, one of “success” or “failure”.
So for example, this URL:
Will have the tokens replaced with the appropriate values prior to making the webhook request.