Load-balanced connections in a NiFi cluster

Load-balanced connections move FlowFiles between nodes after a primary-node source so work spreads across the cluster. This page covers the strategies, compression, disconnect behavior and how to verify the setup.

On this page

When a NiFi cluster needs load-balanced connections

In a clustered NiFi, a source such as ListSFTP or ListSmb runs on the primary node only, so every FlowFile it emits starts on one node while the other nodes sit idle. A load-balanced connection sits between that source and the downstream processors and distributes FlowFiles across the cluster. Teams need it when one node is doing all the ingest work, when a single node's CPU, heap or content repository becomes the bottleneck, or when downstream processing is slow enough that adding nodes only helps if the data actually reaches them. You configure it on the connection itself, choosing a strategy that fits the flow.

The feature is part of Apache NiFi, which is released under the Apache License 2.0 (SPDX: Apache-2.0). The Apache project does not offer a paid edition, so there is no license fee for load balancing. The configuration itself is documented in the Apache NiFi System Administrator's Guide, which covers cluster behavior and the settings you will need to review before turning the feature on. Any cost you incur comes from the infrastructure, the engineering time to design and test the flow, and the operations work to keep the cluster healthy.

Before you add a load-balanced connection, confirm three things in your own environment: which processors in the flow are primary-node only, whether downstream processing is stateless enough to run on any node, and whether the cluster's network can carry the traffic between nodes at your data rate. The NiFi flow analysis rules can flag a primary-node source that lacks a load-balanced connection after it, which is a useful check during design. Choosing a strategy is the next decision, and the sections that follow cover round robin, partition by attribute and single node, along with compression and disconnect behavior.

Load-balance strategies and when each fits

This table compares the load-balance strategies and the compression option on a cluster connection, showing what each one distributes and when it fits. Read each row against your flow's need for even spread, related FlowFiles kept together, or processing at one node. Confirm exact option names and labels in the NiFi System Administrator's Guide for your version before you configure them.

StrategyWhat it distributesWhen it fitsTrade-off
Round robinFlowFiles dealt in turn across all connected nodesEven spread of independent work, such as parallel transforms or API callsNo attribute-based grouping, and ordering across nodes is not preserved
Partition by attributeFlowFiles grouped by the hash of a chosen attribute value, so equal values reach the same nodeKeeping related FlowFiles together, such as all records for one customer or keyHot partitions if one attribute value dominates the traffic
Single nodeAll FlowFiles sent to one node in the clusterWork that must run at one node, or where ordering at one point is easiest to reason aboutConcentrates network and processing load on one node and removes spread
Do not load balanceFlowFiles stay on the node that produced themLocal processing where moving data between nodes adds no valueWork stays on one node, so downstream steps may not use the whole cluster
CompressionOptional compression of FlowFile attributes and content as they cross nodesLarge content or constrained network links between nodesUses CPU on both sides of the transfer, so measure throughput before and after

How to configure load balancing on a connection

