ChatWoot icon

ChatWoot

Interact with ChatWoot API

Actions113

Conversations → Conversation Filter

AI-generated

Overview

The "Conversation Filter" operation in the Conversations resource allows users to query and filter conversations from an account based on specific attributes and conditions. This node is useful when you want to retrieve a subset of conversations that meet certain criteria, such as filtering by conversation status or user attributes.

Practical examples include:

  • Fetching all conversations with a "pending" status.
  • Filtering conversations where the browser language is not English.
  • Combining multiple attribute filters using logical operators (AND/OR) to refine the search results.

This operation helps automate workflows that depend on targeted conversation data, such as triggering follow-ups only for pending conversations or analyzing conversations from users with specific characteristics.

Properties

Name Meaning
Account Id The numeric ID of the account whose conversations you want to filter.
Page The page number of the paginated results to retrieve. Useful for navigating through large result sets.
Payload A JSON array defining the filter criteria. Each object specifies:
- attribute_key: The conversation attribute to filter on (e.g., "status", "browser_language").
- filter_operator: The comparison operator (e.g., "eq" for equals, "not_eq" for not equals).
- values: An array of values to compare against.
- query_operator: Logical operator ("AND"/"OR") to combine this filter with others.

Example payload:

[
  {
    "attribute_key": "browser_language",
    "filter_operator": "not_eq",
    "values": ["en"],
    "query_operator": "AND"
  },
  {
    "attribute_key": "status",
    "filter_operator": "eq",
    "values": ["pending"],
    "query_operator": null
  }
]

Output

The node outputs JSON data representing the filtered list of conversations matching the specified criteria. The structure typically includes conversation details such as IDs, statuses, attributes, timestamps, and other metadata returned by the ChatWoot API.

If binary data is present (not indicated here), it would represent attachments or media related to conversations, but this operation primarily deals with JSON conversation data.

Dependencies

  • Requires an active connection to the ChatWoot API.
  • Needs an API authentication token configured in n8n credentials to authorize requests.
  • The base URL for the ChatWoot instance must be set in the credentials.

Troubleshooting

  • Invalid Account Id: Ensure the provided account ID exists and is accessible with the given API credentials.
  • Malformed Payload: The payload must be valid JSON and conform to the expected filter schema. Invalid JSON or incorrect filter keys/operators will cause errors.
  • Pagination Issues: If no results appear, verify the page number; pages beyond available data return empty results.
  • Authentication Errors: Check that the API key/token is valid and has sufficient permissions to read conversations.
  • API Rate Limits: Excessive requests may lead to rate limiting; implement retries or backoff strategies if needed.

Links and References

Discussion