Not sure why you would want to do this. NiFi's design intent is to always have your processors running.
That being said, anything you can do directly on the canvas can also be accomplished via rest-api calls to the NiFi URL. This means you could build a script that makes a series of rest-api calls via curl to start NiFi components in your desired sequence.
You can actually use developer tools embedded in your browser to capture the actions as you perform them in the NiFi UI and even save them as curl commands. Using Chrome browser for example, click on the 3 dots in upper right corner.
Then you can perform you action in the NiFi Ui and you will see what call what rest-api request was sent to the rest-api and right click on it to get menu for saving that request as a curl command.
There will be some unnecessary headers in the curl command that you may choose to clean out or just leave them in.
You can also access NiFi's rest-api documentation directly in your NiFi's UI by going to the global menu and selecting "Help". The "Rest Api" docs will be found under the "Developer" section on left hand side.