Hi @arsalagrey
This is Miquel from uProc. Thank you for using the service.
Your workflow makes sense but must be changed a bit. The usual behaviour is the next one:
- Recover companies from Baserow.
- Start SplitInBatches (I recommend Batchsize = 1).
- Query uProc to get Emails by domain. You need company domain or website. If not available, you need to get domain using one of these tools: “Company/Get company by name” or “Company/Get company domain by name” before.
- Set data for updating company in Baserow
- Save company
- If node: checks if there are more items in your Batch (use noItemsLeft context property). If no more items, finish workflow, otherwise, send flow to SplitInBatches node.
I share modified workflow:
{
"name": "test_baserow",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
-700,
590
]
},
{
"parameters": {
"conditions": {
"boolean": [
{
"value1": "={{$json[\"emailExists\"]}}",
"value2": "=true"
}
]
}
},
"name": "IF",
"type": "n8n-nodes-base.if",
"typeVersion": 1,
"position": [
520,
280
]
},
{
"parameters": {
"keepOnlySet": true,
"values": {
"string": [
{
"name": "genericEmail",
"value": "={{$json[\"message\"][\"generic\"]}}"
},
{
"name": "personalEmail",
"value": "={{$json[\"message\"][\"personal\"]}}"
},
{
"name": "companyId",
"value": "={{$node[\"Fetch Sponsors Company Rows\"].json[\"results\"][0][\"id\"]}}"
}
],
"boolean": [
{
"name": "emailExists",
"value": "={{$json[\"result\"]}}"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
130,
590
]
},
{
"parameters": {
"authentication": "headerAuth",
"url": "=https://api.baserow.io/api/database/rows/table/8732/",
"options": {},
"queryParametersUi": {
"parameter": [
{
"name": "filter__field_39738__empty",
"value": "true"
},
{}
]
}
},
"name": "Fetch Sponsors Company Rows",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
-510,
590
],
"credentials": {
"httpHeaderAuth": "Baserow Org"
}
},
{
"parameters": {
"requestMethod": "PATCH",
"url": "=https://api.baserow.io/api/database/rows/table/8732/{{}}/",
"options": {},
"bodyParametersUi": {
"parameter": [
{
"name": "field_39738"
}
]
}
},
"name": "Update Company Baserow With Email",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
360,
590
]
},
{
"parameters": {
"batchSize": "={{$json[\"count\"]}}",
"options": {}
},
"name": "SplitInBatches",
"type": "n8n-nodes-base.splitInBatches",
"typeVersion": 1,
"position": [
-260,
590
]
},
{
"parameters": {
"tool": "getEmailListByDomain",
"domain": "=warwickesports.com",
"additionalOptions": {}
},
"name": "Get Emails By Domain",
"type": "n8n-nodes-base.uproc",
"typeVersion": 1,
"position": [
-50,
590
],
"credentials": {
"uprocApi": "uProc Prod"
}
}
],
"connections": {
"IF": {
"main": [
[],
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Update Company Baserow With Email",
"type": "main",
"index": 0
}
]
]
},
"Fetch Sponsors Company Rows": {
"main": [
[
{
"node": "SplitInBatches",
"type": "main",
"index": 0
}
]
]
},
"Update Company Baserow With Email": {
"main": [
[
{
"node": "IF",
"type": "main",
"index": 0
}
]
]
},
"SplitInBatches": {
"main": [
[
{
"node": "Get Emails By Domain",
"type": "main",
"index": 0
}
]
]
},
"Start": {
"main": [
[
{
"node": "Fetch Sponsors Company Rows",
"type": "main",
"index": 0
}
]
]
},
"Get Emails By Domain": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {},
"id": "178"
}
Let me know if this works for you or if you have any other doubt.