External Automation Approval Using Webhooks Overview

Learn about integrating webhook-based approvals into your Armory CD-as-a-Service app deployment process. Review use cases and see how webhook-based approval works to automatically continue or roll back your deployment.

When you should use webhook-based approvals

You can think of webhook-based approvals as a generic extensibility layer that enables you to call any API in any internet-accessible system. You can use a webhook to obtain a decision from a process that is external to CD-as-a-Service.

Webhook use cases

Before deployment

  • Upgrade a database schema
  • Custom approval process

Within your deployment strategy

  • Check logs and system health
  • Run custom tests

After deployment

  • Run integration tests in a staging environment
  • Perform metric tests
  • Run security scanners

How webhook-based approval works

In order to accommodate a long-running process, CD-as-a-Service supports the asynchronous webhook with callback pattern. You define the webhook in your deployment file and add a webhook call in the constraints section of your deployment definition or in a canary step.

Basic flow

The deployment process:

  1. Encounters a webhook configuration
  2. Calls the external API, passing the callback URI
  3. Pauses deployment while waiting for the callback
  4. Receives and processes callback
    • Success: deployment proceeds
    • Failure: deployment rolls back
flowchart LR   
   A --> B
   B --> C
   C --> D
   D --> E
   E --> F
   F -- "Success: true" --> G
   F -- "Success: false" --> H

   A["Deployment Starts"]
   B["Webhook Call Triggered<br>Deployment Pauses"]
   F{"Did the external process<br>succeed or fail?"}
   G["Deployment Continues"]
   H["Deployment Rolls Back"]

   subgraph exp [External Process]
   C["External API<br>Receives Request"]
   D["Process Runs"]
   E[Callback to Deployment]
   end

What’s next


Last modified July 20, 2023: (37290cf)