Apache NiFi data provenance and lineage

Apache NiFi provenance records what happened to each FlowFile, from receipt through routing to delivery or drop. This page covers how to configure, size, secure and verify it, and what it can and cannot show auditors.

On this page

How Apache NiFi data provenance and lineage answers where a record went

Apache NiFi provenance records an event for each FlowFile at each step it passes through, and the lineage view and replay features are built on those events. When a data team must explain where a record came from, what changed it, where it was delivered, or why it was dropped, the provenance events are the evidence. Teams usually need this in three situations: debugging a delivery that failed or arrived incomplete, answering an audit question about who handled a dataset and when, and resolving a dispute with a downstream owner over whether data was sent at all.

The depth of those answers depends on the provenance repository. How long events remain available, and how much disk and memory the repository can use before older events are removed, decide how far back a team can trace a record. The retention window is a sizing decision, not a default, so it should be set from the questions the business will actually ask and from the expected event volume of each flow. The NiFi administration guide documents the provenance repository settings, including the properties that control retention and storage, and the values should be confirmed for each environment before production traffic starts.

Before relying on provenance for audit or replay, ask the team to confirm three things in their own environment: the configured retention limits, the storage volume and its monitoring, and the access policies that decide which users can view event content. Test a sample record end to end, from ingest through delivery and a deliberate failure, and check that the events and content are still present at the retention point the business expects. Treat that test as the baseline for later changes, because a flow change, a cluster change or a storage change can shorten the period you can actually explain.

What a provenance event records for each FlowFile

NiFi writes a provenance event each time a FlowFile is created, changed, routed, sent or removed. The cards below cover the event types that matter most for tracing data and the fields each event carries, so you can judge what the record can and cannot support.

Receive and create events

Receive events record data entering the flow from an external source, and create events record data generated inside NiFi. Each event carries the component that produced it, a timestamp, the FlowFile attributes at that point, and a reference to the content claim. Check that the receiving processor and its transit URI are captured, because these fields are often the first answer an auditor asks for when tracing a file back to its origin.

Route, fork and join events

Routing decisions, forks that split one FlowFile into several, and joins that merge several into one show how data moved through the flow graph. Fork and join events link parent and child FlowFiles, which lets you follow a record through splits and merges. Test a representative flow with these branches before relying on lineage to explain how a single input reached each output.

Send and drop events

Send events show delivery to an external system, and drop events show data removed from the flow, such as expired or discarded FlowFiles. A send event records that NiFi handed data to a destination, not that the destination accepted or processed it, so confirm the downstream acknowledgment path in your design. Drop events need the same scrutiny because they are the record of data leaving the flow without delivery.

Attribute and content claim references

Each event stores the FlowFile attributes and a pointer to the content claim rather than a full copy of the payload. Whether the content is still retrievable depends on the content repository and on how long the underlying claim is kept. Confirm which attributes your flow records and how content claims are retained, so you know what replay and inspection can actually reach.

What the record does not prove

Provenance shows metadata and references, not proof of integrity. An event does not by itself show that content was unchanged. Integrity claims depend on how the flow was designed, such as whether checksums or hashing steps are present, and on retention settings that keep the evidence available. Treat the event trail as one input to an integrity argument, and document the design controls that support it.

Confirm fields for your version

Event type names, field sets and the behavior of each event can change between NiFi releases, and 1.x and 2.x differ in several areas covered by the migration guidance. Before you write control descriptions or build reports, confirm the exact event types and fields in the NiFi System Administrator's Guide for the version you run. Record that check in your change records so the evidence matches the release in production.

Provenance configuration options and when each fits

This table compares the main provenance settings: repository implementation, retention, indexed attributes and content claim retention. Read each row as a trade-off between searchability, disk use, replay depth and audit coverage, then confirm property names and defaults in the administration guide for your NiFi version.

