{
  "name": "Export Odoo company data via API endpoint with JSON/Excel output options",
  "nodes": [
    {
      "id": "2b167f16-af65-4d8f-9a83-3dff9c06f99c",
      "name": "Receive Company Request",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -624,
        1424
      ]
    },
    {
      "id": "b73f4dcc-6335-4458-a5d5-b6fa578dfed2",
      "name": "Prepare Dynamic Filter",
      "type": "n8n-nodes-base.function",
      "position": [
        -384,
        1424
      ]
    },
    {
      "id": "5676cb5c-2ddd-46fa-88d3-3902a183f227",
      "name": "Fetch Companies from Odoo",
      "type": "n8n-nodes-base.odoo",
      "position": [
        -128,
        1424
      ]
    },
    {
      "id": "288b5309-6f46-484f-9ab6-06e94bd7b74f",
      "name": "Prepare Output Data",
      "type": "n8n-nodes-base.function",
      "position": [
        176,
        1424
      ]
    },
    {
      "id": "cd151c5b-55ec-454a-b43d-b78a39b74441",
      "name": "Check If Excel Required",
      "type": "n8n-nodes-base.if",
      "position": [
        480,
        1424
      ]
    },
    {
      "id": "6b9e1c86-81c3-475a-bdda-1a44bc9aed4e",
      "name": "Convert to Excel",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        1104,
        1376
      ]
    },
    {
      "id": "38164711-9c8c-4f7c-8e3b-3f19b1c12360",
      "name": "Respond with File",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1392,
        1376
      ]
    },
    {
      "id": "cba096d5-0e19-4bec-930e-eefe587e996e",
      "name": "Respond with JSON",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        784,
        1776
      ]
    },
    {
      "id": "5f3f46b8-330a-4594-8170-6b2e8d68b685",
      "name": "Overview Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1600,
        592
      ],
      "parameters": {
        "width": 900,
        "height": 572,
        "content": "## How it works\nThis workflow provides an API endpoint `/api/v1/get-companies` that retrieves company records directly from your Odoo database. It’s built for teams who need to query or export company"
      }
    },
    {
      "id": "c495e6f3-9186-41ec-8994-28ba95bde11b",
      "name": "Code",
      "type": "n8n-nodes-base.code",
      "position": [
        784,
        1392
      ]
    },
    {
      "id": "d29068b1-e243-420b-b00c-24f9ecaa0512",
      "name": "Overview Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -688,
        1184
      ],
      "parameters": {
        "width": 452,
        "height": 428,
        "content": "## Request & Validation\nReceives the API request and checks for the required “name” parameter.\nReturns a validation message if missing."
      }
    },
    {
      "id": "285429ca-c751-4970-85ce-27289180f9c8",
      "name": "Overview Note11",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        1184
      ],
      "parameters": {
        "width": 276,
        "height": 428,
        "content": "## Search Records from Odoo\n- Queries `res.company` \n**Company Table** records in Odoo using “Like” for partial matches.\n- Customize the fields in the node options if needed.\n- **Note: Name search is "
      }
    },
    {
      "id": "5f9b217d-9cf1-4a7d-b99a-c6640d38399b",
      "name": "Overview Note12",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        96,
        1184
      ],
      "parameters": {
        "width": 276,
        "height": 428,
        "content": "## Prepare data and manage response json object."
      }
    },
    {
      "id": "e7a97e7d-928b-4ec3-88c7-d6a2ecee9ea9",
      "name": "Overview Note13",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        1184
      ],
      "parameters": {
        "width": 276,
        "height": 428,
        "content": "## Check response_format\nIf response_format=excel → returns a downloadable Excel file.\nOtherwise, returns JSON with company data."
      }
    },
    {
      "id": "2d754c32-7a53-4a43-a49e-8ccf8839f6f8",
      "name": "Overview Note14",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        1184
      ],
      "parameters": {
        "width": 276,
        "height": 428,
        "content": "## Prepare Data for Binary file."
      }
    },
    {
      "id": "0edb17ef-3bac-42fc-835d-d67e26ad82b0",
      "name": "Overview Note15",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1008,
        1184
      ],
      "parameters": {
        "width": 276,
        "height": 428,
        "content": "## Create excel file"
      }
    },
    {
      "id": "6ab323ca-5cc5-4d86-b32d-17f7340a4ab2",
      "name": "Overview Note16",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1312,
        1184
      ],
      "parameters": {
        "width": 276,
        "height": 428,
        "content": "## Response to web-hook with excel file."
      }
    },
    {
      "id": "9d469fdf-7eaa-452f-874a-552299170c51",
      "name": "Overview Note17",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        704,
        1632
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Response to web-hook with json object."
      }
    }
  ],
  "connections": {
    "Code": {
      "main": [
        [
          {
            "node": "Convert to Excel",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Excel": {
      "main": [
        [
          {
            "node": "Respond with File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Output Data": {
      "main": [
        [
          {
            "node": "Check If Excel Required",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Dynamic Filter": {
      "main": [
        [
          {
            "node": "Fetch Companies from Odoo",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Excel Required": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond with JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Company Request": {
      "main": [
        [
          {
            "node": "Prepare Dynamic Filter",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Fetch Companies from Odoo": {
      "main": [
        [
          {
            "node": "Prepare Output Data",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}