Detect PII
The Detect PII block scans a text input for personally identifiable information using Microsoft Presidio.
Scan text for personally identifiable information
The Detect PII block scans a text input for personally identifiable information using Microsoft Presidio. You provide the text to scan, a language code (such as "en" for English), and a list of entity types to look for — for example, PHONE_NUMBER, EMAIL_ADDRESS, or PERSON. If the entities list is left empty, the block returns immediately with no detections, so at least one entity type must be specified for scanning to occur.
The block returns a detected boolean indicating whether any PII was found, along with a detections array. Each item in that array includes the entity type, the start and end character indices of the match within the input text, and a confidence score between 0 and 1. You can also configure an optional output variable to store the raw detection results for use later in the workflow.
In a workflow context, the block supports conditional branching: you can specify one step to transition to if PII is detected and a different step if it is not, making it straightforward to build flows that handle sensitive data differently based on what is found. This makes it useful in content moderation pipelines, data validation steps before storage or transmission, and compliance-oriented workflows that need to flag or redact user-submitted text.
What you can build
Real-world workflows powered by the Detect PII block.
User Input Validation
Before storing user-submitted form data, route it through the Detect PII block to check for sensitive information like phone numbers or email addresses and branch accordingly.
Support Ticket Screening
Scan incoming customer support messages for PII before logging them to a third-party system, ensuring only clean text is forwarded.
Document Compliance Checks
Run uploaded document text through the block to detect personal identifiers and flag documents that require review before processing.
Chat Message Moderation
Intercept chat messages in real time and redirect the workflow to a redaction or warning step whenever personal information is detected.
Data Pipeline Gating
Use the block as a gate in a data pipeline to prevent records containing PII from being passed to downstream analytics or reporting steps.
Audit Log Generation
Store the raw detection results — including entity types, character positions, and confidence scores — into a log variable for compliance auditing purposes.
Ready to add Detect PII to your workflow?
Get Started FreeCommon questions about Detect PII
What parameters are required to use this block?
The block requires three inputs: the text to scan (input), a language code such as "en" (language), and a list of entity types to scan for (entities). If the entities array is empty, the block returns immediately with no detections, so at least one entity type must be provided for any scanning to take place.
What does the block return?
The block returns an object with a detected boolean (true if any PII was found) and a detections array. Each detection includes the entity_type (e.g., PHONE_NUMBER, EMAIL_ADDRESS, PERSON), the start and end character indices of the match in the input text, and a confidence score between 0 and 1.
How does conditional branching work with this block?
In workflow mode, you can configure two transition targets: detectedStepId, which the workflow moves to if PII is found, and notDetectedStepId, which it moves to if no PII is detected. This allows you to build separate handling paths based on the detection outcome.
Which PII entity types can be detected?
The entities field accepts an array of PII type strings such as PHONE_NUMBER, EMAIL_ADDRESS, and PERSON. The available entity types are determined by Microsoft Presidio, which powers the detection engine.
Can I access the raw detection results later in the workflow?
Yes. You can specify an optional outputLogVariable to store the raw detection results as a workflow variable, which can then be referenced in subsequent steps for logging, redaction, or further processing.
Related capabilities
Redact PII
Replace personally identifiable information in text with placeholders using Microsoft Presidio.
Authorize Payment
In managed payment mode, create a payment authorization. All billing events after the authorization and under the total cap will be billed to the user.
Capture Payment
Capture the currently-authorized payment
Add Detect PII to your workflow
Build powerful AI workflows with drag-and-drop blocks. No coding required.