SettingOptionTrade-offWhen it fits
Repository implementationPersistent provenance repository (default write-ahead implementation)Events are stored on disk and searchable across restarts, but storage and indexing consume disk and I/OMost production flows where auditors or operators need to query past events
Repository implementationVolatile provenance repositoryEvents are held in memory and lost on restart, which limits both disk use and audit coverageDevelopment, testing, or flows where provenance is not an audit record
Storage locationDedicated disk or volume for provenanceIsolates provenance I/O from FlowFile and content repositories, which keeps throughput steadierHigh-volume clusters where provenance writes compete with content writes
Storage locationShared disk with other NiFi repositoriesSimpler to provision but provenance growth can fill the disk that content and FlowFile repositories needSmall or low-volume installs with disk monitoring in place
Retention by ageShort maximum ageLess disk used and faster searches, but older events cannot support later audit or investigationOperational troubleshooting where audit evidence lives in a downstream system
Retention by ageLonger maximum ageBetter audit and investigation coverage, at the cost of more disk and larger search indexesRegulated flows where your retention policy requires events to be available for a defined period
Retention by sizeSize cap on the repositoryProtects disk from runaway growth, but the oldest events are removed first, which can cut audit coverage earlyEnvironments where disk is fixed and you accept shorter history
Indexed attributesFew indexed attributesSmaller indexes and faster writes, but searches by other attributes may be slow or unavailableFlows with a small set of known search keys such as a file identifier or source
Indexed attributesMany indexed attributesFaster investigations across business keys, with higher index size and write costFlows where analysts search by customer, account or record identifiers
Content claim retentionKeep content for replayEnables replay of failed data, but content claims consume content repository disk for as long as they are referencedFlows where failed records must be reprocessed after a fix
Content claim retentionMetadata-only provenanceLower disk use and fewer sensitive data copies, but failed data cannot be replayed from NiFiFlows handling sensitive data that must be re-sourced from the origin system

Which provenance pattern fits which question

Operations leads usually arrive here after a downstream system reports a missing order, a duplicate, or a record that never landed. The first question is whether NiFi received the data, where it went, and whether it was dropped, routed to a failure path, or is still queued. Provenance answers this by showing the event history of individual FlowFiles, so the investigation starts from a known identifier rather than from log files on every node.

  • Search by attribute: Query provenance events by component, event type, time window, or a FlowFile attribute such as an order or customer identifier. This only works if the flow sets that attribute early, for example with UpdateAttribute or an extraction processor.
  • Follow the lineage graph: Open the lineage view for a FlowFile to see its parent and child FlowFiles after splits, merges, and content changes. Confirm which processor emitted a DROP or ROUTE event before assuming a fault in the destination.
  • Check failure relationships: Records that reached a failure or retry relationship show that path in their events. Flows that auto-terminate failure relationships without a retry or dead-letter path leave little trace beyond the drop event.
  • Compare input and output content: Where content claims were kept, the event view shows the content before and after a transformation. Confirm the repository retained that content for the time window in question.

Before relying on this pattern, confirm that identifiers are assigned in the flow and that failure branches are named and connected. Ask your platform team whether provenance retention covers the period you need to investigate.

How to set up provenance and verify it end to end

