See llms.txt for all machine-readable content.

Back to Templates

Self-heal failed workflows from webhook errors using an external AI API

Quick overview

This workflow receives failed-execution events via webhook, analyzes the error, fetches recent execution history, generates recovery strategies via an external AI HTTP endpoint, attempts an automated recovery action, logs the outcome, and returns a structured self-healing report to the caller.

How it works

  1. Receives a POST request on a webhook containing details about a failed workflow node or execution error.
  2. Validates the payload, extracts failure context (workflow, node, error, retry count), and classifies severity and retryability.
  3. Calls an HTTP endpoint to fetch recent execution history and related error patterns for the failing workflow/node.
  4. Calls an HTTP endpoint to generate ranked recovery strategies based on the failure context and history.
  5. Calls an HTTP endpoint to execute the primary recovery action (for example retry, fallback, or escalation).
  6. Calls an HTTP endpoint to log the recovery attempt and then returns a consolidated self-healing report in the webhook response.

Setup

  1. Configure the source system to send failure events to the workflow’s POST webhook URL (path: /self-heal) with fields like failedNode and errorMessage/errorCode.
  2. Replace the placeholder httpbin.org URLs for execution history, AI strategy generation, recovery execution, and outcome logging with your real internal services (or monitoring/incident tooling) endpoints.
  3. If your endpoints require authentication, add the required HTTP credentials/headers to the HTTP Request steps and adjust timeouts as needed.