{
  "createdAt": "2026-04-11T08:12:06.364Z",
  "updatedAt": "2026-04-11T10:59:23.000Z",
  "id": "S6up9GweTIMifCbO",
  "name": "Transaction Notifier (Schedule 3s)",
  "active": true,
  "nodes": [
    {
      "parameters": {
        "operation": "getAll",
        "limit": 10,
        "simple": false,
        "filters": {
          "q": "label:dbs-notif-not-notified from:ibanking.alert@dbs.com"
        },
        "options": {}
      },
      "id": "gmail-get-id",
      "name": "Gmail (Get Many)",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        240,
        -200
      ],
      "webhookId": "01abd7a0-4bed-4733-963d-75f8cbe5d35b",
      "credentials": {
        "gmailOAuth2": {
          "id": "4cC81xDT2RiJQdSB",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "operation": "get",
        "messageId": "={{ $json.id }}",
        "simple": false,
        "options": {}
      },
      "id": "gmail-get-single-id",
      "name": "Gmail (Get Single)",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        500,
        -200
      ],
      "webhookId": "64859c55-384f-4f83-bea2-6a4cf84bb0a9",
      "credentials": {
        "gmailOAuth2": {
          "id": "4cC81xDT2RiJQdSB",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const items = $input.all();\nif (items.length === 0 || !items[0].json.id) return [];\n\nfor (const item of items) {\n  const html = item.json.html || \"\";\n  let text = html.replace(/<br\\s*[\\/]?>/gi, '\\n');\n  text = text.replace(/<p[^>]*>/gi, '\\n');\n  text = text.replace(/<[^>]*>?/gm, ''); \n  text = text.replace(/&nbsp;/g, ' ');\n\n  let amount = \"Unknown\";\n  let time = \"Unknown\";\n  let name = \"Unknown\";\n  let ref = \"Unknown\";\n\n  const amountMatch = text.match(/received\\s+(SGD\\s*[\\d\\.]+)/i);\n  if (amountMatch) amount = amountMatch[1].trim();\n\n  const timeMatch = text.match(/on\\s+(\\d{1,2}\\s+[a-zA-Z]{3}\\s+\\d{4}\\s+\\d{2}:\\d{2}\\s*[A-Z]{3})/i);\n  if (timeMatch) time = timeMatch[1].replace(/\\s+/g, ' ').trim();\n\n  const nameMatch = text.match(/From:[\\s\\u200B-\\u200D\\uFEFF\\u202F\\xA0]*([^\\r\\n]+)/i);\n  if (nameMatch) name = nameMatch[1].trim();\n\n  const refMatch = text.match(/Transaction Ref:[\\s\\u200B-\\u200D\\uFEFF\\u202F\\xA0]*([^\\r\\n]+)/i);\n  if (refMatch) ref = refMatch[1].trim();\n\n  item.json.transactionName = name;\n  item.json.transactionAmount = amount;\n  item.json.transactionTime = time;\n  item.json.transactionRef = ref;\n}\n\nreturn items;"
      },
      "id": "parse-id",
      "name": "Parse Transaction",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        780,
        -200
      ]
    },
    {
      "parameters": {
        "operation": "removeLabels",
        "messageId": "={{ $('Gmail (Get Many)').item.json.id }}",
        "labelIds": [
          "Label_2413115628569801400"
        ]
      },
      "id": "gmail-update-id",
      "name": "Gmail (Remove 'Not Notified' Label)",
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        360,
        80
      ],
      "webhookId": "f0331c9b-3be8-4cb6-a2b7-a8819a3c0ec9",
      "credentials": {
        "gmailOAuth2": {
          "id": "4cC81xDT2RiJQdSB",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "operation": "addLabels",
        "messageId": "={{ $('Gmail (Get Many)').item.json.id }}",
        "labelIds": [
          "Label_249470526995642033"
        ]
      },
      "type": "n8n-nodes-base.gmail",
      "typeVersion": 2.1,
      "position": [
        620,
        80
      ],
      "id": "82c22591-4d3e-48ec-9eba-a1054c618e78",
      "name": "Gmail (Add 'Notified' Label)",
      "webhookId": "926711cd-b0fb-41d8-997f-d82c1d4dbc99",
      "credentials": {
        "gmailOAuth2": {
          "id": "4cC81xDT2RiJQdSB",
          "name": "Gmail account"
        }
      }
    },
    {
      "parameters": {
        "chatId": "-1002523639741",
        "text": "=🚨 *New Transaction Received* 🚨\n\n👤 *Name:* {{$('Parse Transaction').item.json.transactionName}}\n💰 *Amount:* {{$('Parse Transaction').item.json.transactionAmount}}\n🕒 *Time:* {{$('Parse Transaction').item.json.transactionTime}}\n📄 *Ref:* {{$('Parse Transaction').item.json.transactionRef}}",
        "additionalFields": {
          "appendAttribution": false,
          "reply_to_message_id": 4852
        }
      },
      "id": "telegram-id",
      "name": "Telegram (Notify Card Show Group)",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.1,
      "position": [
        20,
        80
      ],
      "webhookId": "6c5420a6-5f87-4a69-83d2-99dee0383d1d",
      "credentials": {
        "telegramApi": {
          "id": "eZK2gNv4kO0RbCbg",
          "name": "Telegram account"
        }
      }
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "cronExpression",
              "expression": "*/3 * * * * *"
            }
          ]
        }
      },
      "id": "schedule-id",
      "name": "Schedule Trigger (3 Seconds)",
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.1,
      "position": [
        0,
        -200
      ]
    }
  ],
  "connections": {
    "Gmail (Get Many)": {
      "main": [
        [
          {
            "node": "Gmail (Get Single)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail (Get Single)": {
      "main": [
        [
          {
            "node": "Parse Transaction",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Transaction": {
      "main": [
        [
          {
            "node": "Telegram (Notify Card Show Group)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail (Remove 'Not Notified' Label)": {
      "main": [
        [
          {
            "node": "Gmail (Add 'Notified' Label)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gmail (Add 'Notified' Label)": {
      "main": [
        []
      ]
    },
    "Schedule Trigger (3 Seconds)": {
      "main": [
        [
          {
            "node": "Gmail (Get Many)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram (Notify Card Show Group)": {
      "main": [
        [
          {
            "node": "Gmail (Remove 'Not Notified' Label)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "callerPolicy": "workflowsFromSameOwner",
    "executionOrder": "v1"
  },
  "staticData": {
    "node:Gmail Trigger": {
      "lastTimeChecked": 1775898712,
      "possibleDuplicates": [
        "19d7bcfe3a672877"
      ]
    },
    "node:Schedule Trigger": {
      "recurrenceRules": []
    },
    "node:Schedule Trigger (3 Seconds)": {
      "recurrenceRules": []
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "pinData": {},
  "versionId": "fc957211-4dad-47c6-b300-368224b7cd39",
  "triggerCount": 1,
  "shared": [
    {
      "createdAt": "2026-04-11T08:12:06.365Z",
      "updatedAt": "2026-04-11T08:12:06.365Z",
      "role": "workflow:owner",
      "workflowId": "S6up9GweTIMifCbO",
      "projectId": "l6nHcKUF9OfbEfhZ",
      "project": {
        "createdAt": "2026-04-09T15:34:21.296Z",
        "updatedAt": "2026-04-10T04:57:15.666Z",
        "id": "l6nHcKUF9OfbEfhZ",
        "name": "Exzen TCG <exzensg@gmail.com>",
        "type": "personal",
        "icon": null,
        "projectRelations": [
          {
            "createdAt": "2026-04-09T15:34:21.296Z",
            "updatedAt": "2026-04-09T15:34:21.296Z",
            "role": "project:personalOwner",
            "userId": "862ed692-49a0-4f91-bcd0-2370add6b2ac",
            "projectId": "l6nHcKUF9OfbEfhZ",
            "user": {
              "createdAt": "2026-04-09T15:34:20.499Z",
              "updatedAt": "2026-04-10T07:28:41.927Z",
              "id": "862ed692-49a0-4f91-bcd0-2370add6b2ac",
              "email": "exzensg@gmail.com",
              "firstName": "Exzen",
              "lastName": "TCG",
              "personalizationAnswers": {
                "version": "v4",
                "personalization_survey_submitted_at": "2026-04-10T04:57:33.700Z",
                "personalization_survey_n8n_version": "1.80.0",
                "companyType": "personal",
                "reportedSource": "youtube"
              },
              "settings": {
                "userActivated": true,
                "firstSuccessfulWorkflowId": "PSTZgvGJdb0iXsQY",
                "userActivatedAt": 1775806121866
              },
              "role": "global:owner",
              "disabled": false,
              "mfaEnabled": false,
              "isPending": false,
              "isOwner": true
            }
          }
        ]
      }
    }
  ],
  "tags": []
}