Redact PII with n8n
n8n workflows often route customer text straight into an AI node. Insert an HTTP Request node before that step and the model receives labels instead of personal data.
Code
{
"method": "POST",
"url": "https://api.bitbanger.in/v1/redact",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"sendHeaders": true,
"headerParameters": {
"parameters": [{ "name": "X-API-Key", "value": "{{ $credentials.redactlyApiKey }}" }]
},
"sendBody": true,
"specifyBody": "json",
"jsonBody": "={{ JSON.stringify({ text: $json.body, style: 'replace' }) }}",
"options": {}
}
Notes
- Create a Header Auth credential holding X-API-Key, then reference it from the node instead of pasting the key.
- Feed $json.redacted into the downstream AI node rather than $json.body.
- The node returns entities as well, so you can branch on whether anything was found.