@Jakob_Tiebel just add the api key. Once the fix to the get:all is released, this will not be needed anymore.
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
360,
300
]
},
{
"parameters": {},
"name": "NoOp",
"type": "n8n-nodes-base.noOp",
"typeVersion": 1,
"position": [
1060,
290
]
},
{
"parameters": {
"conditions": {
"string": [],
"boolean": [
{
"value1": "={{$node[\"HTTP Request1\"].json[\"paging\"] ? true : false}}",
"value2": true
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
660,
600
]
},
{
"parameters": {
"functionCode": "\nlet next = 'https://api.hubapi.com/crm/v3/objects/contacts'\n\nif (items[0].json.next) {\n next = items[0].json.next\n}\n\nreturn [\n {\n json: {\n next : next\n }\n }\n]"
},
"name": "Function1",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
660,
290
]
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "next",
"value": "={{$node[\"HTTP Request1\"].json[\"paging\"][\"next\"][\"link\"]}}"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
860,
540
],
"executeOnce": true
},
{
"parameters": {
"functionCode": "return new Promise((resolve, reject) => {\n setTimeout(() => { resolve([{ json: {} }]) }, 1000);\n })\n"
},
"name": "Wait",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1260,
290
]
},
{
"parameters": {
"functionCode": "const allData = []\n\nlet counter = 0;\ndo {\n try {\n const items = $items(\"HTTP Request\", 0, counter).map(item => item.json.contacts);\n \n const aja = items[0].map(item => {\n return { json: item }\n }) \n \n allData.push.apply(allData, aja);\n //allData.push($items(\"Increment\", 0, counter));\n } catch (error) {\n return allData; \n }\n\n counter++;\n} while(true);\n\n"
},
"name": "Function2",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
890,
730
]
},
{
"parameters": {
"url": "={{$node[\"Function1\"].json[\"next\"]}}",
"jsonParameters": true,
"options": {},
"queryParametersJson": "={\"property\": [\"mobilephone\", \"firstname\", \"lastname\", \"address\"], \"hapikey\": \"key\"}"
},
"name": "HTTP Request1",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
860,
290
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Function1",
"type": "main",
"index": 0
}
]
]
},
"NoOp": {
"main": [
[
{
"node": "Wait",
"type": "main",
"index": 0
}
]
]
},
"IF": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
],
[
{
"node": "Function2",
"type": "main",
"index": 0
}
]
]
},
"Function1": {
"main": [
[
{
"node": "HTTP Request1",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Function1",
"type": "main",
"index": 0
}
]
]
},
"Wait": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"HTTP Request1": {
"main": [
[
{
"node": "NoOp",
"type": "main",
"index": 0
}
]
]
}
}
}