Redact PII
Redacts Personally Identifiable Information (PII) from text or JSON objects to ensure data privacy and compliance.
Masks or removes PII in the node input item with regular expressions: email addresses and card numbers by default, plus US-style SSN and phone patterns or your own patterns when listed in rules.
How it works
- Takes the node input item (the previous node output) as the content to redact. The
inputfield configured on the node is not used. - Serializes the item to a JSON string.
- Applies each entry of
rulesin order: a preset name (email,credit_card,ssn,phone) or, otherwise, the text compiled as a regular expression with thegflag. Invalid patterns are skipped without notice. - Replaces every match with
*repeated to the match length (strategy: "mask", the default) or with nothing ("remove"). - Parses the string back to JSON and returns it under
resultonout.
In a workflow
The node as it appears in a workflow file (draft_nodes[]), and the envelope of a successful run.
{
"node_id": "node-redact-ticket",
"label": "Redact ticket PII",
"operator_slug": "pii.redact",
"operator_version": "1.0.0",
"config": {
"input": "{{ $json }}",
"strategy": "mask",
"rules": [
"email",
"credit_card",
"phone"
]
}
}{
"ok": true,
"port": "out",
"data": {
"result": {
"customer": "Jane",
"email": "****************",
"card": "*******************",
"note": "call ************"
}
}
}Configuration
-
inputobject Required -
Text or JSON Object to redact
-
strategystring Optional -
rulesarray Optional -
Regex or Predefined Types
Behaviour in the code
What the implementation does with these keys beyond what the schema says.
-
input - Ignored: the runtime replaces it with the node input item. To redact only part of the data, shape the item first with a previous node such as
data.transform. -
rules - Default
["email", "credit_card"]:ssnandphoneapply only when listed. Presets:email([email protected]),credit_card(16 digits in four groups of four, optionally separated by-or a space),ssn(123-45-6789),phone(10 digits as555-123-4567,555.123.4567or5551234567; no country code, parentheses or spaces). Patterns check format only, with no checksum. Custom patterns are case-sensitive and run over the serialized JSON, so they also match object keys. -
strategy - Any value other than
removemasks. Masking keeps the original length;removeleaves an empty string in place of the match.
Output ports
out default The item was redacted and parsed back.
{
"result": {
"customer": "Jane",
"email": "****************",
"card": "*******************",
"note": "call 555-123-4567"
}
}error rules is not an array, or a replacement broke the serialized JSON.
{
"error": "rules.forEach is not a function"
}In expressions
What a later node can read from this node's output with $("Redact PII").item.json.<path> (write your node's label instead of Redact PII). Editor marks the paths the workflow editor suggests under Previous Nodes (the output contract); Worker marks the paths the worker really returns through out, from the output shown in Ports.
| Expression | Editor | Worker |
|---|---|---|
$("Redact PII").item.json.resultRedacted content | ||
$("Redact PII").item.json.result.customer | — | |
$("Redact PII").item.json.result.email | — | |
$("Redact PII").item.json.result.card | — | |
$("Redact PII").item.json.result.note | — |
— Worker: The worker returns it but the editor does not suggest it: write it by hand. Keys inside objects can depend on your data or configuration (for example one key per label).
Errors
| Message | Port | Cause and fix |
|---|---|---|
rules.forEach is not a function | error | rules is a string or an object. Pass an array, for example ["email", "phone"]. |
Unexpected token '*', "<serialized item>" is not valid JSON | error | A pattern matched a JSON number (for example a phone stored as 5551234567) or JSON syntax (quotes, braces, colons), so the text no longer parses. Store such values as strings or anchor custom patterns to value content. The message includes a fragment of the serialized item. |
Input contract
-
inputobject Required -
strategystring Optional -
rulesarray Optional
Output contract
-
resultobject Optional -
Redacted content
Contracts (JSON Schema)
The definition exactly as the orchestrator declares it. All is the whole *.definition.js; compare it with the sections above to spot differences between the documentation and the schema. Use it to validate a node before you publish.
{
"slug": "pii.redact",
"name": "Redact PII",
"category": "identity",
"version": "1.0.0",
"description": "Redacts Personally Identifiable Information (PII) from text or JSON objects to ensure data privacy and compliance.",
"capabilities": [
"privacy",
"dlp"
],
"config_schema": {
"type": "object",
"properties": {
"input": {
"type": "object",
"description": "Text or JSON Object to redact"
},
"strategy": {
"type": "string",
"enum": [
"mask",
"remove"
],
"default": "mask"
},
"rules": {
"type": "array",
"default": [
"email",
"credit_card"
],
"description": "Regex or Predefined Types"
}
},
"required": [
"input"
]
},
"input_contract_schema": {
"type": "object",
"properties": {
"input": {
"type": "object"
},
"strategy": {
"type": "string"
},
"rules": {
"type": "array"
}
},
"required": [
"input"
]
},
"output_contract_schema": {
"type": "object",
"properties": {
"result": {
"type": "object",
"description": "Redacted content"
}
}
},
"ports": [
{
"port_id": "out",
"label": "Redacted",
"description": "Clean data",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Processing failed",
"is_default": false,
"supports_condition": false
}
],
"execution_mode": "sync",
"required_resources": [],
"compatible_worker_pools": [
"standard"
],
"tags": [
"pii",
"compliance"
],
"is_stateful": false,
"publisher": {
"identity": "org_veripass",
"profile": {
"name": "Veripass",
"verified": true,
"url": "https://me.veripass.com/veripass",
"logo_url": null
}
}
}{
"type": "object",
"properties": {
"input": {
"type": "object",
"description": "Text or JSON Object to redact"
},
"strategy": {
"type": "string",
"enum": [
"mask",
"remove"
],
"default": "mask"
},
"rules": {
"type": "array",
"default": [
"email",
"credit_card"
],
"description": "Regex or Predefined Types"
}
},
"required": [
"input"
]
}{
"type": "object",
"properties": {
"input": {
"type": "object"
},
"strategy": {
"type": "string"
},
"rules": {
"type": "array"
}
},
"required": [
"input"
]
}{
"type": "object",
"properties": {
"result": {
"type": "object",
"description": "Redacted content"
}
}
}[
{
"port_id": "out",
"label": "Redacted",
"description": "Clean data",
"is_default": true,
"supports_condition": true
},
{
"port_id": "error",
"label": "Error",
"description": "Processing failed",
"is_default": false,
"supports_condition": false
}
]Execution
- Execution
sync- Stateful
- No
- Capabilities
privacydlp- Tags
piicompliance
Notes and limits
- Only the listed patterns are redacted: names, addresses, national ids in other formats and 15-digit card numbers pass through unchanged.
- Leaving through
errordoes not fail the run: the engine follows the edges wired toerror, and if there are none the branch simply ends.
Reviewed against the orchestrator code · 31e874b · 2026-11-26