Free AI SOP Library

GP-SOP-012 | Workflow Quality

Recover and Learn From a Failed AI Workflow

A restored workflow, a clear cause, and one tested improvement that reduces the chance of repeat failure.

Time: 20-45 minutesLevel: Beginner-friendlyReview: Human required

When to use this SOP

Use this when an AI-assisted or automated workflow produces bad output, stops unexpectedly, consumes unusual resources, or behaves differently after a change.

What you need

  • The failed run and logs
  • The last known working version
  • Recent changes
  • Representative input and expected output

The procedure

Follow these steps

  1. 01

    Stop repeated runs when they could create cost, duplicate actions, data loss, or resource pressure.

  2. 02

    Preserve the failed input, output, error message, logs, model, prompt, settings, and time of failure.

  3. 03

    Confirm the expected behavior and reproduce the issue with the smallest safe test case.

  4. 04

    Check recent changes first: credentials, model versions, prompts, node settings, dependencies, schemas, and resource limits.

  5. 05

    Change one variable at a time and record what the test proves.

  6. 06

    Restore a known working version when recovery matters more than diagnosis.

  7. 07

    Add validation, clearer errors, limits, fallback behavior, or a human checkpoint at the failure point.

  8. 08

    Rerun happy-path and failure tests, then document the cause and fix.

Human checkpoint

Stop and review before continuing

Do not ask AI to guess the root cause from a vague description. Give it logs and evidence, then verify every proposed change.

Definition of done

  • The workflow is stopped or contained safely
  • Failure evidence is preserved
  • The issue can be reproduced or bounded
  • The fix addresses an evidence-backed cause
  • Regression tests pass
  • The recovery note explains what changed

When the process gets stuck

If the cause remains unknown, restore the last working version, document the uncertainty, and add monitoring before trying broader changes.

Where automation fits

Monitoring can capture failed runs and alert you. Diagnosis and approval of corrective changes should remain deliberate.

Optional AI assist

Use this after you collect the real inputs

This prompt can organize a first pass. Review the result against the SOP before using it.

Help diagnose this workflow failure using only the evidence supplied.

Return:
- Observed facts
- Most likely causes ranked by evidence
- Missing information
- Smallest safe reproduction test
- One-variable-at-a-time diagnostic plan
- Rollback option
- Validation tests after the fix

Do not claim a root cause without evidence. Do not recommend destructive commands or credential changes without explaining the risk.

Expected behavior: [EXPECTED]
Failed behavior: [FAILED]
Recent changes: [CHANGES]
Logs and configuration: [EVIDENCE]