Skip to main content

Webhook Event Plugins

Webhook Event Plugins


Webhook event plugins allow you to process a webhook event received by Rundeck.


Create a webhook event plugin and install it like other Rundeck plugins. Go to the webhook administration page and create a new webhook. You will see your plugin in the list of Webhook Event Plugins. Choose your plugin and if your plugin specified plugin properties they will be presented to the user.


By default, your plugin will use the configuration values supplied by the user when they configure the webhook.

Project and Framework properties can also be used to configure the plugin.

Framework scope property definition in


Project scope property definition in


Plugin Types

At this time only Java plugins are supported.

Your Java plugin will receive a WebhookEventContext object and a WebhookData object. The event context supplies Rundeck services that you might need in your plugin processing code, such as the job runner service.

The WebhookData object contains the event payload itself as an InputStream plus contextual information such as the event sender, data content type, owning project, and pertinent HTTP headers your plugin might need.


You can control the response sent back to the service that called the webhook by implementing a WebhookResponder.

A WebhookResponder class must be returned from the plugin's onEvent method. If you return a null the DefaultWebhookResponder will be used, which sends a plain text ok message to the webhook caller.

import com.dtolabs.rundeck.core.plugins.Plugin;
import com.dtolabs.rundeck.core.webhook.WebhookEventException;
import com.dtolabs.rundeck.plugins.ServiceNameConstants;
import com.dtolabs.rundeck.plugins.descriptions.PluginDescription;
import com.dtolabs.rundeck.plugins.webhook.WebhookData;
import com.dtolabs.rundeck.plugins.webhook.WebhookEventContext;
import com.dtolabs.rundeck.plugins.webhook.WebhookEventPlugin;
import org.apache.log4j.Logger;
import java.util.Arrays;

@Plugin(name = "log-webhook-event",service= ServiceNameConstants.WebhookEvent)
@PluginDescription(title="Log Webhook Events",description = "Can be used to log any incoming webhook events to log4j logger ''")
class LogWebhookEventPlugin implements WebhookEventPlugin {
    private static final Logger LOG = Logger.getLogger("");

    List<String> getRequestHeadersToCopy() {
        return Arrays.asList("X-My-Custom_header","X-My-Other-Custom_hdr");

    WebhookResponder onEvent(final WebhookEventContext context, final WebhookData data) throws WebhookEventException {"Log Webhook Event Plugin - Webhook event information:");"id: " + data.getId());"name: " + data.webhook);"project: " + data.project);"sender: " + data.sender);"contentType: " + data.contentType);"custom header: " + data.getHeaders().get("X-My-Custom_header"));"data:"); BufferedReader(new InputStreamReader(data.getData()))
        return null; //will cause the default responder to respond to the webhook caller