Deploying Node-Red Flows

When you come to deploying a flow you have four (node-red v0.2)options as shown below:deploying-flows

Although the choices appear obvious the effect of the options isn’t and can cause some confusion.



In this tutorial I will concentrate of the effects of the deploy options on.

  • Inject nodes
  • Context,Flow and Global Variables
  • Other Flows in the Workspace

 

What is Modified?

Firstly we need to look at how node-red decides that a node or flow has been modified?

You should notice that when you edit a node then the deploy button goes red which means you can do a deploy.

However you can get the same effect by dragging a node across the screen.

In this case the node position has been modified but not the node.

Inject Nodes And Storage Variables

Inject nodes are typically used in a flow to initialise it.

Therefore it is important to understand if the deploy type you are using will do that.

In addition most flows will use node red storage variables (context,flow,global) for storing flow data.

What happens to these variables when you do a deploy?

Full Deploy

This will re-deploy all flows in the workspace regardless of whether or not they have been modified.

This means that currently running flows are interrupted and restarted.

Result

  • Inject nodes will fire.
  • Context variables reset
  • Flow and Global Variables are not reset

Modified Flows

Only flows that contain modified nodes will be redeployed.

Flows that haven’t been modified will continue to run without interruption.

Result

  • Inject nodes in that flow will fire.
  • Context variables reset
  • Flow and Global Variables are not reset

Modified Nodes

Only nodes that have been modified will be redeployed.

Nodes that haven’t been modified will continue to run without interruption.

Result

  • Inject nodes in that flow will only fire if they have been modified.
  • Context variables not reset
  • Flow and Global Variables are not reset

Restart Flows

All deployed flows will be redeployed.

This means that currently running flows are interrupted and restarted.

Result

  • Inject nodes will fire.
  • Context variables reset
  • Flow and Global Variables are not reset

Video -Deploying Node-Red Flows- (Quick Notes)

 

<===== Creating Flows- Node-Red Admin Basics

=====>How to Export and Import Nodes and Flows

Related Tutorials and Resources

 

Please rate? And use Comments to let me know more
[Total: 2    Average: 5/5]

Leave a Reply

Your email address will not be published. Required fields are marked *