Create Kubernetes resources from Slack with Anthropic Claude and safety guardrails

Go to Workflow
0 views
Built by Oneclick AI Squad Oneclick AI Squad
Created on September 08, 2026

Description

Quick overview
This workflow listens for Kubernetes create requests in Slack (or runs manually), uses Anthropic Claude to generate a Kubernetes manifest, validates it against deterministic safety guardrails, requests human approval in Slack, then applies the manifest via the Kubernetes API and verifies rollout health with automatic rollback on failure.

How it works
Triggers from a Slack app mention or a manual run and captures a plain-English description of the Kubernetes resource to create.
Uses Anthropic Claude to generate a Kubernetes resource manifest as structured JSON plus a short explanation.
Parses the model output and deterministically validates the manifest against guardrails (allowed namespaces, required CPU/memory requests and limits, and blocked privileged/hostNetwork/hostPath usage).
If validation fails, posts the specific violations back to Slack and stops.
If validation passes, posts the manifest and explanation to Slack and waits for a human approve/reject decision.
On approval, sends the manifest to the Kubernetes API to create the resource, waits briefly, then fetches status and evaluates readiness/availability.
If the rollout is healthy, posts a success confirmation to Slack; if not, deletes the created resource via the Kubernetes API and alerts Slack about the rollback.

Setup
Create and connect credentials for Anthropic (Claude), Slack (bot/token with permission to post messages and receive app mentions), and an HTTP Header Auth credential that sends your Kubernetes API bearer token.
Update the configuration values in the workflow for your Kubernetes API base URL, allowed namespaces, Slack target channel, and rollout grace/timeout values.
Configure your Slack app to enable app mentions in the target channel and ensure the workflow’s Slack Trigger is subscribed to the correct channel.

Nodes Used (5)

AI Agent
@n8n/n8n-nodes-langchain.agent
Anthropic Chat Model
@n8n/n8n-nodes-langchain.lmChatAnthropic
Code
n8n-nodes-base.code
HTTP Request
n8n-nodes-base.httpRequest
Slack
n8n-nodes-base.slack