Using the Node-RED API

Bonjours à tous,

J'ai rélisé un programme en NODE RED qui effectue la mise à jour d'un flow par l'intermédiare de l'API j'utilise
msg.method = "PUT";
msg.url = "http://" + retain.host + ":1880/flow/" + encodeURIComponent(msg.idtab);
msg.headers = {
"Content-Type": "application/json",
"Authorization": "Bearer " + msg.Updatetopic
};

Tout se passe correctement et la mise à jour ce fait correctement.
Ma question est de savoir si le flow est bien démarré et que tout le flow de l'application à bein redémarré ? J'ai bien l'éditeur qui m'indique qu'il y a eu une modification. L'editeur trouve tous les nouveaux noeuds et ne trouve pas de conflit. Mais visuellement je ne vois pas un fonctionnement correcte ! Il suffit que je décalle un noeuds pour forcer un déploiement et tout se synchronise et le fonctionnent est optimum. Que pensez vous de mon problème ?

Cordialement

Hello everyone,

I created a Node-RED program that updates a flow via the API. I use the following:
msg.method = "PUT";
msg.url = "http://" + retain.host + ":1880/flow/" + encodeURIComponent(msg.idtab);
msg.headers = {
"Content-Type": "application/json",
"Authorization": "Bearer " + msg.Updatetopic
};

Everything proceeds smoothly, and the update completes successfully.
My question is: has the flow actually started, and has the entire application flow properly restarted? The editor indicates that a modification has occurred; it detects all the new nodes and finds no conflicts. However, visually, it doesn't seem to be working correctly! If I simply shift a node to force a deployment, everything synchronizes and operates optimally. What do you think about this issue?

Best regards,

Try refreshing the browser page

Hello,
I did refresh the page, but unfortunately, there is no improvement. The update flow is inactive.
Inactive flow:

Active flow

I just tested integrating all the flows using a POST /flows request to force deployment via the API. I can see the process restarting, but there is no improvement regarding my issue.

Best regards,

What happens if you click the inject node?

I did press inject node, but nothing happens.

Add some debug nodes to the flow you post, with their output set to System Console and Debug Window and see what it shows in the node red log when you post.

Nothing in particular. No error message. 27 Jul 12:10:31 - [info] Stopping flows
27 Jul 12:10:31 - [info] Stopped flows
27 Jul 12:10:31 - [info] Updated flows
27 Jul 12:10:31 - [info] Starting flows
27 Jul 12:10:31 - [info] Started flows
27 Jul 12:10:31 - [info] [sqlitedb:7d4740589faebf3b] opened /data/PFC300.db ok
27 Jul 12:10:31 - [info] [sqlitedb:ec208ae4f8bd7c83] opened /data/records.db ok
27 Jul 12:10:31 - [info] [sqlitedb:f9e81dceef4ae0cb] opened /data/translation.db ok

I had the integration of a flow carried out instead of a modification
I have the same result

27 Jul 14:36:05 - [info] Updated flows
27 Jul 14:36:05 - [info] Adding flow: Workflow1785155765394 [268daa3ca0fc1d6e]
27 Jul 14:36:09 - [info] Stopping flows
27 Jul 14:36:09 - [info] Stopped flows
27 Jul 14:36:09 - [info] Updated flows
27 Jul 14:36:09 - [info] Starting flows
27 Jul 14:36:09 - [info] Started flows
27 Jul 14:36:09 - [info] [sqlitedb:7d4740589faebf3b] opened /data/PFC300.db ok
27 Jul 14:36:09 - [info] [sqlitedb:f9e81dceef4ae0cb] opened /data/translation.db ok
27 Jul 14:36:09 - [info] [sqlitedb:ec208ae4f8bd7c83] opened /data/records.db ok

What I've noticed is that the nodes are in either an "added" or "modified" status.
For the nodes to be processed, I have to perform a manual rebuild by changing something so that the modifications are picked up without any issues.
Strange.

I recently experienced a similar situation when I tried to update the subflows (id: global). I made a mistake by having a duplicate subflow in my subflows array, which was accepted by the API, but resulted in a strange situation that was not easy to debug: I only saw the old subflow and the new subflow was completely hidden from the UI. Maybe something similar happened to you too? Your flow might contain duplicate nodes (same id). You should be able to find this out by inspecting the output from GET /flow/:id