{
  "name": "INSEE company data enrichment for Agile CRM (For French companies only)",
  "nodes": [
    {
      "id": "a45b34c1-514e-4221-b363-abf2d4de43c4",
      "name": "When clicking ‘Test workflow’",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        -3440,
        -320
      ]
    },
    {
      "id": "d406941b-80a1-43a3-ba19-2e29570192f2",
      "name": "Find Company in SIREN database",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2660,
        -220
      ]
    },
    {
      "id": "6ab3818b-2f09-44e2-874a-87c51478572b",
      "name": "Request all data from SIREN database",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -2420,
        -240
      ]
    },
    {
      "id": "89c223fe-289b-4d0f-922a-e9c0ad672b51",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3420,
        -640
      ],
      "parameters": {
        "width": 460,
        "height": 240,
        "content": "### Enrich CRM data with data from French INSEE OpenDatabase API\nThis workflow takes all company entries from **Agile CRM** and enriches their data using the French [Insee Opendata API](https://portai"
      }
    },
    {
      "id": "0bdc49dd-6f26-447f-a8ba-c2ba615dc7ec",
      "name": "FilterOut all Company that have the ReadOnly Key set",
      "type": "n8n-nodes-base.code",
      "position": [
        -2880,
        -220
      ]
    },
    {
      "id": "0ef184f7-219c-4eb3-bfe0-4e68d2ce0b43",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2940,
        -640
      ],
      "parameters": {
        "width": 647,
        "height": 232,
        "content": "### 👨‍🎤 Setup\n1. Add your **Agile CRM** credentials\n2. Link each AgileCRM node to the correct **Agile CRM** credentials\n3. Add your **INSEE** API Key to the **\"Set Insee API Key\"** node\n4. Make sure t"
      }
    },
    {
      "id": "78255253-195d-472d-a76c-ab63ceac126b",
      "name": "Set Insee API Key",
      "type": "n8n-nodes-base.set",
      "position": [
        -3260,
        -220
      ]
    },
    {
      "id": "90b13481-6570-4bfc-b3dc-4b6017c6c8b5",
      "name": "Schedule Trigger",
      "type": "n8n-nodes-base.scheduleTrigger",
      "position": [
        -3440,
        -140
      ]
    },
    {
      "id": "88c8a6c6-2175-42c3-bfdb-f1d32a5d1c2d",
      "name": "clean_route",
      "type": "n8n-nodes-base.noOp",
      "position": [
        -2660,
        -360
      ]
    },
    {
      "id": "522d83f6-752e-40b4-a889-334f0a96998b",
      "name": "Get all Compagnies from Agile CRM",
      "type": "n8n-nodes-base.agileCrm",
      "position": [
        -3080,
        -220
      ]
    },
    {
      "id": "8ff0632b-6aca-47d8-b611-72dbc8dec09b",
      "name": "Enrich CRM with INSEE Data",
      "type": "n8n-nodes-base.agileCrm",
      "position": [
        -1960,
        -340
      ]
    },
    {
      "id": "8720be96-8181-4ea7-b114-ce0f5b8e09c1",
      "name": "Merge data from CRM and SIREN database with enriched for the CRM",
      "type": "n8n-nodes-base.merge",
      "position": [
        -2180,
        -340
      ]
    },
    {
      "id": "855a39e2-83ef-49d9-b630-ec31aaa96e72",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -3460,
        20
      ],
      "parameters": {
        "width": null,
        "height": 80,
        "content": "👆 You can use any of those two Trigger to start the process."
      }
    },
    {
      "id": "b003c1b8-6244-4b72-bbb0-025f563b5d71",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -2260,
        -640
      ],
      "parameters": {
        "width": 380,
        "height": 240,
        "content": "### 🗒️ Notes : \n1. This workflow is made to write over any entry already present. You can change this for each company by setting the **\"RO\"** Custom Field to **1**, making it read-only for this workf"
      }
    }
  ],
  "connections": {
    "clean_route": {
      "main": [
        [
          {
            "node": "Merge data from CRM and SIREN database with enriched for the CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Set Insee API Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Insee API Key": {
      "main": [
        [
          {
            "node": "Get all Compagnies from Agile CRM",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Find Company in SIREN database": {
      "main": [
        [
          {
            "node": "Request all data from SIREN database",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get all Compagnies from Agile CRM": {
      "main": [
        [
          {
            "node": "FilterOut all Company that have the ReadOnly Key set",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "When clicking ‘Test workflow’": {
      "main": [
        [
          {
            "node": "Set Insee API Key",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Request all data from SIREN database": {
      "main": [
        [
          {
            "node": "Merge data from CRM and SIREN database with enriched for the CRM",
            "type": "main",
            "index": 1
          }
        ]
      ]
    },
    "FilterOut all Company that have the ReadOnly Key set": {
      "main": [
        [
          {
            "node": "Find Company in SIREN database",
            "type": "main",
            "index": 0
          },
          {
            "node": "clean_route",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Merge data from CRM and SIREN database with enriched for the CRM": {
      "main": [
        [
          {
            "node": "Enrich CRM with INSEE Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}