{
  "name": "Bank Statement Parser - Async PDF Extraction + Webhook to Google Sheets / ERP",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "bank-statement-webhook",
        "responseMode": "onReceived",
        "options": {}
      },
      "id": "webhook-receiver",
      "name": "Receive Extraction Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [260, 300]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{ $json.status }}",
              "operation": "equals",
              "value2": "completed"
            }
          ]
        }
      },
      "id": "check-status",
      "name": "Is Extraction Completed?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 1,
      "position": [500, 300]
    },
    {
      "parameters": {
        "fieldToSplitOut": "transactions",
        "options": {}
      },
      "id": "split-transactions",
      "name": "Split Transactions",
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [740, 220]
    },
    {
      "parameters": {
        "jsCode": "// Normalize row + attach confidence metadata\nreturn items.map((item) => ({\n  json: {\n    requestId: $('Receive Extraction Webhook').item.json.requestId,\n    bankKey: $('Receive Extraction Webhook').item.json.bankKey,\n    verifiedRate: $('Receive Extraction Webhook').item.json.confidence?.verifiedRate ?? null,\n    date: item.json.date,\n    description: item.json.description,\n    amount: item.json.amount,\n    balance: item.json.balance\n  }\n}));"
      },
      "id": "format-rows",
      "name": "Normalize Rows & Confidence",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [980, 220]
    }
  ],
  "connections": {
    "Receive Extraction Webhook": {
      "main": [[{ "node": "Is Extraction Completed?", "type": "main", "index": 0 }]]
    },
    "Is Extraction Completed?": {
      "main": [[{ "node": "Split Transactions", "type": "main", "index": 0 }], []]
    },
    "Split Transactions": {
      "main": [[{ "node": "Normalize Rows & Confidence", "type": "main", "index": 0 }]]
    }
  },
  "meta": {
    "templateSource": "https://bankstatementparser.net/templates/n8n-bank-statement-workflow.json",
    "docs": "https://bankstatementparser.net/en/docs"
  }
}

