Subflows stopped working suddenly

Hi, today my subflows stopped working without any reason.
This is the feedback from the console.
NodeRED 0.19.6 on AWS EC2 Ubuntu instance

TypeError: Cannot read property 'id' of undefined
at createSubflow (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:362:61)
at Flow.start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:97:41)
at start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:328:29)
at /usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:164:25
at
at process._tickCallback (internal/process/next_tick.js:189:7)

Hi @albydnc - can you provide more information about your flows? THis doesn't give us much to go on - particularly as 0.19.6 is pretty old now.

Hi, I've updated to 0.20.5 and the error still remains. I can share the flows with you but they are pretty big.
On my other redundant AWS instance everything is working fine.

30 May 14:40:51 - [info] 

Welcome to Node-RED
===================

30 May 14:40:51 - [info] Node-RED version: v0.20.5
30 May 14:40:51 - [info] Node.js  version: v8.15.1
30 May 14:40:51 - [info] Linux 4.15.0-1039-aws x64 LE
30 May 14:40:52 - [info] Loading palette nodes
30 May 14:40:52 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
30 May 14:40:52 - [warn] rpi-gpio : Cannot find Pi RPi.GPIO python library
node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated.
In the future, you will have to enable it yourself.
See https://github.com/yagop/node-telegram-bot-api/issues/319. module.js:653:30
30 May 14:40:53 - [info] RedBot version: 0.16.8 (node-red-contrib-chatbot)
30 May 14:40:54 - [info] Worldmap version 1.5.40
30 May 14:40:55 - [info] Settings file  : /home/ubuntu/.node-red/settings.js
30 May 14:40:55 - [info] Context store  : 'default' [module=memory]
30 May 14:40:55 - [info] User directory : /home/ubuntu/.node-red
30 May 14:40:55 - [info] Server now running at http://127.0.0.1:1880/
30 May 14:40:55 - [info] Active project : OpenParkingBot
30 May 14:40:55 - [info] Flows file     : /home/ubuntu/.node-red/projects/OpenParkingBot/flows_openparkingbot.json
30 May 14:40:55 - [info] Starting flows
Telegram Bot OpenParking_DEV will be launched, environment is development
No context provider specified for chatbot OpenParking_DEV. Defaulting to "memory"
Telegram Bot openparking_live will NOT be launched, environment is development
Telegram Bot AIRPORT live will be launched, environment is development
No context provider specified for chatbot AIRPORT live. Defaulting to "memory"
Telegram Bot TEST perro will NOT be launched, environment is development
TypeError: Cannot read property 'id' of undefined
    at remapSubflowNodes (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Subflow.js:412:64)
    at new Subflow (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Subflow.js:85:9)
    at Object.createSubflow [as create] (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Subflow.js:435:12)
    at Flow.start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/Flow.js:187:51)
    at start (/usr/lib/node_modules/node-red/node_modules/@node-red/runtime/lib/nodes/flows/index.js:329:33)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
30 May 14:40:55 - [error] [chatbot-telegram-receive:99f381dd.a37d68] TypeError: this.subflowInstanceNodes[sfId].getNode is not a function
30 May 14:40:55 - [error] [chatbot-telegram-send:9e7effda.50ae48] TypeError: this.subflowInstanceNodes[sfId].getNode is not a function
30 May 14:40:55 - [error] [chatbot-rules:1687c6a8.8f4a01] TypeError: this.subflowInstanceNodes[sfId].getNode is not a function
30 May 14:40:55 - [error] [chatbot-rules:998548dc.3dde68] TypeError: this.subflowInstanceNodes[sfId].getNode is not a function
30 May 14:40:55 - [error] [chatbot-rules:c8d1829f.76f71] TypeError: this.subflowInstanceNodes[sfId].getNode is not a function
30 May 14:40:55 - [info] Started flows

------ WebHooks for TELEGRAM----------------
http://localhost:1880/redbot/telegram

[TELEGRAM] Unkown connection mode
30 May 14:40:55 - [error] [chatbot-telegram-node:2be5224e.d2bd86] [TELEGRAM] Unkown connection mode
(node:3201) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
30 May 14:40:55 - [error] [function:98e8f1ee.4d03e] TypeError: this.subflowInstanceNodes[sfId].getNode is not a function
30 May 14:40:55 - [error] [function:98cff9ed.7bb798] TypeError: this.subflowInstanceNodes[sfId].getNode is not a function

This is the console printout

Resolved. It was a link node that wasn't connected.

Well you are going to have to give us some clue as to what your flows are doing and how the subflows are configured. If you can't provide a summary, then please do send your flow file to me directly - nick.oleary@gmail.com

Ok - just seen your 'resolved' update. I'd like to know more specific details because this sort of error should not happen regardless of how the flows are configured.

What/where was the link node and what did you need to connect it to?

I've sent you the code via email. By the way, I think the error was caused by the deletion of a link node, which caused the other link node to point to an undefined node. This is not possible anymore, since in version 0.20.5 links are configured differently.