This sequence turns a primary-node source into a load-balanced hand-off, so FlowFiles spread across the cluster's nodes after the source runs. Each step ends with a check in the NiFi UI, so you can confirm the balancing works before the flow carries production data.

  1. Confirm the cluster and Java runtime

    The cluster administrator confirms that every node runs Java 21, the minimum runtime listed in the NiFi System Administrator's Guide, and that each node shows as connected in the cluster view. Mixed or unsupported runtimes cause nodes to fail to join, so resolve this before changing any flow. Done when all nodes report connected and the Java version on each node matches the documented minimum.

  2. Identify the primary-node source

    The flow engineer locates the processor that runs on the primary node only, such as a list processor that keeps state about remote files. The connection leaving that processor is the one to load balance. Check the processor's scheduling settings to confirm it is set to run on the primary node, and confirm the downstream processor is the next step you intend to spread across nodes.

  3. Open the connection configuration

    The flow engineer right-clicks the connection between the primary-node source and the next processor, then opens its configuration dialog. Locate the load balancing section in the settings for your NiFi version, since the exact tab and labels can differ between releases. Check that the dialog opens against the correct connection and that the source and destination names match your design.

  4. Choose the load balance strategy

    The flow engineer selects a strategy based on the work. Round robin distributes FlowFiles evenly across nodes and suits stateless processing. Partition by attribute keeps FlowFiles with the same attribute value on the same node, which helps when related records must stay together. Single node sends everything to one node, which fits steps that need one destination. Check that the chosen strategy is shown in the connection summary before you apply it.

  5. Set compression for the transfer

    If FlowFiles cross the network in volume, the flow engineer sets load balance compression to match the payload, either compressing attributes only or attributes and content. Compression reduces network traffic but adds CPU work on each node, so test the effect with representative data. Ask your team to confirm the trade-off against your network and hardware before production. Check that the compression setting appears as chosen in the configuration dialog.

  6. Apply the change and start the flow

    The flow engineer applies the connection settings and starts the source and downstream processors. The change is live once the flow is saved and running across the cluster. Watch the queue counts on the connection and the cluster connection summary, which should show queued FlowFiles moving from the node that received them to other nodes. If all queued FlowFiles stay on one node, recheck the strategy and the cluster state before continuing.

  7. Verify behavior when a node disconnects

    Before production use, the operations team tests what happens when a node disconnects during a load-balanced transfer, using a non-production cluster. Record how queued FlowFiles on the disconnected node are handled, how the remaining nodes take over the work, and what the cluster connection summary shows during and after recovery. Confirm the exact behavior for your NiFi version in the administration documentation. Done when the test results are documented and the team accepts the recovery steps.

Choosing a strategy by flow type

Start here when the downstream system depends on sequence, such as status updates for one account, ledger entries or change events that must be applied in the order they were produced. Round robin spreads consecutive FlowFiles across nodes, so two records that arrive one after another can be processed and delivered by different nodes at different speeds. Single node keeps the queue on one node and is easier to reason about, but that node becomes the throughput ceiling for the connection.

  • Round robin removes ordering: once records hop between nodes, nothing guarantees they reach the destination in arrival order.
  • Single node keeps sequence visible: all FlowFiles pass through one node's queue, so prioritizers and expiration behave the way a single-node test shows.
  • Concurrent tasks can reorder: a processor with more than one concurrent task can reorder FlowFiles even when the connection preserves order, so review the concurrency setting on each step.
  • Retries break order: FlowFiles routed back for a later attempt land behind newer records.

Before production, replay a batch with a deliberately slow destination and a forced node disconnect, then compare the output sequence with the source sequence.

What happens when a node disconnects mid-flow

A load-balanced connection spreads FlowFiles across every connected node, so a node that drops out changes where data goes and what is waiting for it. The risks below are the ones to map before a production flow depends on the connection, and each one should be checked in a test cluster against the version you run.

FlowFiles queued for a disconnected node

FlowFiles already assigned to a node stay in that node's local queue while it is disconnected. They do not move on their own, so the data is delayed until the node rejoins or is removed from the cluster. Ask how your NiFi version handles FlowFiles queued on a node that is gone for good, and confirm the recovery steps in the administration guide before you rely on the queue for timely delivery.

Redistribution after reconnection

When a node rejoins, new FlowFiles are balanced across the connected nodes again, but FlowFiles already queued elsewhere are not automatically reshuffled. Expect uneven queue depths after a reconnect, and check whether the load on the rejoined node recovers within your expected processing window. Measure queue distribution during a planned disconnect in the test cluster.

Ordering loss

Round robin and partition strategies do not preserve arrival order across nodes, and a disconnect moves more work onto fewer nodes. If downstream systems need strict sequence, a disconnect can reorder records that were previously in sequence. Confirm which prioritizers and keys your flow uses, and test whether consumers can tolerate out-of-order records during a failover.

Duplicate handling

Retries after a timeout or an unacknowledged send can deliver the same content more than once. A reconnect is a common trigger for this, particularly when a node was processing a FlowFile at the moment it dropped. Identify where duplicates can enter the flow, decide whether the destination is idempotent, and test with a deliberately interrupted node to see what reaches the target.

Back pressure building upstream

A node that stops accepting data causes its share of the connection to queue, and the queue grows until the back pressure thresholds on the connection are reached. Upstream processors then stop being scheduled. Review the object and size thresholds on the load-balanced connections, and confirm how quickly upstream sources stop and whether the content repository has room to absorb the backlog.

Designing for retries

