Overview
To enable you to integrate your current processes with MDOQ as much as possible, MDOQ has the ability to send webhooks for certain events. At the moment it is not possible to configure these events in the MDOQ UI, however you can just raise a support request and we can get them enabled and configured for you.
The general idea is that you can then use these webhooks to trigger functionality in your own middleware, which can then optional update the MDOQ UI so you have a single point of reference for all actions carried out for a specific process.
The timeout for a webhook is 60 seconds, if you feel that your process may take longer we would recommend looking at the locking facility.
All requests made by MDOQ will be a POST request.
Configuration
When configuring webhooks we will just need to know:
- The events you wish to receive
- The endpoint(s) you would like us to hit
- (optional) A secret to be passed along with the request (so you know it's us)
Context
A request from MDOQ made to your endpoint contains the following information:
Headers
Content-Type: application/json
User-Agent: MDOQ Webhook (https://www.mdoq.io)
Accept: application/json
X-MDOQ-Secret: SECRET
POST data
{
"secret": "SECRET" (string) The secret configured for the webhook
"instance": {} (object) All instance information for the current event
"parent_log": 1234 (int) The ID of the action log for the current process
}
Locking
Depending on what processes you are trying to glue MDOQ into the amount of time required to carry out the actions for a webhook event can vary, to support this MDOQ has a locking feature.
If you want an event to be locking the request/response process would look like this:
- MDOQ creates a lock for the current process
- MDOQ makes a request to the configured endpoint (passing along the lock)
- Your middleware carries out any actions required
- Your middleware uses the MDOQ API to release the lock
- MDOQ continues with the current process
MDOQ will wait indefinitely for the lock to be released.
If an event is configured to be locking, the following additional data will be passed along with the request
{
"lock": "the lock" (string) the lock that will need to be released
}
Events
Before Release
This is fired before any release steps are carried out by MDOQ. An example use case would be a pre release slack notification.
Additional context data sent with this event.
{
"release": {
"tag": "TAG", (string) the tag being released
"zero_downtime": true (boolean) indicating if the release is zero downtime
}
}
Before Release Complete
This is fired after the core MDOQ steps of a release are completed but before the released is marked as completed. An example use case would be: adding a step to clear and external cache such as Cloudflare or Stackpath
Additional context data sent with this event.
{
"release": {
"tag": "TAG", (string) the tag being released
"zero_downtime": true (boolean) indicating if the release is zero downtime
}
}
After Release
This is fired after a release is complete. An example use case would be a post release slack notification.
Additional context data sent with this event.
{
"release": {
"tag": "TAG", (string) the tag being released
"zero_downtime": true (boolean) indicating if the release is zero downtime
}
}