{
  "name": "ASHDOCS — Email bank statement to Google Sheets rows",
  "nodes": [
    {
      "parameters": {
        "content": "## ASHDOCS setup\n1. Create a **Header Auth** credential: Name exactly `X-API-Key`, Value = your key (`ash_test_` sandbox keys run free).\n2. Attach it to the *Parse Statement (ASHDOCS)* node.\n3. Connect your IMAP mailbox on the trigger and your Google Sheets credential on the last node.\n\nFlow: attachment `attachment_0` is uploaded as multipart field `files`; the response's signed `file_url` is downloaded, the CSV is parsed to rows, and the rows are appended.",
        "height": 340,
        "width": 400
      },
      "id": "b2000000-0000-4000-8000-000000000001",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [-480, -180]
    },
    {
      "parameters": {
        "format": "resolved",
        "options": {}
      },
      "id": "b2000000-0000-4000-8000-000000000002",
      "name": "Email Trigger (IMAP)",
      "type": "n8n-nodes-base.emailReadImap",
      "typeVersion": 2,
      "position": [0, 0]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://www.ashdocs.com/api/v1/tools/bank-statement-to-csv",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "files",
              "inputDataFieldName": "attachment_0"
            },
            {
              "name": "options",
              "value": "{\"output\": \"url\"}"
            }
          ]
        },
        "options": {}
      },
      "id": "b2000000-0000-4000-8000-000000000003",
      "name": "Parse Statement (ASHDOCS)",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [220, 0]
    },
    {
      "parameters": {
        "url": "={{ $json.file_url }}",
        "options": {
          "response": {
            "response": {
              "responseFormat": "file"
            }
          }
        }
      },
      "id": "b2000000-0000-4000-8000-000000000004",
      "name": "Download CSV",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [440, 0]
    },
    {
      "parameters": {
        "operation": "csv",
        "options": {}
      },
      "id": "b2000000-0000-4000-8000-000000000005",
      "name": "CSV to Rows",
      "type": "n8n-nodes-base.extractFromFile",
      "typeVersion": 1,
      "position": [660, 0]
    },
    {
      "parameters": {
        "operation": "append",
        "columns": {
          "mappingMode": "autoMapInputData"
        },
        "options": {}
      },
      "id": "b2000000-0000-4000-8000-000000000006",
      "name": "Append to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "typeVersion": 4.5,
      "position": [880, 0]
    }
  ],
  "connections": {
    "Email Trigger (IMAP)": {
      "main": [[{ "node": "Parse Statement (ASHDOCS)", "type": "main", "index": 0 }]]
    },
    "Parse Statement (ASHDOCS)": {
      "main": [[{ "node": "Download CSV", "type": "main", "index": 0 }]]
    },
    "Download CSV": {
      "main": [[{ "node": "CSV to Rows", "type": "main", "index": 0 }]]
    },
    "CSV to Rows": {
      "main": [[{ "node": "Append to Google Sheets", "type": "main", "index": 0 }]]
    }
  },
  "active": false,
  "settings": {},
  "pinData": {}
}