Because delivery across a disconnect is not a guarantee of exactly-once behavior, the flow needs its own retry and error paths. Route failed transfers to a failure relationship, use bounded retries with penalties, and keep an error queue that operators can replay. Document the retry policy and confirm each step against the NiFi documentation and your own failure tests.

Questions teams ask before load balancing a NiFi cluster

What does load balancing a NiFi cluster cost, and who gets paid for what?

The cost comes from the engagement scope, which is agreed in writing before work starts, so the quote follows from the defined work rather than a standard rate. Most of the spend goes to design time: deciding which connections need a load-balanced strategy, choosing between round robin, partition by attribute and single node, and testing how the flow behaves when a node leaves. Your own staff are paid for their time on access, test data, and review. The one-time work is the design and the first configuration. Recurring costs come from the infrastructure you already run, such as the extra network traffic between nodes and any added CPU for compression. Ask any vendor for a quote that lists these items separately.

How long does a load-balancing setup take, and what drives the duration?

Duration depends mostly on how many connections need changes and how much of the flow must be tested under load. A small flow with one primary-node source and a single downstream path is simpler than a cluster with many process groups, custom processors or strict attribute partitioning. Other drivers include how many environments you need (development, test and production), whether the cluster already runs healthy, and how quickly your owners can review results. No standard duration applies, so ask for a timeline tied to the written scope and to the test steps listed in it.

What must our team provide before the work starts?

Three things matter most. First, access to the cluster: administrator credentials in each environment, the NiFi UI and the hosts or pods where nodes run, plus the ability to view the cluster connection summary. Second, test data that resembles production in size, format and attribute values, because partition by attribute behaves differently when a key is skewed. Third, named owners for the flows, the downstream systems and the change approval. Owners should be able to confirm which processors must run on the primary node and which destinations tolerate duplicates or reordering. Agree on these inputs in the scoping step.

Can our internal team set up load balancing without outside help?

Yes, if the team already operates NiFi clusters and understands FlowFile distribution, provenance and back pressure. The work is not large in configuration terms, but it requires judgment about ordering, duplicate handling and what happens during a node disconnect. Teams with limited NiFi cluster experience often spend more time on testing than on the change itself. An outside partner is most useful for design review, a controlled test plan and documentation for operators. Whichever path you choose, assign an engineer who owns the result after handover.

How does compression change network and CPU use between nodes?

Compression reduces the bytes sent between nodes at the cost of CPU time on both the sending and receiving side. It helps most when FlowFile content is large and compressible, and when the cluster network is the constraint. It helps less for small or already compressed payloads, where the CPU cost can outweigh the network savings. Measure both before and after a change, using the cluster connection summary and host metrics on each node. Confirm the exact compression options in the NiFi administration guide for your release, because the available settings are version-specific.

What happens when a node disconnects, and what should we check?

When a node disconnects, the connections that send data to it can stop delivering, and FlowFiles queued for that node may wait until it returns or until the flow is changed. The impact depends on the strategy: round robin spreads work across the remaining nodes, while partition by attribute and single node strategies can concentrate work or stall it. Test disconnect and reconnect in a non-production cluster before go-live, and confirm which queues fill and how back pressure responds. Include this scenario in your runbook.

Does load balancing differ between NiFi 2 and NiFi 1.x?

The load-balancing concept is the same, but the platform around it differs. NiFi 1.x reached the end of its line: the NiFi downloads page names NiFi 1.28 as the last minor release of the version 1 series, and it notes that 1.x cannot be maintained further because of its Jetty, Spring and AngularJS dependencies. The migration guidance requires moving through NiFi 1.27.0 before 2.0.0 and changing the flow file from flow.xml.gz to flow.json.gz. Plan the load-balancing design on NiFi 2 so that it is not rebuilt during a later upgrade, and confirm the current release details on the official download page.

Security and operational considerations for node-to-node transfer

Load-balanced connections move FlowFiles between nodes, so the transfer path, the people allowed to change it and the record of what moved all become part of your security posture. The cards below cover the controls to set and the signals to watch once the strategy is live.

Protect node-to-node traffic with cluster TLS

Load-balanced connections send FlowFile content and attributes over the network between cluster nodes, so that traffic carries your data. Confirm that the cluster is configured with TLS for node communication and that the certificates are issued from a trust chain every node accepts. Check that the cluster network is isolated from untrusted segments, because a plaintext or misconfigured path can expose content in transit even when the external interfaces are locked down.

