
- Apache NiFi Tutorial
- Apache NiFi - Home
- Apache NiFi - Introduction
- Apache NiFi - Basic Concepts
- Apache NiFi - Environment Setup
- Apache NiFi - User Interface
- Apache NiFi - Processors
- Apache NiFi - Processors Categorization
- Apache NiFi - Processors Relationship
- Apache NiFi - FlowFile
- Apache NiFi - Queues
- Apache NiFi - Process Groups
- Apache NiFi - Labels
- Apache NiFi - Configuration
- Apache NiFi - Administration
- Apache NiFi - Creating Flows
- Apache NiFi - Templates
- Apache NiFi - API
- Apache NiFi - Data Provenance
- Apache NiFi - Monitoring
- Apache NiFi - Upgrade
- Apache NiFi - Remote Process Group
- Apache NiFi - Controller Settings
- Apache NiFi - Reporting Task
- Apache NiFi - Custom Processor
- Apache NiFi - Custom Controllers Service
- Apache NiFi - Logging
- Apache NiFi Useful Resources
- Apache NiFi - Quick Guide
- Apache NiFi - Useful Resources
- Apache NiFi - Discussion
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Apache NiFi - Templates
Apache NiFi offers the concept of Templates, which makes it easier to reuse and distribute the NiFi flows. The flows can be used by other developers or in other NiFi clusters. It also helps NiFi developers to share their work in repositories like GitHub.
Create Template
Let us create a template for the flow, which we created in chapter no 15 “Apache NiFi - Creating Flows”.

Select all the components of the flow using shift key and then click on the create template icon at the left hand side of the NiFi canvas. You can also see a tool box as shown in the above image. Click on the icon create template marked in blue as in the above picture. Enter the name for the template. A developer can also add description, which is optional.
Download Template
Then go to the NiFi templates option in the menu present at the top right hand corner of NiFi UI as show in the picture below.

Now click the download icon (present at the right hand side in the list) of the template, you want to download. An XML file with the template name will get downloaded.
Upload Template
To use a template in NiFi, a developer will have to upload its xml file to NiFi using UI. There is an Upload Template icon (marked with blue in below image) beside Create Template icon click on that and browse the xml.

Add Template
In the top toolbar of NiFi UI, the template icon is before the label icon. The icon is marked in blue as shown in the picture below.

Drag the template icon and choose the template from the drop down list and click add. It will add the template to NiFi canvas.