I inquired about the directory of templates nifi before asking the question. And I saw that all templates are stored in flow.xml.gz. My question is can I opt for a directory that stores the templates instead of this file. Is it more correct and will not cause problems.
What is your need for a directory of templates? Is it for backup? Or something like a flow repository? If yes, I would recommend using NiFi registry.
NiFi registry is "sort of" a GitHub for NiFi and can maintain multiple versions of a flow in "buckets". With NiFi registry you can "checkin" your flows into a central repository and if that repo, your NiFi registry, is connected to some other higher environment, you can import your flow there. And all that without the need to create a template.
Let know if this helps!