Hi there,
I am trying to loop through each sub_scene under each scene. The first scene’s sub_scenes go smoothly, but then the second loop just pass through the sub_scenes of next scenes to the done node. Please help!
{
"name": "My workflow",
"nodes": [
{
"parameters": {
"jsCode": "return [\n {\n \"Scene_count\": 0,\n \"Scene_text\": \"blah blah blah\",\n \"Duration\": 17.24,\n \"Sub_scenes\": [\n {\n \"Scene_count\": 0,\n \"sub_scene_count\": 1,\n \"sub_scene_text\": \"blah blah blah\",\n \"check\": \"No\"\n },\n {\n \"Scene_count\": 0,\n \"sub_scene_count\": 2,\n \"sub_scene_text\": \"blah blah blah\",\n \"check\": \"No\"\n }\n ]\n },\n {\n \"Scene_count\": 1,\n \"Scene_text\": \"blah blah blah\",\n \"Duration\": 17.24,\n \"Sub_scenes\": [\n {\n \"Scene_count\": 1,\n \"sub_scene_count\": 1,\n \"sub_scene_text\": \"blah blah blah\",\n \"check\": \"No\"\n },\n {\n \"Scene_count\": 1,\n \"sub_scene_count\": 2,\n \"sub_scene_text\": \"blah blah blah\",\n \"check\": \"No\"\n }\n ]\n }\n];"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-620,
-380
],
"id": "7d76c4f4-7a2a-4311-bcfe-f07a6bcc0077",
"name": "Scenes1",
"executeOnce": true
},
{
"parameters": {
"jsCode": "return $json.Sub_scenes;"
},
"type": "n8n-nodes-base.code",
"typeVersion": 2,
"position": [
-260,
-280
],
"id": "b97961c3-7af0-40d4-ac20-f28ff15bae1e",
"name": "Code"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
-440,
-380
],
"id": "cd6697b1-f15e-4462-be92-dd897e52b779",
"name": "Loop Over Items1"
},
{
"parameters": {
"options": {
"reset": false
}
},
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 3,
"position": [
100,
-280
],
"id": "185d3c55-a898-4ef9-b934-b7751226cad5",
"name": "Loop Over Items2"
},
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-800,
-380
],
"id": "65aae50a-af1e-4d01-b6a7-35ed439145d1",
"name": "When clicking ‘Test workflow’"
},
{
"parameters": {},
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
320,
-180
],
"id": "f404e6b6-5cc2-4f45-be0b-cf1a3f693b4a",
"name": "No Operation, do nothing"
},
{
"parameters": {
"amount": 30
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
-80,
-280
],
"id": "608f02c2-38be-496d-9cfa-0ccc927ecde2",
"name": "Wait",
"webhookId": "c761e062-7c9b-46e3-837b-9664f81d3d47"
},
{
"parameters": {
"amount": 30
},
"type": "n8n-nodes-base.wait",
"typeVersion": 1.1,
"position": [
540,
-180
],
"id": "1f16ae1e-3ed0-4d8a-a0f4-8dd9106de061",
"name": "Wait1",
"webhookId": "8a70fdcf-6cc4-455b-928c-4e75ca57886d"
}
],
"pinData": {},
"connections": {
"Scenes1": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
]
]
},
"Code": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items1": {
"main": [
[],
[
{
"node": "Code",
"type": "main",
"index": 0
}
]
]
},
"Loop Over Items2": {
"main": [
[
{
"node": "Loop Over Items1",
"type": "main",
"index": 0
}
],
[
{
"node": "No Operation, do nothing",
"type": "main",
"index": 0
}
]
]
},
"When clicking ‘Test workflow’": {
"main": [
[
{
"node": "Scenes1",
"type": "main",
"index": 0
}
]
]
},
"No Operation, do nothing": {
"main": [
[
{
"node": "Wait1",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
}
]
]
},
"Wait1": {
"main": [
[
{
"node": "Loop Over Items2",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "558e9208-94a1-436a-93c8-4dddbf3a438b",
"meta": {
"instanceId": "06c5e93c401bf851c477c49cd5b904e1cb83b1c9ee3764a5af020bb35f68efe3"
},
"id": "weLWxDHMV3qPMBSx",
"tags": []
}```