{
  "name": "Fetch Odoo customer data and export to JSON or Excel",
  "nodes": [
    {
      "id": "752a1ab6-274c-4f09-9bf1-e2dba414aaf1",
      "name": "Receive Company Request1",
      "type": "n8n-nodes-base.webhook",
      "position": [
        -816,
        3152
      ]
    },
    {
      "id": "66762aac-2d62-4d59-9956-816476d0f92f",
      "name": "Prepare Dynamic Filter1",
      "type": "n8n-nodes-base.function",
      "position": [
        -576,
        3152
      ]
    },
    {
      "id": "e727d97c-678b-41b8-8db4-d1615c73a116",
      "name": "Prepare Output Data1",
      "type": "n8n-nodes-base.function",
      "position": [
        0,
        3152
      ]
    },
    {
      "id": "9187426f-d4d0-4461-af73-3f31cdb0cc17",
      "name": "Check If Excel Required1",
      "type": "n8n-nodes-base.if",
      "position": [
        288,
        3152
      ]
    },
    {
      "id": "ed6030ad-11f0-43f6-aee5-147ee0c055de",
      "name": "Convert to Excel1",
      "type": "n8n-nodes-base.convertToFile",
      "position": [
        896,
        3104
      ]
    },
    {
      "id": "0e6e1540-4c2e-45fe-a75a-6e511a95937b",
      "name": "Respond with File1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1216,
        3104
      ]
    },
    {
      "id": "d64e68cf-c80c-4633-bc4f-614d572ca762",
      "name": "Respond with JSON1",
      "type": "n8n-nodes-base.respondToWebhook",
      "position": [
        1216,
        3504
      ]
    },
    {
      "id": "d2f28f28-a541-42d1-aaf8-94ab14723a53",
      "name": "Overview Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1792,
        2288
      ],
      "parameters": {
        "width": 900,
        "height": 620,
        "content": "## How it works\nThis workflow provides an API endpoint `/api/v1/get-customers` that retrieves customer contact records directly from your Odoo instance. It’s designed for teams who need to query or ex"
      }
    },
    {
      "id": "ad743706-da44-436c-a330-96f289469989",
      "name": "Fetch Customer",
      "type": "n8n-nodes-base.odoo",
      "position": [
        -320,
        3152
      ]
    },
    {
      "id": "5d55b9d2-a30b-4efd-8a22-e4d80851163a",
      "name": "Overview Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -880,
        2928
      ],
      "parameters": {
        "width": 452,
        "height": 380,
        "content": "## Request & Validation\nReceives the API request and checks for the required “name” parameter.\nReturns a validation message if missing."
      }
    },
    {
      "id": "e8d5c637-2adc-4c45-ab56-81eabe9af5ee",
      "name": "Overview Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -400,
        2928
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Search Records from Odoo\n- Queries `res.partner` \n**Contact 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": "5b009e21-3259-430b-aaf1-044e5c364eb8",
      "name": "Overview Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -96,
        2928
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Prepare data and manage response json object."
      }
    },
    {
      "id": "af201ab6-7f0f-4806-bba1-7d9f718eeb75",
      "name": "Overview Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        208,
        2928
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Check response_format\nIf response_format=excel → returns a downloadable Excel file.\nOtherwise, returns JSON with company data."
      }
    },
    {
      "id": "1b71d124-7d74-421c-882d-c67b6e6f9c08",
      "name": "Return all data for create binary file",
      "type": "n8n-nodes-base.code",
      "position": [
        592,
        3104
      ]
    },
    {
      "id": "4dab4b62-287e-48ab-851d-8f8277d4eb10",
      "name": "Overview Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        512,
        2928
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Prepare Data for Binary file."
      }
    },
    {
      "id": "d7dccf04-2209-4638-a535-175b8207a70d",
      "name": "Overview Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        816,
        2928
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Create excel file"
      }
    },
    {
      "id": "278e9a77-f740-4adb-8a9b-465cc48b56e2",
      "name": "Overview Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1120,
        2928
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Response to web-hook with excel file."
      }
    },
    {
      "id": "e86f38f1-12de-4da2-99e2-f5e4cf863b27",
      "name": "Overview Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1136,
        3328
      ],
      "parameters": {
        "width": 276,
        "height": 380,
        "content": "## Response to web-hook with json object."
      }
    }
  ],
  "connections": {
    "Fetch Customer": {
      "main": [
        [
          {
            "node": "Prepare Output Data1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert to Excel1": {
      "main": [
        [
          {
            "node": "Respond with File1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Output Data1": {
      "main": [
        [
          {
            "node": "Check If Excel Required1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Prepare Dynamic Filter1": {
      "main": [
        [
          {
            "node": "Fetch Customer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check If Excel Required1": {
      "main": [
        [
          {
            "node": "Return all data for create binary file",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Respond with JSON1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Receive Company Request1": {
      "main": [
        [
          {
            "node": "Prepare Dynamic Filter1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Return all data for create binary file": {
      "main": [
        [
          {
            "node": "Convert to Excel1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}