Restrict who can change strategies

The load-balance strategy and partition attribute on a connection decide where data goes, so changing them is a data routing change. Limit edit rights on connections in the process groups that feed a load-balanced queue, and review those rights through your authorization policies. Record who holds these permissions and confirm that a routing change goes through the same change control as any other flow change.

Audit provenance for moved data

Provenance events record when a FlowFile is sent to another node, which gives you a trail for data that crossed the cluster. Confirm that provenance is enabled for the flows that carry regulated data and that retention meets your audit needs. Test a sample record end to end so you know which node handled each step and can answer a question about where a specific file went.

Log access and configuration changes

Application and user logs show who edited connections and when nodes joined, left or were disconnected. Route these logs to your central logging platform and set alerts for changes to load-balance settings outside a change window. Confirm that log files on each node are protected from modification and that time synchronization across nodes is in place so events line up during an investigation.

Watch the cluster connection summary

The cluster connection summary shows the queued FlowFiles, the number of nodes involved and the state of each node's share of the queue. Review it during rollouts and after a node disconnects, because a node that stops receiving data can hide a backlog. Set a baseline for normal queue distribution so you can spot an imbalance quickly and decide whether to act on the connection or the node.

Harden the wider NiFi deployment

Node-to-node transfer is one part of the cluster attack surface. Authentication providers, authorization policies, sensitive value handling and patching all affect whether a load-balanced flow stays protected. Work through the dedicated security hardening pages for NiFi and confirm each control against your own environment before you rely on the cluster for regulated data.

Where to verify load-balancing behavior in the NiFi docs

Check load-balancing behavior in the Apache NiFi System Administrator's Guide before you rely on it in a design. The guide is the primary reference for how a connection's load-balance strategy is configured, how the three strategies (round robin, partition by attribute and single node) distribute FlowFiles, how compression is applied in transit, and what happens to queued data when a node disconnects. Read the section on load-balanced connections alongside the cluster administration material, because the behavior depends on how the cluster elects its primary node and how nodes report their state. Use the guide to confirm the exact wording of each strategy and the settings your release exposes, then write those findings into your own design notes so the next reviewer can trace each decision back to a source.

Use the Apache NiFi download page to confirm which release you are running and which release notes apply to it. The page lists current and past versions, their support status and the end-of-support dates for each line, which matters because a load-balancing detail that changed in a newer release can make an older design behave differently. Record the exact version from your running nodes, not from your deployment plan, and compare it against the release notes for that version before you accept any documented behavior as current. Where the guide and the release notes disagree, or where your test results differ from both, treat the specific release as the authority and raise the question with your vendor or with the project's mailing lists before go-live.

How DeployOpen scopes and delivers NiFi cluster load balancing

DeployOpen plans and implements load-balanced connections in a NiFi cluster inside infrastructure you control, starting from your flow topology, data volumes and node failure expectations. Engagements are fixed-scope, with the strategy choices, verification steps and handover material agreed in writing before work begins.

How we scope

  • Inventory which connections follow primary-node sources and which need round robin or attribute-based partitioning.
  • Record the compression, ordering and back pressure expectations for each load-balanced connection in the written scope.
  • Confirm node count, cluster coordination method and how a disconnected node should affect data flow before quoting.

How we build

  • Configure each load-balanced connection with the chosen strategy and compression setting, then test it on a non-production cluster.
  • Run disconnect and reconnect tests to confirm how queued FlowFiles behave when a node leaves the cluster.
  • Review the cluster connection summary during testing to check that FlowFiles spread across nodes as designed.

How we hand over

  • Document each load-balanced connection, its strategy, its reasons and the expected behavior during node loss.
  • Provide a runbook covering checks in the cluster connection summary and steps to follow after a node disconnects.
  • Walk your operators through the test results and the configuration changes that will need review during future flow edits.

How we support

  • Offer ongoing support, upgrades and continuous testing for load-balanced flows as a retainer.
  • Re-test connection behavior when you add or remove nodes, change strategies or move to a newer NiFi release.
  • Ask any support provider to confirm response scope, hours and change handling in the written agreement before you sign.

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.