@mcnaveen Not sure if I understood well, but if I did, the example below should do it.
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"functionCode": "return [\n {\n json: {\n firstname: 'ricardo',\n lastname: 'espinoza'\n }\n },\n {\n json: {\n firstname: 'ricardo',\n }\n }\n]"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
470,
300
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$node[\"Function\"].json[\"lastname\"] ? true : false}}",
"value2": true
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
670,
300
]
},
{
"parameters": {},
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
910,
180
],
"notesInFlow": true,
"notes": "lastname exist"
},
{
"parameters": {},
"name": "NoOp1",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
910,
410
],
"notesInFlow": true,
"notes": "lastname does not exist"
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
],
[
{
"node": "NoOp1",
"type": "main",
"index": 0
}
]
]
}
}
}