Set the active flow configuration.
Requires permission: flows.write
Header | Value |
---|---|
Authorization |
Bearer [token] - if authentication is enabled |
Content-type |
application/json |
Node-RED-API-Version |
(Since 0.15.0) The api version being used. Defaults to v1 if not set. |
Node-RED-Deployment-Type |
full , nodes , flows or reload |
The Node-RED-Deployment-Type
header is used to define what type of deployment
is performed.
full
- all existing nodes are stopped before the new configuration is started.
This is the default behaviour if the header is not provided.nodes
- only nodes that have been modified are stopped before the new
configuration is applied.flows
- only flows that contain modified nodes are stopped before the new
configuration is applied.reload
- the flows are reloaded from storage and all nodes are restarted (since Node-RED 0.12.2)The format of the request body will depend on the Node-RED API version being used:
v1
- array of node objectsv2
- flow response objectThe rev
property, if provided, should reflect the revision of flows that was returned by GET /flows
.
There are two ways to provide credentials with this request. The individual node
objects in the flows
array can contain a credentials
property containing the
credentials for that node.
Alternatively, the top level object can include a credentials
property that has
credentials for individual nodes, or a complete encrypted set.
Inline node credentials :
Separate node credentials :
Encrypted node credentials:
}
Status Code | Reason | Response |
---|---|---|
200 |
v2 Success |
The new rev for the active flows. See below. |
204 |
v1 Success |
none |
400 |
Invalid API version | An Error response |
401 |
Not authorized | none |
409 |
Version mismatch | An Error response. See below. |
If v1
of the API is being used, a successful request contains no response body.
If v2
of the API is being used, the request should include rev
property that
is set to the latest rev
value known to the requestor. If this value matches
the rev
value of the active flows in the runtime, the request will succeed.
If it does not match, this indicates the runtime is using a newer version of flows
and the request is rejected with a 409
status code. This allows the requestor to
resolve any differences and resubmit the request.
If the requestor wishes to force deploy, the rev
property should be omitted from
the request.
On a successful request, the response provides the new rev
value:
Note: the rev
property is a string, but no other assumptions should be made
as to its format.
Node-RED: Low-code programming for event-driven applications.
Copyright OpenJS Foundation and Node-RED contributors. All rights reserved. The OpenJS Foundation has registered trademarks and uses trademarks. For a list of trademarks of the OpenJS Foundation, please see our Trademark Policy and Trademark List. Trademarks and logos not indicated on the list of OpenJS Foundation trademarks are trademarks™ or registered® trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
The OpenJS Foundation | Terms of Use | Privacy Policy | OpenJS Foundation Bylaws | Trademark Policy | Trademark List | Cookie Policy