Hi Miquel, thank you so much. Here it is, hopefully it makes more sense to you!
{
“nodes”: [
{
“parameters”: {
“updates”: [
“message”
],
“additionalFields”: {}
},
“type”: “n8n-nodes-base.telegramTrigger”,
“typeVersion”: 1.1,
“position”: [
-460,
-40
],
“id”: “d2b21554-b8dd-4614-8f66-1cb085e345b8”,
“name”: “Telegram Trigger”,
“webhookId”: “def7ee7f-dc31-40dc-b1aa-3a6c3ef76d78”,
“credentials”: {
“telegramApi”: {
“id”: “Y7k0xL2fodbrvjCN”,
“name”: “Telegram account”
}
}
},
{
“parameters”: {
“rules”: {
“values”: [
{
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “loose”,
“version”: 2
},
“conditions”: [
{
“leftValue”: “={{ $node["Telegram Trigger"].json["message"]["text"] }}\n\n”,
“rightValue”: “=Invoice”,
“operator”: {
“type”: “string”,
“operation”: “contains”
},
“id”: “b610fd96-6046-4489-afc4-6e0244d5bba6”
}
],
“combinator”: “and”
},
“renameOutput”: true,
“outputKey”: “1”
}
]
},
“looseTypeValidation”: true,
“options”: {}
},
“type”: “n8n-nodes-base.switch”,
“typeVersion”: 3.2,
“position”: [
-240,
-40
],
“id”: “0d99ff4f-868e-4f80-b506-397dbe1cae43”,
“name”: “Switch”,
“alwaysOutputData”: true
},
{
“parameters”: {
“operation”: “append”,
“documentId”: {
“__rl”: true,
“value”: “https://docs.google.com/spreadsheets/d/1oab8-G4UfLzgzelzlkJWLUTMorMFksMzn_0nZf5a3wA/edit”,
“mode”: “url”
},
“sheetName”: {
“__rl”: true,
“value”: “State”,
“mode”: “name”
},
“columns”: {
“mappingMode”: “defineBelow”,
“value”: {
“User ID”: “{{ $("Set Initial").json["user_id"] }}”,
“Job ID”: “{{ $("Set Initial").json["job_id"] }}”,
“Step”: “{{ $("Set Initial").json["step"] }}”,
“Name”: “{{ $("Set Initial").json["name"] }}”,
“Amount”: “{{ $("Set Initial").json["amount"] }}”
},
“matchingColumns”: ,
“schema”: [
{
“id”: “User ID”,
“displayName”: “User ID”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “Job ID”,
“displayName”: “Job ID”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “Step”,
“displayName”: “Step”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “Name”,
“displayName”: “Name”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “Amount”,
“displayName”: “Amount”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
},
{
“id”: “Email”,
“displayName”: “Email”,
“required”: false,
“defaultMatch”: false,
“display”: true,
“type”: “string”,
“canBeUsedToMatch”: true,
“removed”: false
}
],
“attemptToConvertTypes”: false,
“convertFieldsToString”: false
},
“options”: {}
},
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 4.5,
“position”: [
420,
-40
],
“id”: “90cc4be2-f280-425f-b734-2eb2acef920a”,
“name”: “Save State”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “Ute04etYCFbArbJ7”,
“name”: “Google Sheets account”
}
}
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “43c7e452-1fa1-4267-b825-29f2bc7266b2”,
“name”: “user_id”,
“value”: “={{ $node["Telegram Trigger"].json["chat"]["id"] }}”,
“type”: “string”
},
{
“id”: “59f92845-9bd5-4e56-aa91-91f073ce4692”,
“name”: “job_id”,
“value”: “={{ Date.now() }}”,
“type”: “string”
},
{
“id”: “b53948ce-6e4a-41d4-b3cf-f2230578a7b1”,
“name”: “step”,
“value”: “waiting_email”,
“type”: “string”
},
{
“id”: “c9ee1ba9-ad1f-4e09-a7a2-a79a23023952”,
“name”: “name”,
“value”: “={{ $node["Telegram Trigger"].json["message"]["text"].split(" ")[1] }}”,
“type”: “string”
},
{
“id”: “10cd5213-ebe9-4d2c-a95b-7c9e2bf3abc0”,
“name”: “amount”,
“value”: “={{ $node["Telegram Trigger"].json["message"]["text"].split(" ")[2] }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
-20,
-40
],
“id”: “2077163e-5bc6-461b-bfd8-693938bb18bc”,
“name”: “Set Initial”
}
],
“connections”: {
“Telegram Trigger”: {
“main”: [
[
{
“node”: “Switch”,
“type”: “main”,
“index”: 0
}
]
]
},
“Switch”: {
“main”: [
[
{
“node”: “Set Initial”,
“type”: “main”,
“index”: 0
}
]
]
},
“Set Initial”: {
“main”: [
[
{
“node”: “Save State”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “702b787e48994cf9fb70bdb3408d7efb00601b2a7ae1fab75f4c4c7a2a703675”
}
}