Sorry for the late response. The example below should do it. However, depending on the amount of data you have, you might hit the API’s rate limit. If that is the case, you need to use the split batches node with a delay.
For reference, the sheet that I used for testing looks as shown below.
Two things are needed to make the workflow work:
-
The property you receive in the webhook has to match the column’s name that you want to update (case sensitive). Note: To mockup the webhook data, I used the set node.
-
One column needs to be a unique id. In my example, it’s the email.
Example workflow
{
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
250,
300
]
},
{
"parameters": {
"values": {
"string": [
{
"name": "Price",
"value": "13"
}
]
},
"options": {}
},
"name": "Set",
"type": "n8n-nodes-base.set",
"typeVersion": 1,
"position": [
500,
300
],
"notesInFlow": true,
"notes": "Webhook Mockup"
},
{
"parameters": {
"authentication": "oAuth2",
"operation": "update",
"sheetId": "1I_jvGUOcEN1-2TSmg42pM57jF6GVLixvb-KPCoeXniw",
"keyRow": "={{$node[\"Function\"].json[\"index\"]}}",
"key": "Email",
"options": {}
},
"name": "Google Sheets1",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"position": [
1240,
240
],
"credentials": {
"googleSheetsOAuth2Api": "asasasasasas"
}
},
{
"parameters": {
"authentication": "oAuth2",
"sheetId": "1I_jvGUOcEN1-2TSmg42pM57jF6GVLixvb-KPCoeXniw",
"options": {}
},
"name": "Google Sheets2",
"type": "n8n-nodes-base.googleSheets",
"typeVersion": 1,
"position": [
500,
130
],
"credentials": {
"googleSheetsOAuth2Api": "asasasasasas"
}
},
{
"parameters": {
"mode": "multiplex"
},
"name": "Merge",
"type": "n8n-nodes-base.merge",
"typeVersion": 1,
"position": [
760,
240
]
},
{
"parameters": {
"functionCode": "for (let i = 0; i < items.length; i++) {\n items[i].json['index'] = i\n}\n\nreturn items;"
},
"name": "Function",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
970,
240
]
}
],
"connections": {
"Start": {
"main": [
[
{
"node": "Set",
"type": "main",
"index": 0
}
]
]
},
"Set": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Google Sheets2": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Function",
"type": "main",
"index": 0
}
]
]
},
"Function": {
"main": [
[
{
"node": "Google Sheets1",
"type": "main",
"index": 0
}
]
]
}
}
}