This sequence turns provenance from a default setting into a tested control: retention is agreed with the data owner, storage is sized for the repository, and a known set of test records proves that lineage and replay show what auditors and operators need. The exact steps depend on your cluster topology and deployment method, so confirm the details against your own environment before you change production settings.

  1. Agree retention and visibility requirements

    Before any setting changes, the data owner and the compliance lead agree how long provenance events must be kept, which flows and data classes they cover, and who may search lineage or request a replay. The platform team records these answers in writing, because the retention window becomes the basis for storage sizing and for what you can show an auditor later. Confirm with your compliance lead whether provenance event content, not just metadata, is in scope, since that changes what sensitive data may appear in the repository. Done means a signed requirements note exists that names the retention period, the covered flows and the roles allowed to view or replay data.

  2. Place and size the provenance repository

    The platform team places the provenance repository on storage that matches the agreed retention and the expected event volume, and keeps it on a separate volume from the FlowFile, content and database repositories so that provenance growth cannot fill the others. Set up disk usage alerts on that volume before the first production flow runs. Check the repository location on each node, confirm the volume has the free space and I/O the sizing exercise calls for, and verify that every cluster node uses the same intended configuration. Sizing guidance and the relevant nifi.properties keys are in the NiFi administration guide, so confirm the current keys for your version there. Done means each node reports the expected repository path and an alert fires in a test condition.

  3. Set retention and indexing in nifi.properties

    The administrator sets the provenance retention and indexing options in nifi.properties on every node, using the values from the requirements note. Retention is applied by time and by size, so set both limits deliberately and decide which one reaches its threshold first. Indexed fields determine which attributes you can search later, so include the attributes that your investigators will actually filter on, and review the indexing cost against the storage plan. Apply the change through your normal configuration process, restart in the order your cluster procedure requires, and record the values in version control. Done means the running configuration reports the intended retention and indexed fields on every node, not only on the node you edited first.

  4. Build a test flow with known outcomes

    Build a small test process group that sends known input through three paths: a success path that reaches a final destination, a failure path that routes to a failure relationship, and a drop path that ends in a deliberate drop or expiration. Give each test FlowFile a unique identifier attribute so you can find it in provenance without guessing. Include at least one record that passes through a processor which modifies content or attributes, so the lineage shows a transformation step. Run the flow on a single known node first, then on the cluster if it runs in production that way. Done means you have a written list of test identifiers with their expected final outcome for each path.

  5. Confirm lineage events for each test record

    Open the provenance search and find each test identifier, then open its lineage graph and compare it against your expected list. Confirm that the receive event, each transformation, the routing decision and the final send, failure or drop event all appear, in the correct order, with the expected node and timestamp. For the drop path, confirm the event records the reason the record left the flow. Check that the attributes you indexed are searchable and that unindexed attributes are not expected to be. Done means every test record matches its expected lineage, and any mismatch has a documented cause and fix before the next step.

  6. Verify replay of a failed record

    Select a test record that ended on the failure path and replay it into the processor that failed, after correcting the simulated fault in the test flow. Confirm the replay creates a new lineage branch linked to the original event, that the replayed record reaches the expected destination, and that the original failure event remains visible in the history. Confirm that the user account used for the replay is recorded, because that record is what an auditor will ask for. Replay also depends on the content still being present in the content repository, so check that the content of the test record is still available. Done means the replayed record completes its expected path and the audit trail shows who replayed it and when.

  7. Prove retention and access controls work

    Test that the retention window is applied in practice by checking whether events older than the agreed period are removed, using an isolated test environment if you cannot wait the full window in production. Confirm that users without the agreed roles cannot view provenance content, lineage or replay for the flows in scope, and that the cluster behaves the same for a user whose request reaches any node. Record the results and the configuration version that produced them, then hand the evidence to the compliance lead. Ask your compliance team which of these checks they need in written form and which they will accept from the test log. Done means a dated test record shows retention, access and replay behaved as the requirements note specified.

Sizing and retaining the provenance repository

The provenance repository grows with every event NiFi records, so size it from measured event volume rather than from assumptions about throughput. Each FlowFile that passes through a processor typically produces provenance events such as RECEIVE, ROUTE, MODIFY, SEND or DROP, so growth depends on the number of FlowFiles, the number of processors each one crosses, the size of the attributes recorded on each event, and how long you keep the data. Longer paths and larger attribute maps multiply the storage cost of every FlowFile. Run a representative test with production-like data, flow shape and daily volume, then measure how much disk the provenance repository consumes over a known period. Extrapolate from that measurement to your retention target, and repeat the test after any change to the flow, such as adding a split or a merge stage that multiplies events.

Retention in NiFi is governed by properties in nifi.properties that set a maximum age and a maximum storage size for the provenance repository. When either limit is reached, NiFi removes the oldest events first, so the size cap can shorten your audit window without any warning in the flow itself. Decide which limit is authoritative for your audit obligations, and document the earliest date you can still answer a provenance query. Confirm the exact property names, default values and the way the two limits interact in the System Administrator's Guide for your NiFi version, and verify the behavior in your own test environment by filling the repository to its limit and checking which events remain.

A provenance repository that fills its disk is a production risk, not just a reporting gap, because NiFi needs free space on the same volume for its other repositories and for logs. Place the provenance repository on storage sized for the measured growth and monitor its disk usage with the same alerting you use for the content and FlowFile repositories. Set an alert well before the volume is full, and include the time needed to act in that margin. Record in your runbook which team owns the response, how retention can be shortened safely, and how you will show an auditor that the audit window was met for the period in question.

Securing provenance data and access

Provenance events record where data came from, what happened to it and where it went, and they can expose attribute values and content to anyone allowed to query them. The cards below cover who can see that data, what sensitive values can end up in it, how authorization and storage protect it, how retention limits exposure, and how administrative access is recorded.

Who can view provenance

Provenance viewing is controlled by NiFi authorization policies, separate from the ability to edit a flow. A user who can query provenance may see FlowFile attributes and, where content viewing is permitted, the content itself. Map each identity provider group to explicit provenance and data policies before onboarding operators. Confirm how your chosen provider (single-user, LDAP, OpenID Connect, SAML 2.0 or X.509 client certificates, per the administration guide) passes group or role claims into NiFi, because a mapping error can grant broader provenance access than intended.

Sensitive data in attributes and content

