feat: let a workflow act as its agent

The agents' Keycloak client secrets reach the pod through the keycloak store,
naming the one property each workflow needs rather than copying it into n8n's
own Vault path — one source for a client secret, so rotating it in Vault
rotates it everywhere.

N8N_BLOCK_ENV_ACCESS_IN_NODE=false so a workflow can read them as $env, which
keeps them out of the committed workflow JSON. The trade-off is written down in
the ConfigMap: any workflow can then read any variable in the pod, which is
acceptable while this instance runs only this estate's agents.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
Stéphane Tailland
2026-08-29 12:54:51 +02:00
parent 3ca122287f
commit a658976f45
3 changed files with 16 additions and 0 deletions
+1
View File
@@ -5,6 +5,7 @@ resources:
- ca-configmap.yaml - ca-configmap.yaml
- secrets/clustersecretstore.yaml - secrets/clustersecretstore.yaml
- secrets/externalsecret.yaml - secrets/externalsecret.yaml
- secrets/agent-externalsecret.yaml
- postgres/statefulset.yaml - postgres/statefulset.yaml
- postgres/service.yaml - postgres/service.yaml
- n8n/pvc.yaml - n8n/pvc.yaml
+10
View File
@@ -33,3 +33,13 @@ data:
N8N_DIAGNOSTICS_ENABLED: "false" N8N_DIAGNOSTICS_ENABLED: "false"
N8N_VERSION_NOTIFICATIONS_ENABLED: "false" N8N_VERSION_NOTIFICATIONS_ENABLED: "false"
N8N_RUNNERS_ENABLED: "true" N8N_RUNNERS_ENABLED: "true"
# Lets a workflow read `$env.<NAME>`. n8n blocks this by default, which is the
# right default for an instance where anyone can write a workflow — here it is
# how an agent's client secret reaches the workflow that acts as that agent,
# without the secret being stored in the workflow JSON and committed.
#
# It does mean any workflow can read any variable in the pod. That is
# acceptable while the instance runs this estate's own agents and nothing
# else; it stops being acceptable the moment it is shared.
N8N_BLOCK_ENV_ACCESS_IN_NODE: "false"
+5
View File
@@ -72,6 +72,11 @@ spec:
envFrom: envFrom:
- configMapRef: - configMapRef:
name: n8n-config name: n8n-config
# The agents' Keycloak client secrets, reached from a workflow as
# `$env.APPROVISIONNEMENT_CLIENT_SECRET`. A workflow acts as its
# agent, so it is the workflow that must be able to exchange tokens.
- secretRef:
name: n8n-agent-secrets
volumeMounts: volumeMounts:
- name: data - name: data
mountPath: /home/node/.n8n mountPath: /home/node/.n8n