Wires not showing in UI after being saved from API Call

I build my flows dynamically using the POST /flow to save them into Node Red. If I view the saved node after the call in the UI I am missing the wires for the created node. If I keep node red closed I can run my workflows without any issue but if for some reason the UI is open and I click deploy the saved flows in flows.json has the wire get overwritten to be the missing wires that the UI shows. Two questions does the UI pull from the flows.json and what can I do in my dynamic building to ensure that my wires show up in the UI?

The editor loads the current set of deployed flows when it opens up. If a deploy event happens in the background, the editor will notify the user and ask if they want to import the updates from the runtime back into the editor.

Can you share a (small) example of what your generated flow JSON looks like?

Are there any errors in the browser's JavaScript console when you open the editor and it fails to show your wires?

What version of Node-RED are you using?

I am running on my local machine version 2.06 for node red. According to the settings file my flowFile is defaulted to flows.json. Is there somewhere else that the flows can be loaded from? Here are a couple of generated nodes.

{
"id": "eeb91a0471ba470",
"type": "mqtt in",
"name": "... Recalculated",
"topic": "event/...",
"qos": "0",
"datatype": "auto",
"broker": "ab71c0e857d44117",
"nl": false,
"rap": true,
"rh": null,
"x": 500,
"y": 500,
"wires": [
[
"799af7db941d4e3",
"44cb0a74243b4a4"
]
],
"z": "66da45f8cfb135f9",
"property": null,
"action": null,
"pretty": null,
"func": null,
"outputs": null,
"noerr": null,
"initialize": null,
"finalize": null,
"libs": null,
"active": null,
"tosidebar": null,
"console": null,
"tostatus": null,
"complete": null,
"statusVal": null,
"statusType": null,
"method": null,
"ret": null,
"paytoqs": null,
"url": null,
"tls": null,
"persist": null,
"proxy": null,
"authType": null,
"statusCode": null,
"headers": null,
"firstNodeInGroup": true,
"propertyType": null,
"rules": null,
"checkall": null,
"repair": false
},
{
"id": "a8e6895913cf43a",
"type": "function",
"name": "Sms Template Function",
"topic": null,
"qos": null,
"datatype": null,
"broker": null,
"nl": null,
"rap": null,
"rh": null,
"x": 500,
"y": 500,
"wires": [
[
"b34aad82443c423"
]
],
"z": "66da45f8cfb135f9",
"property": null,
"action": null,
"pretty": null,
"func": "msg.headers = {}; msg.headers['content-type'] = 'application/json'; msg.payload.data.smsTemplate='Balance Recalculated'; return msg;",
"outputs": 1,
"noerr": 0,
"initialize": null,
"finalize": null,
"libs": null,
"active": null,
"tosidebar": null,
"console": null,
"tostatus": null,
"complete": null,
"statusVal": null,
"statusType": null,
"method": null,
"ret": null,
"paytoqs": null,
"url": null,
"tls": null,
"persist": null,
"proxy": null,
"authType": null,
"statusCode": null,
"headers": null,
"firstNodeInGroup": false,
"propertyType": null,
"rules": null,
"checkall": null,
"repair": false
}

There are no errors in the console for the UI.

I was having the problem it appears because I was building incorrect nodes. Interesting thing is that they ran just fine when just running in the background they just don't look right when you look at them in the UI. Any deploy in the UI would overwrite the invalid nodes removing their wires. So instead of using the entire possible node structure I am building the nodes exactly like the UI returns them for their types and that appears to have corrected the problem.

It would be useful to know what you were building incorrectly. ( in case it’s something that can be caught/flagged.

Basically from the example I gave I was sending everything that a node could have regardless of type. So as an example a function node would have information in its JSON that was for a MQTT node or HTTP node. Those fields would be null or empty but it still caused issues with how the UI interpreted the nodes given.