In a NiFi cluster each node executes its own copy of the flow.xml.gz, has its own set of repositories, and executes against only the FlowFiles on that specific node. So you need to consider this in your dataflow designs.
Perhaps the dataflow that executes the groovy Script on all nodes could be designed to write all the produced files to a single destination server. Then in your http_request-> fetchfile-> http_response dataflow, instead of "fetchFile" use fetchSFTP to retrieve all those files and mergeContent to merge in to one file before the http_response.
If you found this response assisted with your query, please take a moment to login and click on "Accept as Solution" below this post.