Skip to main content
girish6
Silver ⭐️⭐️
December 12, 2019
Solved

Is it possible to create NiFi workflows using REST API or any other thing?

I'm wondering is it possible to create NiFi workflows with the existing processors using REST Api or CLI instead of creating workflows in GUI. Is REST Api can be used to create workflows or only to modify and schedule workflows. If we can create workflows using REST api or CLI, any articles or blogs to look into it?

Let's say I want to create a workflow which simply takes file form local and put it to hdfs. This can be possible by drag and drop the processors in GUI but Is it possible to do the same using REST API or CLI or any other thing which we can do programatically?  It would be a great help if you guide me regarding this.

Thanks a lot.

MattWho
MattWhoAnswer
Titanium ⭐️⭐️⭐️
December 12, 2019

@girish6 

 

Anything you can do through the NiFi UI can also be accomplished via the NiFi rest-api.

Within NiFi you can go to the global menu in the upper right corner and then select "Help". 
On the left side of the Help UI you will see and option in the list for the NiFi rest-api docs for the release you are running.

However, it is easier to get use to NiFi rest-api through the developer tools available in your browser.
You can open the developer tools while you are in the NiFi UI and see the rest-api calls as they are made when you perform an action on the GUI (like adding a processor component).  You can even right click on the rest-api call in the developers tool window and copy as curl to get the exact rest-api call you could make from a command line prompt.

 

Hope this helps you,

Matt

8 replies

MattWho
Titanium ⭐️⭐️⭐️
MattWhoAnswer
Titanium ⭐️⭐️⭐️
December 12, 2019

@girish6 

 

Anything you can do through the NiFi UI can also be accomplished via the NiFi rest-api.

Within NiFi you can go to the global menu in the upper right corner and then select "Help". 
On the left side of the Help UI you will see and option in the list for the NiFi rest-api docs for the release you are running.

However, it is easier to get use to NiFi rest-api through the developer tools available in your browser.
You can open the developer tools while you are in the NiFi UI and see the rest-api calls as they are made when you perform an action on the GUI (like adding a processor component).  You can even right click on the rest-api call in the developers tool window and copy as curl to get the exact rest-api call you could make from a command line prompt.

 

Hope this helps you,

Matt

Translate
girish6
girish6Author
Silver ⭐️⭐️
December 13, 2019

Thank you so much @MattWho 

But another question popped up here. Is there any possibility to execute the xml file somewhere (not on GUI) where it can reflects in the GUI same as curl command.
Through  REST API calls we can create and modify workflows, thats totally fine. In the same way, can we create and modify workflows in the xml file and executing somewhere reflects in the GUI?

Translate
girish6
girish6Author
Silver ⭐️⭐️
December 18, 2019

@MattWho 

cool, In terms of REST API calls, Isn't it possible to create workflows using nifi rest api?

Translate