Schedule icon
WorkingDirectory icon
Clone icon
Commands icon
Docker icon
Loop icon
Download icon
Get icon
Write icon
If icon
Set icon
Log icon
Fail icon

API Evolution Watchtower

Monitor third-party OpenAPI specs with Kestra and oasdiff, detect consumer-impacting changes, persist baselines, and govern revisions as PASS/WARN/BLOCK.

Categories
BusinessInfrastructure

Abstract

API Evolution Watchtower is a consumer-side API governance workflow for teams that depend on third-party APIs they do not control. It monitors OpenAPI specifications, detects contract changes with oasdiff, filters findings to operations the consumer actually uses, and determines whether a revision should be accepted or blocked.

The accepted API specification is persisted in the Kestra KV store, allowing future executions to compare new revisions against the last accepted baseline instead of repeatedly comparing against the original bootstrap specification.

How it works

  1. A scheduled trigger starts the Watchtower.
  2. The Loop processes every configured API independently.
  3. The baseline and candidate OpenAPI specifications are downloaded.
  4. SHA-256 hashes are calculated so unchanged specifications can skip expensive change analysis.
  5. oasdiff generates a machine-readable changelog for changed specifications.
  6. Findings are filtered against the consumer's configured operations.
  7. Changes are classified as PASS, WARN, or BLOCK according to the governance policy.
  8. PASS and WARN revisions are promoted to the persistent KV baseline.
  9. BLOCK revisions leave the previously accepted baseline frozen.
  10. A final summary aggregates the governance result across all monitored APIs.

What it does

  • Monitors multiple third-party OpenAPI specifications in one flow.
  • Detects changed specifications using SHA-256 hashing.
  • Runs oasdiff only when a candidate differs from the accepted baseline.
  • Filters findings to operations actually used by the consumer.
  • Applies consumer-side PASS / WARN / BLOCK governance policy.
  • Persists accepted OpenAPI baselines in Kestra KV.
  • Promotes PASS and WARN revisions and freezes the baseline on BLOCK.
  • Produces per-API Markdown reports and an aggregate JSON governance summary.

Prerequisites

  • Kestra with Docker task runner access.
  • No secrets are required for the included public-spec demo.
  • Internet access for the public OpenAPI fixtures and the oasdiff repository.
  • Docker access for the included python:3.12-slim and tufin/oasdiff:v1.32.1 task containers.

Quick start

  1. Import the Blueprint into Kestra.
  2. Run the flow manually with the included example API list.
  3. Review the per-API governance results and final summary.
  4. Replace the example API definitions with your own baseline URL, revision URL, and consumer-used operations.
  5. Enable the schedule after reviewing the baseline and governance policy.

Inputs

  • apis: Array of API definitions. Each item contains:
    • name: unique API identifier.
    • baseline_url: bootstrap OpenAPI specification URL.
    • revision_url: candidate OpenAPI specification URL.
    • used_operations: consumer operations such as GET /users/*.

Outputs

  • outputs.final_summary.outputFiles['governance_summary.json']: aggregate PASS/WARN/BLOCK results for all monitored APIs.
  • outputs.evaluate_policy.outputFiles['report.md']: detailed per-API governance report.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.