ChatWoot icon

ChatWoot

Consume ChatWoot API

Overview

The ChatWoot node for n8n enables you to interact with the ChatWoot API, specifically to search for contacts within your ChatWoot account. The "Search Contacts" operation under the "Contact" resource allows users to find contacts based on a query string. This is useful in scenarios where you need to automate workflows that involve retrieving contact information from ChatWoot, such as syncing contacts with other systems, enriching data, or triggering actions based on contact searches.

Practical examples:

  • Automatically searching for contacts matching a specific name or email and using their details in subsequent workflow steps.
  • Integrating ChatWoot contact search results into CRM or marketing automation tools.
  • Triggering notifications or updates when certain contacts are found in ChatWoot.

Properties

Below are the input properties relevant to the "Contact" resource and "Search Contacts" operation:

Display Name Type Meaning
Authentication options Selects the authentication method: either by direct parameters or predefined credentials.
BaseUrl string The base URL of your ChatWoot instance (required if using parameter-based auth).
Access Token string Your ChatWoot access token (required if using parameter-based auth).
Account ID string (Optional) The Account ID to reference; overrides credentials if provided.
Query string The text query used to search for contacts.

Note:

  • Some fields are conditionally displayed based on the selected authentication method.
  • "Query" is required for the "Search Contacts" operation.

Output

The output of this node is an array of JSON objects, each representing a contact that matches the search query. Each object typically contains the contact's details as returned by the ChatWoot API.

Example output structure:

[
  {
    "id": 123,
    "name": "John Doe",
    "email": "john@example.com",
    "phone_number": "+1234567890",
    "created_at": "2023-01-01T12:00:00Z",
    // ...other contact fields
  }
]

The actual fields depend on the ChatWoot API response.

Dependencies

  • External Service: Requires access to a ChatWoot instance.
  • API Key: You must provide a valid ChatWoot access token.
  • n8n Credentials: Optionally, you can use predefined ChatWoot credentials configured in n8n.
  • Environment Variables: None required unless specified by your credential setup.

Troubleshooting

Common issues:

  • Authentication errors:
    • Error message: "Authentication failed" or similar.
      Resolution: Ensure the access token and base URL are correct. If using predefined credentials, verify they are set up properly in n8n.
  • Invalid Account ID:
    • Error message: "Account not found" or similar.
      Resolution: Double-check the Account ID value or leave it blank to use the default from credentials.
  • Empty results:
    • No error, but no contacts returned.
      Resolution: Adjust your query string to match existing contacts.

Error handling:
If an error occurs during execution and "Continue On Fail" is enabled, the node will output an object with an error field containing the error message.

Links and References

Discussion