Adding Webhooks to mabl

mabl makes it easy to integration with your current continuous integration (CI) workflows using webhooks. Follow the steps below to quickly get your webhooks wired.

Adding webhooks

  1. Navigate to the Settings from the mabl dashboard by clicking on the link in the left hand navigation panel.
  2. Click the Webhooks tab.
  1. Examine the page. If you have added any webhooks previously, they will appear at the top here.
  2. Moving on, you will see a section titled Add Webhook where you can begin to configure your workflow integrations.
  1. You can begin to enter the name of your webhook in the Name field and the target URL in the URL field. mabl will call this URL with a JSON payload describing the pending or completed execution (details below).
  1. Once you've added a name and URL, you can set your Bound Lifestyle Stages as both or either pre and post-execution.

Pre-execution webhooks will be fired before any Journey Executions start

Post-execution webhooks will be fired after all Journey Executions complete.

  1. Next, set your Bound Plan Outcomes as both or either on success and on failure.

On Failure - used by Post-Execution webhooks. Only fired if a Journey Execution fails

On Success - used by Post-execution webhooks. Only fire if all Journey executions successful

  1. Next, you can set Require success response to on or off. This requires the endpoint to return a successful response status of 2xx or 3xx (e.g. 200) for the Journey Execution to continue, or the test will be failed. This only applies to Pre-Execution webhooks. The applicable use case is a customer side script that sets up an application database before the test starts. Post-Execution webhooks are not contingent and the Plan will be marked a success even if they return failure codes.

  2. Finally, you can turn off Strict SSL Validation if you'd like. mabl ensures all connections use valid SSL certificates, but some CI servers may use self signed certificates.

Webhook Timing

All webhooks for a given Workspace are fired in parallel. Each webhook must complete in 60 seconds or less or it will be considered failed.

Webhook Payloads

Webhook endpoints will receive a JSON containing the running Plan and Journey Execution information.

Note: "success" attributed will be true until a state of terminated, cancelled, or failed is encountered.

The "status" states, in order, are queued, scheduling, scheduled, (succeeded, failed, cancelled), completed.

Pre-Execution Payload

{
  "status": "queued",
  "status_cause": null,
  "success": true,
  "plan": {
    "id": "4ba4550d-df2b-4df2-8799-46c44dbb4b9e",
    "name": "Print click and assert Plan",
    "href": "https://api-dev.mabl.com/v1/schedule/runPolicy/4ba4550d-df2b-4df2-8799-46c44dbb4b9e",
    "tags": []
  },
  "plan_execution": {
    "status": "queued",
    "status_cause": null,
    "id": "d5b96d02-c45d-4d08-8684-de55411bcede",
    "href": "https://api-dev.mabl.com/v1/execution/runPolicyExecution/d5b96d02-c45d-4d08-8684-de55411bcede"
  },
  "journeys": [
    {
      "id": "c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0",
      "name": "Print, then assert",
      "href": "https://api-dev.mabl.com/v1/test/journey/c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0",
      "tags": [
        "training"
      ]
    }
  ],
  "journey_executions": [],
  "start_time": null,
  "stop_time": null,
  "tags": [],
  "results": [],
  "message_version": "1.0.0"
}

Post-Execution Payload

{
  "status": "succeeded",
  "status_cause": null,
  "success": true,
  "plan": {
    "id": "4ba4550d-df2b-4df2-8799-46c44dbb4b9e",
    "name": "Print click and assert Plan",
    "href": "https://api-dev.mabl.com/v1/schedule/runPolicy/4ba4550d-df2b-4df2-8799-46c44dbb4b9e",
    "tags": []
  },
  "plan_execution": {
    "status": "succeeded",
    "status_cause": null,
    "id": "d5b96d02-c45d-4d08-8684-de55411bcede",
    "href": "https://api-dev.mabl.com/v1/execution/runPolicyExecution/d5b96d02-c45d-4d08-8684-de55411bcede"
  },
  "journeys": [
    {
      "id": "c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0",
      "name": "Print, then assert",
      "href": "https://api-dev.mabl.com/v1/test/journey/c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0",
      "tags": [
        "training"
      ]
    }
  ],
  "journey_executions": [
    {
      "status": "completed",
      "status_cause": null,
      "success": true,
      "name": "Print, then assert",
      "journey_id": "c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0",
      "journey_execution_id": "c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0",
      "start_time": 1517612117504,
      "stop_time": 1517612146280,
      "href": "https://api-dev.mabl.com/v1/execution/runPolicyExecution/4ba4550d-df2b-4df2-8799-46c44dbb4b9e/testScriptExecution/c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0",
      "results_href": "https://app-dev.mabl.com/workspaces/3627972b-a762-4a87-a3fb-97cde3e9c414/test/plan-executions/d5b96d02-c45d-4d08-8684-de55411bcede/journeys/c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0"
    }
  ],
  "start_time": 1517612110113,
  "stop_time": 1517612146368,
  "tags": [],
  "results": [
    {
      "success": true,
      "name": "Print, then assert",
      "results_href": "https://app-dev.mabl.com/workspaces/3627972b-a762-4a87-a3fb-97cde3e9c414/test/plan-executions/d5b96d02-c45d-4d08-8684-de55411bcede/journeys/c221c1f8-aa52-4fdb-a1bd-5ee5b408ac9f:0"
    }
  ],
  "message_version": "1.0.0"
}

Adding Webhooks to mabl