ChatWoot icon

ChatWoot

Interact with ChatWoot API

Actions100

Overview

The Update Agent Bot operation for the Inboxes resource in this custom n8n node allows you to update the agent bot assigned to a specific inbox within a ChatWoot account. This is useful for automating the management of support or sales inboxes, ensuring that the correct bot is handling conversations as your workflows or business logic require.

Common scenarios:

  • Automatically reassigning an agent bot when certain conditions are met (e.g., after hours, high load).
  • Integrating with other systems to dynamically manage which bot is responsible for a given inbox.
  • Streamlining onboarding/offboarding processes by updating bot assignments programmatically.

Practical example:
If you have multiple bots for different languages or departments, you can use this node to switch the assigned bot based on customer input or workflow triggers.


Properties

Display Name Type Description
Account Id Number The numeric ID of the ChatWoot account.
Id Number The ID of the inbox to update.
Agent Bot Number The ID of the agent bot to assign.

All properties are required for this operation.


Output

The node outputs a json object containing the response from the ChatWoot API after updating the agent bot for the specified inbox. The structure typically includes details about the updated inbox, such as its ID, name, and the newly assigned agent bot. The exact fields depend on the ChatWoot API's response schema.

Example output:

{
  "id": 123,
  "name": "Support Inbox",
  "agent_bot": 456,
  // ...other inbox details
}

Note: This node does not output binary data.


Dependencies

  • External Service: Requires access to a ChatWoot instance.
  • API Credentials: Needs a configured chatwootApi credential in n8n, including the base URL (url) and authentication details.
  • n8n Configuration: Ensure the credentials are set up in the n8n credentials store.

Troubleshooting

Common issues:

  • Invalid Account or Inbox ID: If the provided Account Id or Id does not exist, the API will likely return a 404 error.
  • Missing or Incorrect Credentials: If the chatwootApi credential is missing or incorrect, authentication errors (401/403) will occur.
  • Agent Bot Not Found: Providing an invalid Agent Bot ID may result in an error indicating the bot does not exist.

Error messages and resolutions:

  • "Account not found": Check that the Account Id is correct and exists in ChatWoot.
  • "Inbox not found": Verify the Inbox Id is valid for the given account.
  • "Agent bot not found": Ensure the Agent Bot ID is correct and available in your ChatWoot setup.
  • "Unauthorized": Double-check your API credentials in n8n.

Links and References

Discussion