# Execution of Node when previous node output is Undefined

**URL:** <https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665>\
**Category:** General\
**Created:** [3 October 2018 20:19 UTC](https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665 "2018-10-03T20:19:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jewendt](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jewendt](https://discourse.nodered.org/u/jewendt)\
**Post date:** [3 October 2018 20:19 UTC](https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665/1 "2018-10-03T20:19:49Z")

</div>

Is is normal behavior for a node node not to operate if a previous node is sending a payload that is undefined? I my case there is a node that I am using that's output is 'undefined'. I have linked that change node however the change node is not operating properly. Is this normal behavior?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [3 October 2018 20:25 UTC](https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665/2 "2018-10-03T20:25:00Z")

</div>

It'll depends on the specific details. Can you share a minimal example?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [3 October 2018 21:33 UTC](https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665/3 "2018-10-03T21:33:24Z")

</div>

probably - returning null from a function for example doesn't send a msg.  
Also quite a few nodes only trigger if the payload (or selected property) exists.

---

<div class="post-metadata">

**Author:** ![jewendt](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jewendt](https://discourse.nodered.org/u/jewendt)\
**Post date:** [3 October 2018 21:36 UTC](https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665/4 "2018-10-03T21:36:43Z")

</div>

Yes, sorry struggling with creating a simple example that you can use to recreate. Bottom line, it looks like I don't have a msg object when it is undefined so I change use the standard change, switch nodes etc. I tried to set the payload etc in a function but it still is not working. Is there a way to create a msg object when it is triggered from a node whose output is undefined?

---

<div class="post-metadata">

**Author:** ![jewendt](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jewendt](https://discourse.nodered.org/u/jewendt)\
**Post date:** [3 October 2018 21:43 UTC](https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665/5 "2018-10-03T21:43:37Z")

</div>

Here is the basic flow I am trying accomplish. When the blob storage account node has successfully saved, it outputs and 'undefined' message. I am unable to do anything after that. I am trying to set a msg.filename property to delete a file but it doesn't work. I believe it is because there isn't a msg object anymore but I can't figure out how to create one and just use the undefined output as a trigger.

[  
{  
"id": "14b0cdf3.de4eb2",  
"type": "tab",  
"label": "Flow 1",  
"disabled": false,  
"info": ""  
},  
{  
"id": "a3a610f8.41fd6",  
"type": "Save Blob",  
"z": "14b0cdf3.de4eb2",  
"name": "Azure Save Blob Storage",  
"x": 353.1000061035156,  
"y": 217.20001220703125,  
"wires": [  
[  
"28dda0e9.c0101"  
]  
]  
},  
{  
"id": "7ebd0394.29648c",  
"type": "inject",  
"z": "14b0cdf3.de4eb2",  
"name": "",  
"topic": "",  
"payload": "",  
"payloadType": "date",  
"repeat": "",  
"crontab": "",  
"once": false,  
"onceDelay": 0.1,  
"x": 97.10000610351562,  
"y": 181,  
"wires": [  
[  
"a3a610f8.41fd6"  
]  
]  
},  
{  
"id": "e381cd37.640b5",  
"type": "debug",  
"z": "14b0cdf3.de4eb2",  
"name": "",  
"active": true,  
"tosidebar": true,  
"console": false,  
"tostatus": false,  
"complete": "false",  
"x": 809.1000747680664,  
"y": 123.20000648498535,  
"wires": []  
},  
{  
"id": "28dda0e9.c0101",  
"type": "change",  
"z": "14b0cdf3.de4eb2",  
"name": "",  
"rules": [  
{  
"t": "set",  
"p": "filename",  
"pt": "msg",  
"to": "filename",  
"tot": "flow"  
}  
],  
"action": "",  
"property": "",  
"from": "",  
"to": "",  
"reg": false,  
"x": 607.1000366210938,  
"y": 171.8000030517578,  
"wires": [  
[  
"e381cd37.640b5",  
"e0e2679b.ed0508"  
]  
]  
},  
{  
"id": "e0e2679b.ed0508",  
"type": "file",  
"z": "14b0cdf3.de4eb2",  
"name": "",  
"filename": "",  
"appendNewline": true,  
"createDir": false,  
"overwriteFile": "delete",  
"x": 670.1000366210938,  
"y": 273.8000183105469,  
"wires": [  
[]  
]  
}  
]

---

<div class="post-metadata">

**Author:** ![jewendt](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@jewendt](https://discourse.nodered.org/u/jewendt)\
**Post date:** [3 October 2018 21:55 UTC](https://discourse.nodered.org/t/execution-of-node-when-previous-node-output-is-undefined/3665/6 "2018-10-03T21:55:07Z")

</div>

Ok, I think I figured it out. I needed to create a completely new msg object in a function.
