AutomationFlowsEmail & Gmail › Track Hdfc Credit Card Transactions with Google Sheets and Telegram…

Track Hdfc Credit Card Transactions with Google Sheets and Telegram…

Original n8n title: Track Hdfc Credit Card Transactions with Google Sheets and Telegram Notifications

ByKrishna Kumar Eswaran @mrprogrammer on n8n.io

🧠 Problem This Solves Managing credit card expenses can be tricky, especially when you want to stay transparent and keep your spouse in the loop. Most banks don't offer real-time notification sharing with family members, and manually updating expenses takes time and effort. This…

Event trigger★★★★☆ complexity9 nodesGmail TriggerTelegramGoogle Sheets
Email & Gmail Trigger: Event Nodes: 9 Complexity: ★★★★☆ Added:

This workflow corresponds to n8n.io template #4128 — we link there as the canonical source.

This workflow follows the Gmail Trigger → Google Sheets 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 →

Download .json
{
  "id": "bk0oFjAq1T2Rzn1g",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Credit Card Usage",
  "tags": [],
  "nodes": [
    {
      "id": "5895c8a5-1dc7-48aa-8560-6725a4bbb8d5",
      "name": "Gmail Trigger",
      "type": "n8n-nodes-base.gmailTrigger",
      "position": [
        -620,
        -20
      ],
      "parameters": {
        "filters": {
          "q": "from:HDFC Bank InstaAlerts <user@example.com>",
          "labelIds": [
            "CATEGORY_UPDATES"
          ]
        },
        "pollTimes": {
          "item": [
            {
              "mode": "everyX",
              "unit": "minutes",
              "value": 5
            }
          ]
        }
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "e027c004-85cb-49f7-a9bd-46873a7843e6",
      "name": "map used articls ids",
      "type": "n8n-nodes-base.code",
      "position": [
        80,
        -20
      ],
      "parameters": {
        "jsCode": "let values = $input.all().map(item => item.json.gmailId);\n\nreturn [\n    {\n      json: {\n        values: values\n      }\n    }\n  ];"
      },
      "typeVersion": 2
    },
    {
      "id": "bb293c78-a989-4273-98e0-3220e44aa259",
      "name": "filter only unused Ids",
      "type": "n8n-nodes-base.filter",
      "position": [
        300,
        -20
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "934a4ab8-bc6b-4d1b-b050-c1f19a03cc9f",
              "operator": {
                "type": "array",
                "operation": "notContains",
                "rightType": "any"
              },
              "leftValue": "={{ $('map used articls ids').item.json.values }}",
              "rightValue": "={{ $('Loop Over Items').item.json.id }}"
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "23746194-0eb7-4eab-92fb-ca77a7526d1f",
      "name": "sent notification to telegram to pavi",
      "type": "n8n-nodes-base.telegram",
      "position": [
        860,
        220
      ],
      "parameters": {
        "text": "=\ud83d\udcb3 *Transaction Alert*\n\n\ud83d\udcc5 *Date:* `{{ $json.Date }}`  \n\ud83d\udcb0 *Amount:* `\u20b9{{ $json.Amount }}`  \n\ud83c\udff7\ufe0f *Recipient:* `{{ $json.Recipient }}`  \n\ud83d\udd22 *UPI Reference No:* `{{ $json.UpiReference }}`",
        "chatId": "",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "13332e8c-92cd-4745-9533-c96ec5b480fc",
      "name": "Loop Over Items",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        -400,
        -20
      ],
      "parameters": {
        "options": {}
      },
      "typeVersion": 3
    },
    {
      "id": "956f1fd0-669f-41c8-bcd5-0b150f71fc38",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        -160,
        -20
      ],
      "parameters": {
        "options": {},
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fWshqrsS8A0ykEPasbvdH_U5KYqkfMvROXXnsQghHso",
          "cachedResultUrl": "",
          "cachedResultName": "UPI Usage"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5,
      "alwaysOutputData": true
    },
    {
      "id": "001a4f40-41bc-4b10-a5e9-186be2f954fa",
      "name": "Extract the required data from mail",
      "type": "n8n-nodes-base.code",
      "position": [
        520,
        -20
      ],
      "parameters": {
        "jsCode": "const message = $('Loop Over Items').first().json.snippet;\n\nconst amountMatch = message.match(/Rs\\.([\\d.,]+)/);\nconst recipientMatch = message.match(/to (.+?) on/);\nconst dateMatch = message.match(/on (\\d{2}-\\d{2}-\\d{2})/);\nconst referenceMatch = message.match(/UPI transaction reference number is (\\d+)/);\n\nconst amount = amountMatch ? amountMatch[1] : null;\nconst recipient = recipientMatch ? recipientMatch[1].trim() : null;\nconst date = dateMatch ? dateMatch[1] : null;\nconst upiReference = referenceMatch ? referenceMatch[1] : null;\n\nconsole.log(\"Amount:\", amount);       // 1260.00\nconsole.log(\"Recipient:\", recipient); // redbus3.payu@hdfcbank REDBUS IN\nconsole.log(\"Date:\", date);           // 16-05-25\n\nreturn [\n    {\n      json: {\n        Amount: amount,\n        Recipient:recipient,\n        Date:date,\n        UpiReference:upiReference\n      }\n    }\n  ];"
      },
      "typeVersion": 2
    },
    {
      "id": "9e368066-2a66-4a10-a852-8a6811c0f789",
      "name": "sent notification to telegram to krishna",
      "type": "n8n-nodes-base.telegram",
      "position": [
        840,
        -100
      ],
      "parameters": {
        "text": "=\ud83d\udcb3 *Transaction Alert*\n\n\ud83d\udcc5 *Date:* `{{ $json.Date }}`  \n\ud83d\udcb0 *Amount:* `\u20b9{{ $json.Amount }}`  \n\ud83c\udff7\ufe0f *Recipient:* `{{ $json.Recipient }}`  \n\ud83d\udd22 *UPI Reference No:* `{{ $json.UpiReference }}`",
        "chatId": "",
        "additionalFields": {
          "appendAttribution": false
        }
      },
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "1f6c1df5-cc69-4038-b9ee-5eca45002d6d",
      "name": "update the usage in sheet row",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1160,
        240
      ],
      "parameters": {
        "columns": {
          "value": {
            "date": "={{ $('Extract the required data from mail').first().json.Date }}",
            "amount": "={{ $('Extract the required data from mail').first().json.Amount }}",
            "gmailId": "={{ $('Loop Over Items').first().json.id}}",
            "Recipient": "={{ $('Extract the required data from mail').first().json.Recipient }}",
            "upiReference": "={{ $('Extract the required data from mail').first().json.UpiReference }}"
          },
          "schema": [
            {
              "id": "gmailId",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "gmailId",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "date",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "amount",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Recipient",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "Recipient",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "upiReference",
              "type": "string",
              "display": true,
              "removed": false,
              "required": false,
              "displayName": "upiReference",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "row_number",
              "type": "string",
              "display": true,
              "removed": false,
              "readOnly": true,
              "required": false,
              "displayName": "row_number",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [
            "row_number"
          ],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1fWshqrsS8A0ykEPasbvdH_U5KYqkfMvROXXnsQghHso",
          "cachedResultUrl": "",
          "cachedResultName": "UPI Usage"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.5
    }
  ],
  "active": true,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "a6d2ece2-4465-43ea-b1bc-46ecf3dcaad3",
  "connections": {
    "Gmail Trigger": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Sheets": {
      "main": [
        [
          {
            "node": "map used articls ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop Over Items": {
      "main": [
        [],
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "map used articls ids": {
      "main": [
        [
          {
            "node": "filter only unused Ids",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "filter only unused Ids": {
      "main": [
        [
          {
            "node": "Extract the required data from mail",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "update the usage in sheet row": {
      "main": [
        [
          {
            "node": "Loop Over Items",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract the required data from mail": {
      "main": [
        [
          {
            "node": "sent notification to telegram to krishna",
            "type": "main",
            "index": 0
          },
          {
            "node": "sent notification to telegram to pavi",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sent notification to telegram to pavi": {
      "main": [
        [
          {
            "node": "update the usage in sheet row",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "sent notification to telegram to krishna": {
      "main": [
        []
      ]
    }
  }
}

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.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

🧠 Problem This Solves Managing credit card expenses can be tricky, especially when you want to stay transparent and keep your spouse in the loop. Most banks don't offer real-time notification sharing with family members, and manually updating expenses takes time and effort. This…

Source: https://n8n.io/workflows/4128/ — original creator credit. Request a take-down →

More Email & Gmail workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

Email & Gmail

This workflow automates the processing of credit card statement emails from multiple banks. It extracts important payment details, stores them in Google Sheets, and creates calendar reminders in Googl

Google Sheets, Gmail Trigger, Google Calendar
Email & Gmail

AICARE Email Blast System. Uses googleDrive, httpRequest, googleSheets, gmail. Event-driven trigger; 39 nodes.

Google Drive, HTTP Request, Google Sheets +2
Email & Gmail

Telegram Code. Uses stickyNote, telegramTrigger, telegram, googleDrive. Event-driven trigger; 37 nodes.

Telegram Trigger, Telegram, Google Drive +2
Email & Gmail

Get notified if the actual data release is positive or negative for the relevant currency. Use the Telegram chat message about the news release as a trigger to open a trading position in MetaTrader 4.

Google Calendar Trigger, Airtop, Telegram +2
Email & Gmail

Instant enquiry/booking system. Uses telegramTrigger, googleSheets, telegram, gmail. Event-driven trigger; 28 nodes.

Telegram Trigger, Google Sheets, Telegram +1