@Bern
NiFi templates were deprecated in Apache NiFi 1.x and removed completely in Apache NiFi 2.x major release.
Around Apache NiFi 1.12 the xml format was deprecated, but remained as a part or NiFi 1.x major release versions. This impacted for both templates and the flow.xml.gz file that held everything you see on the canvas. NiFi introduced Flow Definitions (template replacement which is in json format) and the flow.json.gz to replace the flow.xml.gz for persisting the entire NiFi canvas's dataflows. When you upgrade to a version of NiFi greater then 1.12, NiFi will still load from a flow.xml.gz file and will then convert and write back out the newer flow.json.gz format.
Flow Definitions can be created by right clicking in a process group on the NiFi canvas and selecting option to download a flow definition for that specific process group.
The screenshot you shared show you attempting to import a flow definition in Apache NiFi 2 but providing a NiFi template instead of a Flow Definition. That is why you encountered the exception about it not being a valid json.
Unfortunately, Apache NiFi does not have utility for converting NiFi templates into Flow Definitions. So you will need to have a NiFi 1.13+ version of Apache NiFi where you can still load your templates and then download them as flow definitions )some templates will require manual modification before they can be downloaded as a flow definition. There are numerous breaking changes in Apache NiFi 2.x major release so I suggest reading through the Apache NiFi migration guide to understand what those changes are any the manual actions you may need to make to your NiFi 1.x release flows before they can be used in NiFi 2.x.
https://cwiki.apache.org/confluence/display/NIFI/Migration+Guidance
NOTE: Cloudera Flow Management (CFM) licensed users have access to Cloudera specific automation tools that can auto transform templates into valid flow definitions and automated migration of CFM 2.1.7 SP2 (Apache NiFi 1.x based) flow.json.gz files into CFM 4.1x (Apache NiFi 2.x based) compatible version. This automation handles deprecated components, converting NiFi variables (deprecated) into NiFi parameters (replacement), etc.
https://docs.cloudera.com/cfm/4.11.0/cfm-migration-tool/topics/cfm-mt-overview.html#concept_wlv_sl3_...
Please help our community grow. If you found any of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "Accept as Solution" on one or more of them that helped.
Thank you,
Matt