Skip to content

Instantly share code, notes, and snippets.

@ed-parsadanyan
Created May 12, 2022 12:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ed-parsadanyan/1b855fbb62743cd40824b3f1e35141c2 to your computer and use it in GitHub Desktop.
Save ed-parsadanyan/1b855fbb62743cd40824b3f1e35141c2 to your computer and use it in GitHub Desktop.
n8n loop wait example
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
240,
300
]
},
{
"parameters": {
"functionCode": "return [{Itemnumber: 1},\r\n {Itemnumber: 2},\r\n {Itemnumber: 3},\r\n {Itemnumber: 4},\r\n {Itemnumber: 5}];"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
440,
140
]
},
{
"parameters": {
"batchSize": 1,
"options": {}
},
"name": "SplitInBatches",
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 1,
"position": [
620,
300
]
},
{
"parameters": {
"unit": "seconds"
},
"name": "Wait",
"type": "n8n-nodes-base.wait",
"typeVersion": 1,
"position": [
780,
300
],
"webhookId": "1ff02ed6-348c-42fd-98a6-6f81dbd25116"
},
{
"parameters": {
"mode": "wait"
},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
1380,
140
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$node[\"SplitInBatches\"].context[\"noItemsLeft\"]}}",
"value2": "={{true}}"
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
940,
300
]
},
{
"parameters": {
"functionCode": "return items;"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1600,
140
]
},
{
"parameters": {},
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1160,
280
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
},
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"SplitInBatches": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Function1",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
],
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
}
]
]
},
"NoOp": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment