{
  "name": "Enriching Brazilian company data with CNPJ API and Google Sheets",
  "nodes": [
    {
      "id": "4a712b97-03ff-4f47-b17a-d2db1730cd4b",
      "name": "Execute Workflow Manually",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -368,
        176
      ]
    },
    {
      "id": "a6a2f770-8850-49f5-a475-8069d852f35d",
      "name": "Settings",
      "type": "n8n-nodes-base.set",
      "position": [
        -112,
        176
      ]
    },
    {
      "id": "5ce78f98-1dcf-4048-bb3e-8c038470e991",
      "name": "Loop CNPJs",
      "type": "n8n-nodes-base.splitInBatches",
      "position": [
        496,
        176
      ]
    },
    {
      "id": "4e6e8675-949d-4a39-b779-efc3738a5445",
      "name": "Send API Request",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        800,
        304
      ]
    },
    {
      "id": "bcfd66a0-8e12-41b0-a87e-067bbe79dc30",
      "name": "Update CNPJ Info in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        1136,
        304
      ]
    },
    {
      "id": "9aa7367f-4a85-4007-a482-4828fd276654",
      "name": "Notify When Finish",
      "type": "n8n-nodes-base.telegram",
      "position": [
        976,
        -112
      ]
    },
    {
      "id": "bdb3fd23-cedc-43d9-872f-32bf099c4665",
      "name": "Limit Notifier Interactions",
      "type": "n8n-nodes-base.limit",
      "position": [
        704,
        -112
      ]
    },
    {
      "id": "6a1ba7c8-9358-46db-be11-21d98ab87506",
      "name": "Get All CNPJs in Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        224,
        176
      ]
    },
    {
      "id": "573946b9-f954-4b25-b039-0631abd131a1",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -16
      ],
      "parameters": {
        "width": 304,
        "height": 336,
        "content": "## ⚙️ INITIAL SETUP\n- Configure your Telegram ID for notifications\n- API URL is already configured (MinhaReceita.org)\n- Make sure Google Sheets credentials are active"
      }
    },
    {
      "id": "b0c352e7-4f9e-4290-9b34-e5603423143f",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        -16
      ],
      "parameters": {
        "width": 320,
        "height": 336,
        "content": "## 📊 DATA SOURCE\n- Reads CNPJs from Google Sheets spreadsheet\n- Filters by empty 'razao_social' column\n- Processes only CNPJs without data"
      }
    },
    {
      "id": "1a464427-aed0-4d9e-9176-2728d947bad7",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        688,
        112
      ],
      "parameters": {
        "width": 320,
        "height": 352,
        "content": "## 🌐 API DETAILS\n- API: minhareceita.org/{cnpj}\n- Returns +40 fields from Federal Revenue\n- Updated and official data\n- Includes IBGE codes and classifications\n- Cadastral status history\n- Free, no au"
      }
    },
    {
      "id": "8f07398e-256f-4e33-9972-9786519a37e1",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        864,
        -240
      ],
      "parameters": {
        "width": 320,
        "height": 288,
        "content": "## 📱 NOTIFICATIONS\n- Telegram notifies when finished\n- Limiter prevents notification spam\n- One notification per complete execution"
      }
    },
    {
      "id": "82a3945d-fac6-4ff5-820a-f3d6aacbc31e",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1024,
        112
      ],
      "parameters": {
        "width": 320,
        "height": 352,
        "content": "## 📄 INSERT NEW DATA\n- Retrieves data from API\n- Updates corresponding row in spreadsheet with new information"
      }
    },
    {
      "id": "3de014ac-1ab2-483e-90bb-fda01fdbf431",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -528
      ],
      "parameters": {
        "width": 272,
        "height": 112,
        "content": "# 📌 Follow me:\n## [LinkedIn](https://www.linkedin.com/in/vikthyr)"
      }
    },
    {
      "id": "36960786-d9cd-4527-957d-4762b2131aa7",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        -400
      ],
      "parameters": {
        "width": 640,
        "height": 368,
        "content": "# 📋 HOW THE WORKFLOW WORKS\n\n**1️⃣ START:** Manual execution triggers the process\n\n**2️⃣ SETUP:** Defines variables (Telegram ID and API URL)\n\n**3️⃣ READING:** Searches for all CNPJs in the spreadsheet"
      }
    }
  ],
  "connections": {
    "Settings": {
      "main": [
        [
          {
            "node": "Get All CNPJs in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Loop CNPJs": {
      "main": [
        [
          {
            "node": "Limit Notifier Interactions",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Send API Request",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send API Request": {
      "main": [
        [
          {
            "node": "Update CNPJ Info in Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get All CNPJs in Sheet": {
      "main": [
        [
          {
            "node": "Loop CNPJs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Execute Workflow Manually": {
      "main": [
        [
          {
            "node": "Settings",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Update CNPJ Info in Sheet": {
      "main": [
        [
          {
            "node": "Loop CNPJs",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Limit Notifier Interactions": {
      "main": [
        [
          {
            "node": "Notify When Finish",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}