N
n8n Store
Workflow Market
Transactions

Transactions

by mujtaba0 views

描述

分类

💰 Finance

使用的节点

n8n-nodes-base.ifn8n-nodes-base.coden8n-nodes-base.stickyNoten8n-nodes-base.googleSheetsn8n-nodes-base.telegramTrigger
价格免费
浏览量0
最后更新11/28/2025
workflow.json
{
  "id": "Yhi53ukpbhg8MLjl",
  "meta": {
    "instanceId": "b86e63fb7b4c07b78811296ef3f926059b6ec73d3e6f664717eae667877d753e",
    "templateCredsSetupCompleted": true
  },
  "name": "Transactions",
  "tags": [],
  "nodes": [
    {
      "id": "d4d52570-7ce4-4e61-a4ab-08a9cc80c090",
      "name": "If",
      "type": "n8n-nodes-base.if",
      "position": [
        260,
        -260
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 2,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "strict"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "19c3652b-36e2-43cd-9ec2-091cd9097e93",
              "operator": {
                "type": "string",
                "operation": "contains"
              },
              "leftValue": "={{$json.message.text}}",
              "rightValue": "="
            }
          ]
        }
      },
      "typeVersion": 2.2
    },
    {
      "id": "6ce64c44-f418-4d20-9f01-036e54804e79",
      "name": "Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        700,
        -260
      ],
      "parameters": {
        "columns": {
          "value": {
            "Date": "={{ $json.Date }}",
            "Time": "={{ $json.Time }}",
            "Amount": "={{ $json.Amount }}",
            "Merchant": "={{ $json.Merchant }}",
            "Card Ending": "={{ $json['Card Ending'] }}",
            "Available Limit": "={{ $json['Available Limit'] }}"
          },
          "schema": [
            {
              "id": "Card Ending",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Card Ending",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Merchant",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Merchant",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Amount",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Amount",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Date",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Date",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Time",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Time",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Available Limit",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Available Limit",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tl5OVxvN-eRIPwauSwV4i7mhQrp67tlcWR8Lc6BGQz0/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "1tl5OVxvN-eRIPwauSwV4i7mhQrp67tlcWR8Lc6BGQz0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1tl5OVxvN-eRIPwauSwV4i7mhQrp67tlcWR8Lc6BGQz0/edit?usp=drivesdk",
          "cachedResultName": "transactions"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "id": "PWxHOTas9yq3PI3W",
          "name": "Google Sheets account"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "1186ead6-2d97-460f-b90a-f81928f7cbfc",
      "name": "Telegram Trigger",
      "type": "n8n-nodes-base.telegramTrigger",
      "position": [
        40,
        -260
      ],
      "webhookId": "e5897f93-a169-4e26-8ca8-7201b9eaaf5a",
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "credentials": {
        "telegramApi": {
          "id": "QccmA3s5vnuqh1J7",
          "name": "Telegram account"
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cd4479fa-bc73-436b-971f-65a5b6de0b9f",
      "name": "transactions",
      "type": "n8n-nodes-base.code",
      "position": [
        480,
        -260
      ],
      "parameters": {
        "jsCode": "const text = $input.item.json.message.text.trim();\n\n// Format 1: \"Hello. You spent AED 19.00 at CAREEM PLUS on your Credit Card  526039****7003 on 18/05. Combined Available Balance: AED 5893.14.\"\nconst format1 = /You spent AED\\s*([\\d,.]+)\\s*at\\s*(.+?)\\s*on your Credit Card\\s+([\\d*Xx]+)\\s+on\\s*([\\d/]+)\\.\\s*Combined Available Balance: AED\\s*([\\d,.]+)/i;\n\n// Format 2: \n// \"Credit Card Purchase Card Ending: 0947 At: LAVASH RESTAURANT EST, DUBAI Amount: AED 188.00 Date: 25/05/2025, 15:51 Available Limit: AED 5,752.86\"\nconst format2 = /Card Ending:\\s*(\\d+)\\s*At:\\s*(.+?)\\s*Amount:\\s*AED\\s*([\\d,.]+)\\s*Date:\\s*([\\d/]+),\\s*(\\d{2}:\\d{2})\\s*Available Limit:\\s*AED\\s*([\\d,.]+)/i;\n\n// Format 3: \n// \"Payment for ENOC SITE 1066 of AED 129.00 has been made using Credit Card ending with 0947. Available limit AED 5,347.87.\"\nconst format3 = /Payment for\\s*(.+?)\\s*of AED\\s*([\\d,.]+).+ending (?:with|in)\\s*([\\d*Xx]+).+Available limit AED\\s*([\\d,.]+)/i;\n\nlet match;\nlet out = {};\n\nif (format1.test(text)) {\n    match = text.match(format1);\n    out = {\n        \"Amount\": match[1],\n        \"Merchant\": match[2],\n        \"Card Number\": match[3],\n        \"Date\": match[4],\n        \"Available Balance\": match[5]\n    };\n} else if (format2.test(text)) {\n    match = text.match(format2);\n    out = {\n        \"Card Ending\": match[1],\n        \"Merchant\": match[2],\n        \"Amount\": match[3],\n        \"Date\": match[4],\n        \"Time\": match[5],\n        \"Available Limit\": match[6]\n    };\n} else if (format3.test(text)) {\n    match = text.match(format3);\n    out = {\n        \"Merchant\": match[1],\n        \"Amount\": match[2],\n        \"Card Ending\": match[3],\n        \"Available Limit\": match[4]\n    };\n} else {\n    out = { error: \"No known transaction format matched.\", text };\n}\n\nreturn [{ json: out }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "30f6930a-aae3-4f95-9116-303dd8e07062",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        -460
      ],
      "parameters": {
        "width": 920,
        "height": 420,
        "content": "# Expense Tracker Automation\n\n"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7f43bda5-1968-4eca-ae7d-d29ed1c562e7",
  "connections": {
    "If": {
      "main": [
        [
          {
            "node": "transactions",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    },
    "transactions": {
      "main": [
        [
          {
            "node": "Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "If",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流