This workflow corresponds to n8n.io template #4749 — we link there as the canonical source.
This workflow follows the Google Sheets → HTTP Request recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"id": "HHoQmMSal4U1i65J",
"name": "Yookassa",
"tags": [],
"nodes": [
{
"id": "0ccb2fd9-139a-4234-9e2b-feabf63563c5",
"name": "Respond Products",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
560,
40
],
"parameters": {
"options": {},
"respondWith": "allIncomingItems"
},
"retryOnFail": false,
"typeVersion": 1.3
},
{
"id": "cabb25e6-9683-4a4f-9832-7a7630a011bf",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
-180,
-40
],
"parameters": {
"color": 5,
"width": 1040,
"height": 400,
"content": "# Get Products"
},
"typeVersion": 1
},
{
"id": "88b5245c-bce9-44e7-beb7-172137d63d61",
"name": "Get products",
"type": "n8n-nodes-base.webhook",
"position": [
-120,
80
],
"parameters": {
"path": "products",
"options": {},
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "5a218b21-d7a7-4f4f-9883-6db1a994513b",
"name": "Sorting by price",
"type": "n8n-nodes-base.sort",
"position": [
340,
40
],
"parameters": {
"options": {},
"sortFieldsUi": {
"sortField": [
{
"fieldName": "price"
}
]
}
},
"typeVersion": 1
},
{
"id": "d3265cbe-dc41-49ee-9cdd-d265efefaa0c",
"name": "Handle Error (get product)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
560,
200
],
"parameters": {
"options": {
"responseCode": 400
},
"respondWith": "noData"
},
"typeVersion": 1.3
},
{
"id": "14fad20c-566a-4ce3-a4c3-a28922f2ceb1",
"name": "Get Product",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueErrorOutput",
"maxTries": 2,
"position": [
680,
500
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.product_id }}",
"lookupColumn": "product_id"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=0",
"cachedResultName": "products"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk",
"cachedResultName": "Yookassa"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6
},
{
"id": "5b619423-3a66-4ea8-bdc4-da49c5c55295",
"name": "YooKassa Request",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
1280,
500
],
"parameters": {
"url": "https://api.yookassa.ru/v3/payments",
"method": "POST",
"options": {},
"jsonBody": "={\n \"amount\": {\n \"value\": \"{{ $('Get Product').item.json.price }}.00\",\n \"currency\": \"RUB\"\n },\n \"capture\": true,\n \"metadata\": {\"email\": \"{{ $('Payment').item.json.body.email }}\"},\n \"confirmation\": {\n \"type\": \"redirect\",\n \"locale\": \"ru_RU\",\n \"return_url\": \"{{ $('Payment').item.json.body.return_url }}\"\n },\n \"description\": \"{{ $('Get Product').item.json.title.replace(/\"/g, '\\\\\"') }}\",\n \"receipt\": {\n \"email\": \"{{ $('Payment').item.json.body.email }}\",\n \"items\": [\n {\n \"description\": \"{{ $('Get Product').item.json.title.replace(/\"/g, '\\\\\"') }}\",\n \"quantity\": \"1\",\n \"amount\": {\n \"value\": \"{{ $('Get Product').item.json.price }}.00\",\n \"currency\": \"RUB\"\n },\n \"vat_code\": 1\n }\n ]\n }\n} ",
"sendBody": true,
"sendHeaders": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth",
"headerParameters": {
"parameters": [
{
"name": "Idempotence-Key",
"value": "={{ $json.data }}"
},
{
"name": "Content-Type",
"value": "application/json"
}
]
}
},
"credentials": {
"httpBasicAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "a56d477f-af9b-40a1-ba6c-5d28d11b4f8d",
"name": "Save Order",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueErrorOutput",
"maxTries": 2,
"position": [
1480,
500
],
"parameters": {
"columns": {
"value": {
"id": "={{ $json.id }}",
"email": "={{ $json.metadata.email }}",
"product_id": "={{ $('Get product_id').item.json.product_id }}",
"order_datetime": "={{ $json.created_at }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "id",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "product_id",
"type": "string",
"display": true,
"required": false,
"displayName": "product_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "order_datetime",
"type": "string",
"display": true,
"required": false,
"displayName": "order_datetime",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1924940864,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1924940864",
"cachedResultName": "orders"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk",
"cachedResultName": "Yookassa"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6
},
{
"id": "241307e3-9536-404c-aa27-6e21bb5424c0",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
-180,
400
],
"parameters": {
"color": 5,
"width": 2140,
"height": 480,
"content": "# Payment"
},
"typeVersion": 1
},
{
"id": "830a9d53-1e6a-4293-8440-7aa73edbd2f8",
"name": "Payment",
"type": "n8n-nodes-base.webhook",
"position": [
-120,
600
],
"parameters": {
"path": "payment",
"options": {
"rawBody": true
},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "7dedf78b-414f-421f-97af-6e5ab87fdec4",
"name": "Check request values",
"type": "n8n-nodes-base.if",
"position": [
80,
600
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2728d695-e20d-41f0-9357-14e027c756ce",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.product_id }}",
"rightValue": ""
},
{
"id": "00a85085-1715-44d6-84ec-7cc10c16c046",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.email }}",
"rightValue": ""
},
{
"id": "8fa8951d-d1df-46f1-88da-cfe0680af42c",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.return_url }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "84c0764f-6496-4047-bd34-593b722560f1",
"name": "Email validation",
"type": "n8n-nodes-base.if",
"position": [
280,
520
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d70fb2cf-7e73-4853-bbeb-e310eb656c64",
"operator": {
"type": "string",
"operation": "regex"
},
"leftValue": "={{ $json.body.email }}",
"rightValue": "^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$"
}
]
}
},
"typeVersion": 2.2
},
{
"id": "9090fbcf-96c9-4f53-b13a-0fa471435052",
"name": "Get product_id",
"type": "n8n-nodes-base.set",
"position": [
480,
500
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "b8ecf70e-20c0-4513-a168-6cd1f2d5f3a6",
"name": "product_id",
"type": "string",
"value": "={{ $json.body.product_id }}"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "ad49466c-6ad4-411c-9c67-8a3e066d5359",
"name": "Check product_id",
"type": "n8n-nodes-base.if",
"position": [
880,
500
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a8274ea7-f8e8-4ed5-9f40-5e3cc18ed852",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $input.item.json }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "b1bca082-6fbe-42e8-9602-4a31c86a82c6",
"name": "Handle Error (product_id)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1080,
680
],
"parameters": {
"options": {
"responseCode": 404
},
"respondWith": "text",
"responseBody": "product_id not found"
},
"typeVersion": 1.3
},
{
"id": "913b424e-fceb-4435-820b-59efe11083a3",
"name": "Idempotence Key Generation",
"type": "n8n-nodes-base.code",
"position": [
1080,
500
],
"parameters": {
"jsCode": "const template = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx';\n let uuid = '';\n\n for (let i = 0; i < template.length; i++) {\n const char = template[i];\n\n if (char === 'x' || char === 'y') {\n const rand = Math.floor(Math.random() * 16);\n let value;\n\n if (char === 'x') {\n value = rand;\n } else {\n value = (rand & 0x3) | 0x8;\n }\n\n uuid += value.toString(16);\n } else {\n uuid += char;\n }\n }\n\n return {\n data: uuid\n }"
},
"typeVersion": 2
},
{
"id": "f5bc3ad6-8599-4ed1-a501-bc2c1507fa73",
"name": "Handle Error",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
480,
680
],
"parameters": {
"options": {
"responseCode": 400
},
"respondWith": "text",
"responseBody": "Bad request"
},
"typeVersion": 1.3
},
{
"id": "4b6d62b9-3ac3-4cc8-944a-64372a8aaa80",
"name": "Handle Error (yookassa)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1480,
680
],
"parameters": {
"options": {
"responseCode": 400
},
"respondWith": "text",
"responseBody": "Bad request"
},
"typeVersion": 1.3
},
{
"id": "12568776-4885-46ac-a831-35d56207bb95",
"name": "Handle Error (save order)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1700,
680
],
"parameters": {
"options": {
"responseCode": 400
},
"respondWith": "noData"
},
"typeVersion": 1.3
},
{
"id": "d1032cdb-c456-45b0-a534-14ed920228b6",
"name": "Respond Payment",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1700,
500
],
"parameters": {
"options": {
"responseCode": 200
},
"respondWith": "json",
"responseBody": "={{ {confirmation_url:$('YooKassa Request').item.json.confirmation.confirmation_url} }}"
},
"typeVersion": 1.3
},
{
"id": "52b428e6-521c-4b22-b41e-ed96971f5ecf",
"name": "Handle Error (get product)_1",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
880,
680
],
"parameters": {
"options": {
"responseCode": 400
},
"respondWith": "noData"
},
"typeVersion": 1.3
},
{
"id": "46193f6f-577b-4872-a11c-22b7e2f1ff61",
"name": "Get Order",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueErrorOutput",
"maxTries": 2,
"position": [
480,
1000
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.body.object.id }}",
"lookupColumn": "id"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1924940864,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1924940864",
"cachedResultName": "orders"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk",
"cachedResultName": "Yookassa"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"executeOnce": false,
"retryOnFail": true,
"typeVersion": 4.6
},
{
"id": "d5abfe86-2462-4299-a84f-18006879ba81",
"name": "Save Transaction",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueRegularOutput",
"maxTries": 2,
"position": [
880,
1000
],
"parameters": {
"columns": {
"value": {
"id": "={{ $('Handle YooKassa webhook').item.json.body.object.id }}",
"email": "={{ $('Handle YooKassa webhook').item.json.body.object.metadata.email }}",
"product_id": "={{ $json.product_id }}",
"transaction_status": "succeeded",
"transaction_datetime": "={{ $('Handle YooKassa webhook').item.json.body.object.captured_at }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "id",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "product_id",
"type": "string",
"display": true,
"required": false,
"displayName": "product_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "transaction_datetime",
"type": "string",
"display": true,
"required": false,
"displayName": "transaction_datetime",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "transaction_status",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "transaction_status",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "append",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1976749998,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1976749998",
"cachedResultName": "transactions"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk",
"cachedResultName": "Yookassa"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6
},
{
"id": "081a8ec1-01ba-4ce6-811d-d527060e73f6",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
-180,
920
],
"parameters": {
"color": 5,
"width": 1520,
"height": 620,
"content": "# Webhook"
},
"typeVersion": 1
},
{
"id": "4c7ad01d-314e-463a-b499-e05a4628f8d9",
"name": "Handle Events",
"type": "n8n-nodes-base.switch",
"position": [
80,
1180
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "payment.succeeded",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "71f1d0c7-e46c-40e5-8d49-2bf17c5a8582",
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.event }}",
"rightValue": "payment.succeeded"
}
]
},
"renameOutput": true
},
{
"outputKey": "refund.succeeded",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "bec8e08e-83fd-49f0-968a-ada7772e3a46",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.body.event }}",
"rightValue": "refund.succeeded"
}
]
},
"renameOutput": true
}
]
},
"options": {
"ignoreCase": true
}
},
"typeVersion": 3.2
},
{
"id": "5eb6b856-c62b-4781-a7cd-728f9e43b0aa",
"name": "Validation metadata",
"type": "n8n-nodes-base.if",
"position": [
280,
1000
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a8f8592e-683e-463b-9bd4-9d15eb685e46",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.object.id }}",
"rightValue": ""
},
{
"id": "3115f67e-c0ea-4ef7-9eb7-67a1e628b038",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.object.metadata.email }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e0670c19-ac44-4d10-ae8f-8f324f209b0c",
"name": "Check Order",
"type": "n8n-nodes-base.if",
"position": [
680,
1000
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "9c2238c4-c3ec-4d0c-8892-86169bc8fdef",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $input.item.json }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "f5436549-a2c8-4b1c-bc09-1a7902afe8be",
"name": "Validation metadata_",
"type": "n8n-nodes-base.if",
"position": [
280,
1360
],
"parameters": {
"options": {
"ignoreCase": true
},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": false,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "a8f8592e-683e-463b-9bd4-9d15eb685e46",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.body.object.id }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "e2f00535-bf29-43b5-9eac-a8e5ee6c3ab9",
"name": "Get transaction",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueErrorOutput",
"maxTries": 2,
"position": [
480,
1360
],
"parameters": {
"options": {},
"filtersUI": {
"values": [
{
"lookupValue": "={{ $json.body.object.id }}",
"lookupColumn": "id"
}
]
},
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1976749998,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1976749998",
"cachedResultName": "transactions"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk",
"cachedResultName": "Yookassa"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6
},
{
"id": "24016b43-795b-4c7b-ad9b-9d9d220cdeef",
"name": "Respond payment event",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1080,
1000
],
"parameters": {
"options": {
"responseCode": 200
},
"respondWith": "noData"
},
"typeVersion": 1.3
},
{
"id": "64aa9833-522e-41b0-bb78-454d1122eb71",
"name": "Respond refund event",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
1080,
1360
],
"parameters": {
"options": {
"responseCode": 200
},
"respondWith": "noData"
},
"typeVersion": 1.3
},
{
"id": "984ac85d-5cae-4b57-8ce7-c61c6a12ceef",
"name": "Handle Error webhook",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
880,
1180
],
"parameters": {
"options": {
"responseCode": 200
},
"respondWith": "noData"
},
"typeVersion": 1.3
},
{
"id": "cf3937fa-e0ee-4d5c-b9b9-4a575f895122",
"name": "Status",
"type": "n8n-nodes-base.webhook",
"position": [
-120,
1720
],
"parameters": {
"path": "status/:id",
"options": {},
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "100e8560-78b2-40a8-ac20-82f8bb16138e",
"name": "Handle Error status",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
480,
1900
],
"parameters": {
"options": {
"responseCode": "={{ $json.error.status }}"
},
"respondWith": "text",
"responseBody": "={{ $json.error.message }}"
},
"typeVersion": 1.3
},
{
"id": "e943aec6-962f-444d-811c-7975e12fad20",
"name": "Handle Error (check request)",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
280,
1900
],
"parameters": {
"options": {
"responseCode": 400
},
"respondWith": "noData"
},
"typeVersion": 1.3
},
{
"id": "eb076097-abc8-46b3-b983-31918d96e284",
"name": "Check request values_1",
"type": "n8n-nodes-base.if",
"position": [
80,
1720
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "8fa8951d-d1df-46f1-88da-cfe0680af42c",
"operator": {
"type": "string",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $json.params.id }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
},
{
"id": "4d1b91e0-0b28-4fea-a5ad-ee10a2f7c238",
"name": "YooKassa Request Status",
"type": "n8n-nodes-base.httpRequest",
"onError": "continueErrorOutput",
"position": [
280,
1720
],
"parameters": {
"url": "=https://api.yookassa.ru/v3/payments/{{ $('Status').item.json.params.id }}",
"options": {},
"authentication": "genericCredentialType",
"genericAuthType": "httpBasicAuth"
},
"credentials": {
"httpBasicAuth": {
"name": "<your credential>"
}
},
"typeVersion": 4.2
},
{
"id": "bf520270-5b44-48f7-a891-cf1394df64ad",
"name": "Respond status",
"type": "n8n-nodes-base.respondToWebhook",
"position": [
480,
1720
],
"parameters": {
"options": {
"responseCode": 200
},
"respondWith": "json",
"responseBody": "={\n \"id\": \"{{ $json.id }}\",\n \"status\": \"{{ $json.status }}\",\n \"description\": {{ $json.description }}\n} "
},
"typeVersion": 1.3
},
{
"id": "b0f5195c-ffb7-4af6-8fbf-04eeeca5eafd",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
-180,
1580
],
"parameters": {
"color": 5,
"width": 960,
"height": 500,
"content": "# Status"
},
"typeVersion": 1
},
{
"id": "b3821373-2948-412e-b9e5-f52c5c707512",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
-920,
-40
],
"parameters": {
"color": 5,
"width": 700,
"height": 2460,
"content": "# Accept YooKassa payments and log transactions in Google Sheets\n\n## \ud83e\uddfe Summary\n\nThis workflow allows you to accept online payments via **YooKassa** and log both orders and transactions in **Google Sheets** \u2014 all without writing a single line of code. It supports full payment flow: product selection, payment initiation, webhook processing, refund updates, and payment status checks.\n\n## \ud83d\udc65 Who is this for?\n\nThis template is ideal for:\n\n* Online stores with simple checkout flows\n* Sellers of digital products or info-courses\n* Entrepreneurs using Telegram bots or web forms\n* Anyone needing quick payment integration with Google Sheets tracking\n\n## \ud83c\udfaf What problem does this workflow solve?\n\nSetting up online payments usually requires backend infrastructure. This no-code solution automates the entire payment flow:\n\n* Handles product listing and price retrieval\n* Initiates payments with email and return URL\n* Listens for `payment.succeeded` and `refund.succeeded` events\n* Records every action into structured Google Sheets\n\n## \u2699\ufe0f What this workflow does\n\n### 1. **GET /products**\n\nReturns a sorted list of products from a Google Sheet (`products`).\n\n### 2. **POST /payment**\n\n* Validates required fields (`product_id`, `email`, `return_url`)\n* Checks email format\n* Fetches product data from `products`\n* Generates a unique idempotence key\n* Sends a request to YooKassa API\n* Saves the order into the `orders` sheet\n* Returns a payment confirmation link\n\n### 3. **POST /yoomoney**\n\nWebhook to process payment/refund events:\n\n* On `payment.succeeded`, adds entry to `transactions`\n* On `refund.succeeded`, updates transaction status\n\n### 4. **GET /status/\\:id**\n\nReturns real-time payment status from YooKassa\n\n## \ud83d\ude80 Setup\n\n1. **Connect credentials:**\n\n * Google Sheets (OAuth2)\n * YooKassa (Basic Auth using `shopId` and `secretKey`)\n\n2. **Update the following Google Sheets:**\n\n * `products`: should contain `product_id`, `title`, `price`\n * `orders`: for saving confirmed purchases\n * `transactions`: for logging all successful or refunded payments\n\n3. **Test endpoints using any HTTP client**:\n\nExample payload for `/payment`:\n\n```json\n{\n \"product_id\": \"abc123\",\n \"email\": \"user@example.com\",\n \"return_url\": \"https://your.site/success\"\n}\n```\n\n## \ud83d\udd27 How to customize this workflow\n\n* Add delivery logic (e.g., email with product link after successful payment)\n* Replace Google Sheets with a database (e.g., PostgreSQL)\n* Connect Telegram or other messengers for post-payment notifications\n* Add promo codes, discounts, or subscriptions logic\n\n## \ud83d\udcbc Use cases\n\n* Simple online checkouts\n* Telegram bots selling access\n* Educational product sales\n* MVP e-commerce flows\n* Donation or membership payments\n\n## \ud83d\udcce Notes\n\n\u2705 Includes Sticky Notes for sections\n\u2705 Includes error handling and validation\n\u2705 No custom code needed except UUID generation"
},
"typeVersion": 1
},
{
"id": "966a7de7-af56-4780-afba-e55f1ac10375",
"name": "Get products_1",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueErrorOutput",
"maxTries": 2,
"position": [
100,
80
],
"parameters": {
"options": {},
"sheetName": {
"__rl": true,
"mode": "list",
"value": "gid=0",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=0",
"cachedResultName": "products"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk",
"cachedResultName": "Yookassa"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6
},
{
"id": "f26e5f4f-39f8-4345-b2b3-bbae0740c9a7",
"name": "Handle YooKassa webhook",
"type": "n8n-nodes-base.webhook",
"position": [
-120,
1180
],
"parameters": {
"path": "yoomoney",
"options": {
"rawBody": true
},
"httpMethod": "POST",
"responseMode": "responseNode"
},
"typeVersion": 2
},
{
"id": "d7c1eebc-3a26-49bf-ac98-ebe60a8127ca",
"name": "Update refund status",
"type": "n8n-nodes-base.googleSheets",
"onError": "continueRegularOutput",
"maxTries": 2,
"position": [
880,
1360
],
"parameters": {
"columns": {
"value": {
"id": "{{ $json.body.object.id }}",
"transaction_status": "refund"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"required": false,
"displayName": "id",
"defaultMatch": true,
"canBeUsedToMatch": true
},
{
"id": "email",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "email",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "product_id",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "product_id",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "transaction_datetime",
"type": "string",
"display": true,
"removed": true,
"required": false,
"displayName": "transaction_datetime",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "transaction_status",
"type": "string",
"display": true,
"required": false,
"displayName": "transaction_status",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "row_number",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "row_number",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"sheetName": {
"__rl": true,
"mode": "list",
"value": 1976749998,
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit#gid=1976749998",
"cachedResultName": "transactions"
},
"documentId": {
"__rl": true,
"mode": "list",
"value": "1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE",
"cachedResultUrl": "https://docs.google.com/spreadsheets/d/1OkaZTGWiTvX_qiQbRcMJKxUjXv0t6-IQtGm5crY0CXE/edit?usp=drivesdk",
"cachedResultName": "Yookassa"
}
},
"credentials": {
"googleSheetsOAuth2Api": {
"name": "<your credential>"
}
},
"retryOnFail": true,
"typeVersion": 4.6
},
{
"id": "2bf0aa18-1542-44d8-a198-7b0e024a1717",
"name": "Check if transaction exists",
"type": "n8n-nodes-base.if",
"position": [
680,
1360
],
"parameters": {
"options": {},
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "63373f12-84c3-4d9a-8356-09cc8b449361",
"operator": {
"type": "object",
"operation": "exists",
"singleValue": true
},
"leftValue": "={{ $input.item.json }}",
"rightValue": ""
}
]
}
},
"typeVersion": 2.2
}
],
"active": false,
"settings": {
"executionOrder": "v1"
},
"versionId": "b8225bd6-2191-48d1-8e9b-7c11681bf6a0",
"connections": {
"Status": {
"main": [
[
{
"node": "Check request values_1",
"type": "main",
"index": 0
}
]
]
},
"Payment": {
"main": [
[
{
"node": "Check request values",
"type": "main",
"index": 0
}
]
]
},
"Get Order": {
"main": [
[
{
"node": "Check Order",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error webhook",
"type": "main",
"index": 0
}
]
]
},
"Save Order": {
"main": [
[
{
"node": "Respond Payment",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error (save order)",
"type": "main",
"index": 0
}
]
]
},
"Check Order": {
"main": [
[
{
"node": "Save Transaction",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error webhook",
"type": "main",
"index": 0
}
]
]
},
"Get Product": {
"main": [
[
{
"node": "Check product_id",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error (get product)_1",
"type": "main",
"index": 0
}
]
]
},
"Get products": {
"main": [
[
{
"node": "Get products_1",
"type": "main",
"index": 0
}
]
]
},
"Handle Events": {
"main": [
[
{
"node": "Validation metadata",
"type": "main",
"index": 0
}
],
[
{
"node": "Validation metadata_",
"type": "main",
"index": 0
}
]
]
},
"Get product_id": {
"main": [
[
{
"node": "Get Product",
"type": "main",
"index": 0
}
]
]
},
"Get products_1": {
"main": [
[
{
"node": "Sorting by price",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error (get product)",
"type": "main",
"index": 0
}
]
]
},
"Get transaction": {
"main": [
[
{
"node": "Check if transaction exists",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error webhook",
"type": "main",
"index": 0
}
]
]
},
"Check product_id": {
"main": [
[
{
"node": "Idempotence Key Generation",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error (product_id)",
"type": "main",
"index": 0
}
]
]
},
"Email validation": {
"main": [
[
{
"node": "Get product_id",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error",
"type": "main",
"index": 0
}
]
]
},
"Save Transaction": {
"main": [
[
{
"node": "Respond payment event",
"type": "main",
"index": 0
}
]
]
},
"YooKassa Request": {
"main": [
[
{
"node": "Save Order",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error (yookassa)",
"type": "main",
"index": 0
}
]
]
},
"Sorting by price": {
"main": [
[
{
"node": "Respond Products",
"type": "main",
"index": 0
}
]
]
},
"Validation metadata": {
"main": [
[
{
"node": "Get Order",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error webhook",
"type": "main",
"index": 0
}
]
]
},
"Check request values": {
"main": [
[
{
"node": "Email validation",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error",
"type": "main",
"index": 0
}
]
]
},
"Update refund status": {
"main": [
[
{
"node": "Respond refund event",
"type": "main",
"index": 0
}
]
]
},
"Validation metadata_": {
"main": [
[
{
"node": "Get transaction",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error webhook",
"type": "main",
"index": 0
}
]
]
},
"Check request values_1": {
"main": [
[
{
"node": "YooKassa Request Status",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error (check request)",
"type": "main",
"index": 0
}
]
]
},
"Handle YooKassa webhook": {
"main": [
[
{
"node": "Handle Events",
"type": "main",
"index": 0
}
]
]
},
"YooKassa Request Status": {
"main": [
[
{
"node": "Respond status",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error status",
"type": "main",
"index": 0
}
]
]
},
"Idempotence Key Generation": {
"main": [
[
{
"node": "YooKassa Request",
"type": "main",
"index": 0
}
]
]
},
"Check if transaction exists": {
"main": [
[
{
"node": "Update refund status",
"type": "main",
"index": 0
}
],
[
{
"node": "Handle Error webhook",
"type": "main",
"index": 0
}
]
]
}
}
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
googleSheetsOAuth2ApihttpBasicAuth
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
This workflow allows you to accept online payments via YooKassa and log both orders and transactions in Google Sheets — all without writing a single line of code. It supports full payment flow: product selection, payment initiation, webhook processing, refund updates, and…
Source: https://n8n.io/workflows/4749/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
[SANTOBET] FLUXO TODO - BACKUP. Uses googleSheets, httpRequest, googleSheetsTrigger. Webhook trigger; 57 nodes.
FLUXO DISPARO DATA E HORA. Uses itemLists, googleSheets, httpRequest. Webhook trigger; 48 nodes.
Transform your n8n instance management with this advanced automation system featuring artificial intelligence-driven workflow selection. This template provides comprehensive maintenance operations wit
Enrich any list of people with verified contact info using this workflow. This n8n automation scrapes TruePeopleSearch using Zyte's extraction API to safely bypass bot protection and extract detailed
Convalidaciones Académicas - Estructura Base. Uses googleSheets, emailSend, googleDrive, httpRequest. Webhook trigger; 35 nodes.