Attributes are recorded in provenance even when the content is not viewable, so a value such as a national ID, account number or token placed in an attribute by an UpdateAttribute step ends up in the repository. Review which processors write attributes from record fields, and keep secrets out of attribute names and values. Content is captured at each step as well, so a flow that handles personal data needs a decision on whether content should be stored at all, or only referenced, before it runs against production data.

Authorization for provenance and data

NiFi separates permissions for viewing provenance events, viewing data in content, and modifying data at a given component. Grant the narrowest set that supports the job, and record which team owns each process group. Test the policies with a non-administrator account that matches a real operator role, since administrators can see more than most operators. Confirm in your own environment that a read of provenance data is also logged when a user views content, because auditors will ask for that trail.

Protecting repository storage and backups

The provenance repository holds event records and, depending on settings, copies of content, so it needs the same protection as the data it describes. Restrict filesystem permissions on the repository directories to the NiFi service account, encrypt the volumes or backups where your policy requires it, and keep backup copies under the same access controls as the live repository. Include provenance directories in restore tests so that a recovered node does not expose data to a wider audience than the original.

Retention as data minimization

Provenance retention is a data minimization control as well as a storage setting. Shorter retention reduces how much personal data remains available to query and how long a breach would expose it, but it also shortens the window for tracing and replaying failed data. Set a retention period with your data protection and audit owners, then document it as the value for your records. Confirm which retention settings your NiFi version exposes and how deletion happens when the repository reaches its size limits.

Logging administrative access to provenance

Changes to authorization policies, provenance settings and repository configuration should leave an audit trail that is kept apart from the data itself. Review the NiFi application and user logs and decide where they are shipped, who can alter them, and how long they are kept. Log entries should show who queried provenance, who viewed content and who changed policies. Confirm the log format and retention with your team, and check that the logs cannot be edited by the same operators whose actions they record.

Questions buyers ask about provenance and audit work

What can NiFi provenance prove to an auditor, and what can it not prove?

Provenance records what NiFi did to each FlowFile: when it was received, which processor touched it, what attributes changed, where it was sent, and whether it was delivered, routed or dropped. That is useful evidence of how data moved through a flow. It does not prove the data was accurate, that the source system was authoritative, or that people followed the process around the flow. Provenance also depends on the repository being retained long enough and on the flow being designed so that every hop is recorded. Auditors will usually test those surrounding controls too: who could change the flow, how changes were approved, and whether logs were protected. Ask your auditor which evidence they expect before the build starts, and confirm the scope in writing with whoever delivers the work.

How long can data be traced in NiFi provenance?

Traceability lasts as long as the provenance repository keeps the events, and that is set by retention rules you configure, not by NiFi defaults you can assume. Older events are removed when the configured time or storage limit is reached, so a trace for data received months ago may no longer exist. The retention period should match your regulatory and investigation needs, and it has to be balanced against disk capacity and the cost of storing the events. Confirm the retention requirement with your compliance lead, then ask the implementer to size the repository and document the retention settings, the storage location and the procedure for archiving or exporting events if you need a longer record.

Does provenance replay work for every failure?

No. Replay works only when the content is still available and the flow can safely send it again. If the content claim has been removed by retention or the original data was never persisted, there is nothing to replay. Replaying a record that already reached a destination can also create duplicates unless the target system is idempotent or the flow checks for duplicates. Some failures, such as a rejected schema or a bad source value, need a flow fix before replay makes sense. Plan replay per failure type: which failures are retried automatically, which go to a failure queue, which can be replayed by an operator, and who approves a replay that writes to a production system.

What does the work need from our own team?

Expect to supply several roles: a business owner who defines which data events must be traceable, a security or compliance contact who defines evidence requirements, platform engineers who run the NiFi hosts and storage, and a flow owner who understands the data. Provenance also needs decisions about where the repository lives, how long it is kept, who can query it, and how exports are protected. Most of that input is needed early, during scope definition, and then again for review and acceptance. Ask the delivery partner for a written list of the decisions and approvals they need from you, with named roles and the points in the schedule where each is required.

Can our own engineers configure and operate provenance after handover?

Often yes, if the handover includes the right material. Provenance settings, repository sizing, retention rules and query habits are learnable by platform engineers who already run NiFi. The harder part is judgment: deciding what to record, how to replay safely, and how to explain a gap in the trail to an auditor. For that reason, the handover should include a runbook for common investigations, the configuration files and their change process, dashboards or alerts for repository growth, and a short training session with recorded walkthroughs. Ask for these deliverables to be named in the written scope so the transfer is verified rather than assumed.

