I am not sure i completely follow what you are trying to accomplish.
Dataflows within NiFi's UI/canvas are stored in the flow.xml.gz file in XML file format. These dataflows may not only consist of processor components but also controller services (required buy some processors). It is the job of the nifi controller to facilitate the execution of these processors and assigning of threads. There is no mechanism for exporting a flow in an executable format.
If you are looking for a lighter wait NiFi implementation, you could take a look at MiNiFi. You would use a full NiFi to construct your dataflow and create a NiFi template. A NiFi toolkit is available that can convert that template in to a yaml file that can be executed by MiNiFi.
More information on MiNiFi can be found here: