Hi everyone,
I have a NiFi flow where an ExecuteSQL processor runs once and generates N 
FlowFiles.
These FlowFiles are then ingested into the database using a PutDatabaseRecord 
processor.
Now, I want to trigger another ExecuteSQL processor after the ingestion is 
finished — but only once, not N times.
Here is the flow structure:

GenerateFlowFile (produces 1)
    → ExecuteSQL (produces N)
        → PutDatabaseRecord (processes N)
            → ExecuteSQL (should run only once)


Requirement

  *
The first ExecuteSQL runs once → produces N FlowFiles.
  *
PutDatabaseRecord processes each of the N FlowFiles.
  *
After all N FlowFiles are fully ingested,
the next ExecuteSQL processor should trigger only one time.

Problem
Because PutDatabaseRecord receives N FlowFiles, the downstream ExecuteSQL also 
tries to run N times.
I need a way to ensure it triggers only once after all the N FlowFiles have 
been processed.
Has anyone implemented this kind of flow control in NiFi?
What is the best approach to trigger a processor only after all FlowFiles from 
an upstream batch have been ingested?
Thanks in advance!

Reply via email to