Automation library · AI assistants

Remediate Kubernetes CrashLoopBackOff incidents with OpenAI

Started by another system calling it. It calls services over plain HTTP rather than through connectors. It hands the judgement calls to OpenAI. 32 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

32 stepsLarge: read it before trusting it with anything live
2Branches: places the flow splits
1Loop or waits
0Services by connector: it calls them over plain HTTP

The flow

Starts it 4Model 4Logic 15Service 9

The steps in the order they run, from what starts it.

  1. 1When K8s CrashLoop Alert ReceivedWebhookStarts it
  2. 2Every 2 Minutes Check Pod StatusSchedule triggerStarts it
  3. 3OpenAI GPT-4.1-MiniLm Chat Open AiModel
  4. 4OpenAI GPT-4.1-Mini SummaryLm Chat Open AiModel
  5. 5Fetch Kubernetes Pods StatusHttp RequestService
  6. 6Log Analysis AgentAgentModel
  7. 7Incident Summary AgentAgentModel
  8. 8Scan CrashLoopBackOff PodsCodeLogic
  9. 9Parse AI Crash DiagnosisCodeLogic
  10. 10Prepare Notification PayloadsCodeLogic
  11. 11If CrashLoop Pods DetectedIfLogic
  12. 12Route by AI Recommended ActionSwitchLogic
  13. 13Post Incidents to SlackHttp RequestService
  14. 14Email Incident ReportsHttp RequestService
  15. 15Log Incidents in SheetsHttp RequestService
  16. 16Fetch Logs for Detected PodsHttp RequestService
  17. 17Respond No CrashLoop FoundRespond To WebhookStarts it
  18. 18Delete Pod to RestartHttp RequestService
  19. 19Determine Scaling TargetCodeLogic
  20. 20Fetch Deployment Revision HistoryHttp RequestService
  21. 21Prepare Escalation Result DataCodeLogic
  22. 22Respond Remediation CompletedRespond To WebhookStarts it
  23. 23Prepare Log Data for AICodeLogic
  24. 24Prepare Restart Result DataCodeLogic
  25. 25Patch Deployment to ScaleHttp RequestService
  26. 26Find Rollback Deployment TargetCodeLogic
  27. 27Wait for Data CompletionWaitLogic
  28. 28Merge Remediation ResultsMergeLogic
  29. 29Prepare Scale Result DataCodeLogic
  30. 30Patch Deployment for RollbackHttp RequestService
  31. 31Compile Incident Report DataCodeLogic
  32. 32Prepare Rollback Result DataCodeLogic

How it's built

Starts on
Another system calling it
Steps
32, with 2 branches, 1 loop or waits
Size
Large: read it before trusting it with anything live
Connects to
Nothing by connector; it calls services over plain HTTP
Model
OpenAI

Questions

What does it need to run?

An n8n account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 32 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 32 steps before you point it at anything that matters.