Document Flags let you tag documents with custom labels (called flags) based on business conditions. Flags are applied automatically during document processing: you define the conditions through rules and instructions, and the system applies the right flags to the right documents.
For example, you can set up a rule that flags every invoice over 10,000 USD as HighValue. Each invoice meeting that condition automatically receives the HighValue flag after processing. Flags can then be viewed, filtered, and exported alongside the rest of a document's data.
How It Works
Flags must exist before they can be used anywhere. You create them centrally in Settings > Flagging, which acts as the master list and single source of truth for every flag in your tenant. Once a flag exists, it can be applied to documents automatically during processing through three sources: Transformation Rules, Rejection Rules, and Instruction Builds. Rule-based sources apply flags deterministically, while instruction builds apply them through AI evaluation. When a document is reprocessed, all previously applied flags are cleared and recalculated, so flags always reflect the current state of your rules and instructions.
Creating Flags
Flags are created and managed on the Flagging settings page using + Add New. Each flag in the list shows three usage counters for the number of Transformation Rules, Rejection Rules, and Instructions that reference it; clicking a counter navigates directly to those items. For the full procedure, including naming rules and how editing or deleting behaves while a flag is in use, see the Creating and Managing Flags guide.
Applying Flags to Documents
Flags reach documents through three sources during processing:
Transformation Rules. When you create a transformation rule, the AI is given your tenant's list of active flags and can generate flag actions (Field = Flag) as part of the rule. If the AI suggests a flag that does not exist in the master list, the system shows a warning directing you to create it first. Multiple flag actions in a single rule are grouped into one row in the rule actions table and displayed as pill tags. At processing time these flag actions fire deterministically, with no AI involved: if the rule matches, the flag is applied.
Rejection Rules. You can manually add flag actions to a rejection rule. Each flag action uses Field = Flag, Action = SET, with the value entered as free text (not a dropdown). The AI can also generate flag actions when you create a rejection rule with AI. Because a rejection rule can both reject and flag, a document can be rejected and flagged at the same time. Flag values appear as pill tags in read-only view, and like transformation-rule flags they are applied deterministically at processing time.
Instruction Builds. Instruction builds have no separate flags UI; flag conditions are written inline in the instruction text (for example, "If the document source is a specific trading partner, add the PartnerReview flag"). When the instruction is saved, the system scans the text for flag-related phrases, sends the text to the AI with the active flags list, extracts the referenced flags, and matches each against the master list. If a referenced flag does not exist, the save is blocked with an error asking you to create the flag in Settings or remove it. Instruction builds are the only source where flag application involves AI at processing time: the AI evaluates each instruction against the document and decides which flags apply, drawing on both the document's structured data and its raw OCR text.
Applying Flags with CSV Keyword Matching
Transformation Rules and Rejection Rules can also apply flags in bulk by linking a CSV supporting file that holds value-to-flag mappings. Instead of writing one rule per value, you link a CSV whose columns pair the values to match with the flag values to apply, and the system flags documents deterministically at processing time for every row that matches. Flag values taken from the CSV do not need to be pre-created in Settings > Flagging. For the full procedure, see the Applying Flags with CSV Keyword Matching guide.
Viewing and Filtering Flags
Applied flags appear in a Flags column on the document list, shown as a +N badge; hovering over the badge reveals all flag names as pill tags. Documents in PROCESSING, RETRYING, FAILED, or SPLITTING status show N/A in this column. On the document detail and review page, applied flags appear as pill tags in a bordered container. A flag filter in the document list lets you narrow documents to one or more flags. For the filtering procedure, see the Filtering Documents by Flag guide.
Supported Configurations and Options
Flag Naming Rules
Rule | Detail |
No spaces | "HighValue" is valid; "High Value" is not |
Maximum length | 24 characters |
Case-sensitive | "HighValue" and "highvalue" are treated as different flags |
Editable and deletable | Flags can be renamed or deleted; deletes are soft, so history is preserved |
Permissions
Role | Flagging access |
Admin | Read and write |
Manager | Read and write |
Reviewer | Read-only |
Validator | Read-only |
Flagging is a dedicated permission group. It is not bundled with Transformation, Rejection, or Instruction permissions and must be granted separately.
Organization Scoping
Flags can be scoped to specific organizations using
org_ids.A flag with no org scope is global and visible to all.
Self-service users see global flags plus their own organization's flags.
Global admin users see all flags.
Data Export Flag Markers
Destination format XML templates can include flag markers:
<!--FLAG START--><Flag>{flag_name}</Flag><!--FLAG END-->.During export, the
{flag_name}placeholder is replaced with the actual flag names applied to the document.If a document has no flags, or the feature is disabled, the entire flag marker block is stripped from the output so no raw artifacts remain.
Other Technical Specifications
Feature Toggle
The entire feature is controlled by the
Flaggingfeature toggle.When disabled: the Flagging settings page is hidden, flag columns and filters are hidden, flag processing is skipped,
GET /flagsreturns empty, and non-GET requests return 403.
Processing Model
Transformation Rule and Rejection Rule flags fire deterministically at processing time, with no AI involved.
Instruction Build flags are evaluated by AI at processing time; this is the only source where AI is involved in applying flags. The AI uses both the document's structured data and its raw OCR text.
On reprocessing, all previously applied flags are deleted before flag application runs again, so results never carry stale data from earlier runs.
Activity Log
Flag create, rename, and delete operations are recorded in the Settings activity log alongside other auditable operations.
Example entries: "User created flag 'Fraud'" and "User renamed flag 'Tax' to 'TaxReview'".
Notes
Flag names are case-sensitive, so "HighValue" and "highvalue" are separate flags. Pick a naming convention and apply it consistently to avoid accidental duplicates.
A flag that is in use by any rule or instruction cannot be deleted, and its edit modal opens with the Update button disabled and a red warning. Remove the references first; clicking a usage counter takes you to them.
Instruction-build saves are blocked when they reference a flag that does not exist in the master list. Create the flag in Settings > Flagging first, or remove the reference before saving.
Deletes are soft, so flag history is preserved for auditability.
The Flags column and flag filter are only visible to users with Flagging read permission.
Disabling the
Flaggingfeature hides flags everywhere and skips flag processing; flag markers are also stripped from exported output.
