{
  "id": "TOq3qiHty0AkqZT7",
  "name": "Export your daily Binance portfolio to Google Sheets",
  "tags": [],
  "nodes": [
    {
      "id": "68ff17d0-49e6-482a-897c-62ccc4164eff",
      "name": "Get Binance Account tokens",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1424,
        288
      ],
      "parameters": {
        "url": "=https://api.binance.com/api/v3/account?{{ $json.query }}&signature={{ $json.signature }}",
        "options": {},
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "X-MBX-APIKEY",
              "value": "={{ $('Set API and Signature keys').item.json.API_KEY }}"
            }
          ]
        }
      },
      "retryOnFail": true,
      "typeVersion": 4.3
    },
    {
      "id": "c261f31a-1f44-4b52-bac9-bed6202d29fd",
      "name": "Split Out tokens",
      "type": "n8n-nodes-base.splitOut",
      "position": [
        1632,
        288
      ],
      "parameters": {
        "options": {},
        "fieldToSplitOut": "balances"
      },
      "typeVersion": 1
    },
    {
      "id": "7ec5eac5-f2e2-4e60-9f19-c17618561142",
      "name": "Keep non null assets",
      "type": "n8n-nodes-base.filter",
      "position": [
        1840,
        288
      ],
      "parameters": {
        "options": {},
        "conditions": {
          "options": {
            "version": 3,
            "leftValue": "",
            "caseSensitive": true,
            "typeValidation": "loose"
          },
          "combinator": "and",
          "conditions": [
            {
              "id": "a7966478-1387-4467-b33f-a8530841135d",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.free }}",
              "rightValue": 0
            },
            {
              "id": "7b8eda3f-e90e-46c8-a617-07b6326b0342",
              "operator": {
                "type": "number",
                "operation": "gt"
              },
              "leftValue": "={{ $json.free }}",
              "rightValue": 0
            }
          ]
        },
        "looseTypeValidation": true
      },
      "typeVersion": 2.3
    },
    {
      "id": "f3f771b7-751d-4b84-96f0-9fe0648ca313",
      "name": "Configure timestamp query for Binance API",
      "type": "n8n-nodes-base.set",
      "position": [
        976,
        288
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "0fa5b78f-08ef-45cf-9191-93e39db06b33",
              "name": "query",
              "type": "string",
              "value": "=timestamp={{ Math.round(Date.now()) }}&recvWindow=50000"
            }
          ]
        }
      },
      "typeVersion": 3.4
    },
    {
      "id": "4407a935-7c1b-4c3f-b94f-1e5350fd1fa3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        240
      ],
      "parameters": {
        "color": 3,
        "width": 208,
        "height": 208,
        "content": "**Configure keys here**"
      },
      "typeVersion": 1
    },
    {
      "id": "d32886f6-b3b0-4ecb-8c33-3af4de1ea06c",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        0,
        0
      ],
      "parameters": {
        "width": 496,
        "height": 640,
        "content": "## Daily Binance Portfolio Export to Google Sheets \n\n## What this workflow does                                                                                 \n  This workflow automatically exports your Binance spot portfolio positions to Google Sheets                 \n  on a daily basis, enabling you to build comprehensive tracking dashboards and analyze your                 \n  crypto holdings over time.                                                                                 \n                                                                                                             \n  ## Who is this for?                                                                                        \n  - Crypto investors wanting to track portfolio evolution                                                    \n  - Traders needing historical data for analysis                                                             \n  - Anyone wanting automated portfolio snapshots without manual exports                                      \n                                                                                                             \n  ## How it works                                                                                            \n  1. **Schedule Trigger** - Runs daily at a configurable time                                                \n  2. **Binance API** - Fetches current spot wallet balances                                                                                      \n  3. **Data Transformation** - Filter only non null assets                                      \n  4. **Google Sheets** - Clear sheet and append assets\n\n\n## Customization\nTo keep assets positions history, do not clear sheet and append timestamps on each line. You can track daily evolutions on Google Sheets or Looker Studio"
      },
      "typeVersion": 1
    },
    {
      "id": "cef1423f-58da-47a9-be4f-1339269c0327",
      "name": "Everyday at midnight",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        544,
        288
      ],
      "parameters": {
        "rule": {
          "interval": [
            {}
          ]
        }
      },
      "typeVersion": 1.2
    },
    {
      "id": "cbbcbe0a-a417-44c9-a940-2dde466b3dcc",
      "name": "Crypto signature for Binance API",
      "type": "n8n-nodes-base.crypto",
      "position": [
        1200,
        288
      ],
      "parameters": {
        "type": "SHA256",
        "value": "={{ $json.query }}",
        "action": "hmac",
        "secret": "YOUR_CREDENTIAL_HERE",
        "dataPropertyName": "signature"
      },
      "typeVersion": 1
    },
    {
      "id": "1e9e6663-435a-4566-a2f5-37c2dd013ba1",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        928,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 640,
        "height": 304,
        "content": "## Binance - Get portfolio assets\nSet signature and make api call"
      },
      "typeVersion": 1
    },
    {
      "id": "a7eae1f9-5efd-43ed-a3ab-322ebdddf6aa",
      "name": "Clear sheet completely",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2048,
        288
      ],
      "parameters": {
        "operation": "clear",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "authentication": "serviceAccount"
      },
      "typeVersion": 4.7
    },
    {
      "id": "5a6fe2ca-ef71-4bf9-be6a-9418b79e86f9",
      "name": "Append assets list in sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        2256,
        288
      ],
      "parameters": {
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "id",
          "value": "",
          "cachedResultUrl": "",
          "cachedResultName": ""
        },
        "documentId": {
          "__rl": true,
          "mode": "id",
          "value": ""
        },
        "authentication": "serviceAccount"
      },
      "typeVersion": 4.7
    },
    {
      "id": "bbf20b46-5938-4a17-a647-ccdc0c18e388",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1792,
        192
      ],
      "parameters": {
        "color": 7,
        "width": 656,
        "height": 320,
        "content": "## Google Sheets Storage\nKeep and append only non-null values"
      },
      "typeVersion": 1
    },
    {
      "id": "dfd9b1ce-aa0e-4698-98ec-1e4ebe51e827",
      "name": "Set API and Signature keys",
      "type": "n8n-nodes-base.set",
      "position": [
        752,
        288
      ],
      "parameters": {
        "options": {},
        "assignments": {
          "assignments": [
            {
              "id": "e4f05cf8-b833-4fec-8518-3e13dcc7cc38",
              "name": "API_KEY",
              "type": "string",
              "value": "<api_key_here>"
            },
            {
              "id": "d0ce01d3-3e60-4a2a-a12b-afb633d14a74",
              "name": "SIGNATURE_KEY",
              "type": "string",
              "value": "<signature_key_here>"
            }
          ]
        }
      },
      "typeVersion": 3.4
    }
  ],
  "active": false,
  "settings": {
    "binaryMode": "separate",
    "availableInMCP": false,
    "executionOrder": "v1"
  },
  "versionId": "a0957ef4-b2a5-4b7e-a4a9-dfa0c6b7a78b",
  "connections": {
    "Split Out tokens": {
      "main": [
        [
          {
            "node": "Keep non null assets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Everyday at midnight": {
      "main": [
        [
          {
            "node": "Set API and Signature keys",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Keep non null assets": {
      "main": [
        [
          {
            "node": "Clear sheet completely",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Clear sheet completely": {
      "main": [
        [
          {
            "node": "Append assets list in sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get Binance Account tokens": {
      "main": [
        [
          {
            "node": "Split Out tokens",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set API and Signature keys": {
      "main": [
        [
          {
            "node": "Configure timestamp query for Binance API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Crypto signature for Binance API": {
      "main": [
        [
          {
            "node": "Get Binance Account tokens",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Configure timestamp query for Binance API": {
      "main": [
        [
          {
            "node": "Crypto signature for Binance API",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}