Documents
Redact Document
Make a copy of a document without email addresses, phone and card numbers, IBANs, other personal data, chosen words or custom patterns.
Redact Document (doc_redact) makes a redacted copy of a file; the original is not changed. It removes what the presets detect, the words and phrases you list, and matches of your own patterns, and reports how many of each it replaced.
- Word, PowerPoint and Excel files are redacted in place: the text inside the file is replaced and the formatting, layout and images are kept. The author fields in the file properties are cleared too.
- Text formats (plain text, Markdown, CSV, TSV, JSON, XML, YAML) keep their format.
- PDF, HTML and OpenDocument files are rebuilt from the redacted text: a PDF (or HTML) with the text, headings, lists and tables, but not the original layout or images. Nothing redacted is left in the file — the original text layer is gone.
Inputs
Document (source): a file object, a list (the first file), a storage:// reference, a URL, base64 content or text. See File inputs.
Options
| Setting | Key | Default | What it does |
|---|---|---|---|
| Remove | presets | none | Any of the presets below |
| Words and phrases | terms | none | Comma-separated (or a list), matched anywhere, ignoring case: Project Falcon, {{customer.company_name}} |
| Patterns | patterns | none | A list of { "pattern": "…" } regular expressions, matched line by line, ignoring case: ACC-\d{6} |
| Replace with | replacement | block | block: █ for every character (spaces kept, so the length shows); label: the kind in brackets ([EMAIL], [PHONE], [CREDIT_CARD], [IBAN], [TERM], [PATTERN]…); text: your own text |
| Replacement text | replacement_text | [REDACTED] | With replacement: "text" |
| Redacted copy | output | same | same (Word, PowerPoint, Excel and text formats keep their format; anything else becomes PDF, HTML stays HTML), pdf, html or text |
| Clear the author in the file properties | clear_author | true | Word, PowerPoint and Excel: empty the Author and Last modified by properties |
| Pages, OCR | pages, ocr, ocr_languages | all, off, eng | PDFs rebuilt from text: which pages, and OCR for scans (not shown in the designer) |
| Output file name | output_name | <source>-redacted | |
| Output variable | output_var | redacted |
At least one preset, term or pattern is required.
Presets
| Preset | presets value | Finds |
|---|---|---|
| Emails | email | Email addresses |
| Phone numbers | phone | 7–15 digits with spaces, dots, dashes, brackets or a leading + |
| Card numbers | credit_card | 13–19 digits (spaces or dashes allowed) that pass the Luhn check |
| IBANs | iban | IBANs that pass the mod-97 check |
| US SSNs | ssn | 123-45-6789 style numbers (invalid ranges excluded) |
| IP addresses | ip_address | IPv4 addresses |
| URLs | url | http and https links |
| Dates | date | ISO, numeric and written dates |
The checksums keep order numbers and other long numbers that merely look like card numbers or IBANs out of the result.
Outputs
| Variable | Contents |
|---|---|
{{redacted}} | { file, text, counts, total } |
{{redacted_file}} | The redacted copy as a file object |
{{redacted_text}} | The redacted text |
{{redacted_count}} | Number of redactions |
{
"file": { "_file": true, "name": "customer-onboarding-redacted.docx", "mime_type": "application/vnd.openxmlformats-officedocument.wordprocessingml.document", "size": 14876, "url": "…", "storage_ref": "storage://task-files/workflow-files/…", "checksum_sha256": "…" },
"text": "Customer onboarding\nOrders: Nancy Davolio <[EMAIL]>, phone [PHONE].\nAccounts: [EMAIL], [PHONE].\nCard on file: [CREDIT_CARD]\nBank account: [IBAN]",
"counts": { "email": 2, "phone": 2, "credit_card": 1, "iban": 1 },
"total": 6
}counts is keyed by preset, plus term and pattern. The run history shows the file name, redactions and counts, never the text.
On the canvas
The presets (or the number of rules) and the output variable: email, phone, credit_card, iban → redacted.
Limits
- PDFs are rebuilt from their text: the layout, fonts and images of the original are not kept (a warning says so), and the standard PDF fonts show only Latin (Windows-1252) characters — others become "?". Where the layout matters and you have the Word original, redact that (it is redacted in place) and convert the copy to PDF.
- Word, PowerPoint and Excel: the body, headers, footers, footnotes, endnotes and comments (Word), slides, notes and comments (PowerPoint), and text cells and comments (Excel) are redacted. Numbers stored as numeric Excel cells, text inside images and embedded objects, and the names of comment and tracked-change authors are not.
- Patterns match within one line. Text inside an image is only seen with OCR, and then only in the rebuilt PDF.
- Reading follows the read limits.
Pattern-based detection finds what looks like personal data; it is not a guarantee. Check a sample of redacted copies before you rely on them, and add terms (names, account numbers) the presets cannot know.
Security notes
Custom patterns go through the ReDoS guard. Redacted HTML is sanitised. The original file is not changed or moved. See Security.
Example
{
"type": "doc_redact",
"label": "Redact customer file",
"config": {
"source": "{{form.customer_file}}",
"presets": ["email", "phone", "credit_card", "iban"],
"terms": "{{customer.contact_name}}",
"patterns": [{ "pattern": "ACC-\\d{6}" }],
"replacement": "label",
"output": "same",
"clear_author": true
}
}Canvas: email, phone, credit_card, iban → redacted.
Works well with
- Extract from Document first, to keep the details you need in variables — see Extract contact details and redact a copy.
- Inspect Document with
searchon{{redacted_file}}to check that a term is gone. - Send Email with
{{redacted_file}}as an attachment, or a storage connector upload.