Odoo icon

Odoo

Consume Odoo API

Overview

The Odoo node for n8n allows you to interact with the Odoo API, specifically targeting the "Contact" resource. The Get Many operation (getAll) retrieves multiple contact records from your Odoo instance. This is useful for scenarios where you need to fetch lists of contacts for reporting, synchronization, or further processing in your automation workflows.

Practical examples:

  • Retrieve all contacts to sync them with another CRM.
  • Fetch a limited set of contacts for batch email campaigns.
  • Get specific fields (like name and email) for all contacts to generate a custom report.

Properties

Name Meaning
Return All Whether to return all results or only up to a given limit. If enabled, all matching contacts are returned; if disabled, the number of results is limited by the "Limit" property.
Limit Max number of results to return. Only shown if "Return All" is false. Accepts values between 1 and 1000.
Options Additional options for the request:
- Fields to Include: Select which fields to include in the response. You can choose from a list or specify field IDs using an expression.

Output

  • The output is an array of JSON objects, each representing a contact record from Odoo.
  • The structure of each object depends on the fields selected in "Fields to Include". By default, standard contact fields such as id, name, etc., may be included.
  • Example output (fields will vary based on selection):
[
  {
    "id": 123,
    "name": "John Doe",
    "email": "[email protected]"
    // ...other fields as specified in "Fields to Include"
  },
  {
    "id": 124,
    "name": "Jane Smith",
    "email": "[email protected]"
    // ...other fields
  }
]
  • No binary data is produced by this operation.

Dependencies

  • Odoo API: Requires access to an Odoo instance with valid credentials (URL, username, password, and database name).
  • n8n Credentials: You must configure Odoo API credentials in n8n under the name odooApi.

Troubleshooting

Common issues:

  • Invalid credentials: If the Odoo API credentials are incorrect, authentication will fail. Error message: "Credentials are not valid" or "Settings are not valid: ..."
    • Resolution: Double-check the URL, username, password, and database name in your n8n credentials.
  • Field selection errors: Specifying invalid or non-existent fields in "Fields to Include" may result in empty or partial responses.
    • Resolution: Use the provided field selector or verify field names in your Odoo model.
  • API limits: Requesting too many records at once (e.g., setting "Limit" above 1000) may cause errors or performance issues.
    • Resolution: Keep "Limit" within the allowed range (1–1000).

Links and References

Discussion