What drives the effort and cost of a provenance implementation?

The main drivers are the number of flows and processors that must be traced, the volume and size of FlowFiles, the retention period, the storage platform, the number of systems that consume the evidence, and how much review your auditors expect. Replay requirements add design work, especially where destinations are not idempotent. Integration with existing logging or SIEM tools adds further effort. Costs fall into one-time items such as design, build, testing and documentation, and recurring items such as storage growth, monitoring and periodic evidence reviews. When you request a quote, ask for each cost item separately, the assumptions behind the volume and retention figures, and what changes if those assumptions change.

Does DeployOpen certify that our NiFi provenance meets audit requirements?

No. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies perform those assessments. In practice, the work covers configuring provenance, documenting the flows and retention settings, preparing the evidence an auditor will ask for, and testing that trace and replay behave as documented. Your auditor decides whether the evidence is sufficient. Agree that division of responsibility in writing before work starts, so that nobody assumes the implementation includes an assessment outcome.

Limits of provenance to confirm in your environment

Provenance gives a detailed record of what NiFi did to each FlowFile, but it is only one part of an audit trail. The limits below decide whether the record will hold up for the period, systems and versions an auditor will examine, so confirm each one with vendor documentation or a test run before you rely on it.

Retention can expire early

Provenance events are kept in the provenance repository only for the period you configure, and older events are removed as the repository rolls over. If an audit window opens earlier than your retention, the events you need may already be gone. Confirm the retention settings in the NiFi administration guide, then check how many days of events your repository holds at your actual throughput. Keep the audit window and the retention setting in the same written standard.

Replay depends on retained content

Replaying a FlowFile from provenance needs the original content claim to still exist, and the destination must accept the data again. Content may be removed by content repository retention or by a deleted queue, and a destination may reject duplicates or be unavailable during the replay. Test replay on a sample of failed records in a non-production cluster, and record which records could not be replayed and why.

Lineage across clusters needs design

Provenance lineage is recorded inside the NiFi instance where the events occurred. When data moves to another NiFi cluster, a separate system, or a message broker, the trail does not continue automatically. Decide how identifiers will pass between systems, such as attributes carried in headers or records, and confirm how Site-to-Site transfers appear in each cluster's provenance. Document where each trace ends.

External system logic is not recorded

Provenance records NiFi activity, such as receive, route, transform, send and drop events on each FlowFile. It does not show how a database, SaaS API or downstream application processed the data after NiFi delivered it. Ask each receiving system owner for their own logs and acknowledgments, and confirm which NiFi event proves delivery, such as a SEND event with a transit URI, for each destination.

Behavior differs across versions

Provenance behavior and configuration can change between NiFi 1.x and 2.x and across minor releases, and the migration path changes flow files and components along the way. A trail generated on one version may not match the event types or repository layout of another. Confirm the provenance behavior in the migration guidance for your target version, and run the same test flow on both versions before you cut over.

Event fields can change

The fields in a provenance event, including event types, attribute names and component identifiers, can change between releases. A report, script or evidence query that parses events by field name may break after an upgrade or return different results. Keep a copy of the event schema for each NiFi version in use, and rerun your evidence queries after every upgrade.

How DeployOpen scopes, builds and supports NiFi provenance

DeployOpen plans, implements and documents Apache NiFi provenance inside infrastructure you control, so your team can trace FlowFiles, replay failed data and show how records were handled. Each engagement starts from the handling questions your auditors and operators need answered.

How we scope

  • Engagements are fixed-scope, with the provenance questions, flows, and retention targets agreed in writing before work starts.
  • The written scope lists which process groups emit provenance, which event types are in view, and who may query or replay data.
  • Scope records the provenance repository sizing inputs to confirm, such as expected FlowFile volume and your retention period.

How we build

  • We configure provenance repository settings and retention in your NiFi environment, then test event capture on representative flows.
  • Replay and lineage queries are validated against failure cases, including dropped FlowFiles and downstream delivery errors.
  • Access to provenance data is set through NiFi authorization policies and checked against your access model before handover.

How we hand over

  • Deliverables include the configured provenance settings, runbooks for lineage queries and replay, and documented sizing assumptions.
  • Your team receives evidence of tested traces and a description of how provenance supports the controls your auditors review.
  • We document what provenance does not capture, so your team and auditors know where other records are needed.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Retainers can cover provenance repository monitoring, retention reviews and changes when flows or NiFi versions change.
  • Support scope, response expectations and review cadence are agreed in writing before the retainer starts.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.