{
  "name": "Log daily Interactive Brokers trades to a Google Sheets journal",
  "nodes": [
    {
      "id": "f1ab6f5d-f612-42da-8972-2f5662d1860e",
      "name": "1. Request Flex Report",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        656,
        688
      ]
    },
    {
      "id": "b67bbf48-a427-4a96-b451-ceecbd24ca25",
      "name": "2. Extract Reference Code",
      "type": "n8n-nodes-base.code",
      "position": [
        880,
        688
      ]
    },
    {
      "id": "9bf9aef5-7a6b-4913-9144-bcf6989c35d4",
      "name": "Wait 10 Seconds",
      "type": "n8n-nodes-base.wait",
      "position": [
        1104,
        688
      ]
    },
    {
      "id": "72cf587f-5f87-42e7-b599-4c6434b4f7af",
      "name": "3. Download Report",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1328,
        688
      ]
    },
    {
      "id": "32848fdb-2b1a-49af-9ec1-263c59631660",
      "name": "5. Split Trades",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1776,
        688
      ]
    },
    {
      "id": "e7e7c804-d9ec-48c3-95a0-76cc8f9955c8",
      "name": "6. Format Trade Fields",
      "type": "n8n-nodes-base.set",
      "position": [
        2000,
        688
      ]
    },
    {
      "id": "9ae3859b-870f-42d7-9b28-81bb6d8d738c",
      "name": "7. Save to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2224,
        688
      ]
    },
    {
      "id": "bba25f41-c980-43b7-a99e-8ce025e46154",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -160,
        -32
      ],
      "parameters": {
        "width": 480,
        "height": 688,
        "content": "# Automated IBKR Trade Report to Google Sheets Journal\n\n### How it works\n1. A daily schedule triggers a FlexStatement request to Interactive Brokers to start generating a trade report.\n2. The workflow"
      }
    },
    {
      "id": "25c0cc38-6bb9-4210-aab8-284efe39be3d",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        592,
        560
      ],
      "parameters": {
        "width": 464,
        "height": 80,
        "content": "## 1. Setup Flex Query in Interactive Brokers\n\n"
      }
    },
    {
      "id": "d32a94ec-d30e-47cb-92bd-4931a42d1cc4",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        2128,
        368
      ],
      "parameters": {
        "width": 288,
        "height": 272,
        "content": "## 3. Save to Google Sheet\n\n### Enter your Google Sheet ID:\nIn node '7. Save to Google Sheet'\nReplace YOUR_GOOGLE_SHEET_ID\n\n### Connect Google credentials:\nIn node 7, select your Google OAuth2 credent"
      }
    },
    {
      "id": "e66d7524-83c9-4370-91c9-0a4852897b5e",
      "name": "Daily Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        432,
        688
      ]
    },
    {
      "id": "a6741176-6eec-44f1-8629-f08faeed1f17",
      "name": "4. Convert XML to JSON",
      "type": "n8n-nodes-base.xml",
      "position": [
        1552,
        688
      ]
    },
    {
      "id": "456a309d-ef03-475c-981e-69e9f8495057",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1104,
        560
      ],
      "parameters": {
        "width": 992,
        "height": 80,
        "content": "## 2. Download trade journal and format fields\n"
      }
    }
  ],
  "connections": {
    "5. Split Trades": {
      "main": [
        [
          {
            "node": "6. Format Trade Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Wait 10 Seconds": {
      "main": [
        [
          {
            "node": "3. Download Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "3. Download Report": {
      "main": [
        [
          {
            "node": "4. Convert XML to JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1. Request Flex Report": {
      "main": [
        [
          {
            "node": "2. Extract Reference Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "4. Convert XML to JSON": {
      "main": [
        [
          {
            "node": "5. Split Trades",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "6. Format Trade Fields": {
      "main": [
        [
          {
            "node": "7. Save to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Daily Schedule Trigger": {
      "main": [
        [
          {
            "node": "1. Request Flex Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "2. Extract Reference Code": {
      "main": [
        [
          {
            "node": "Wait 10 Seconds",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}