Chat Data icon

Chat Data

Basic Chat Data Node

Overview

This node interacts with a chatbot service API to perform various operations related to chatbots, actions, and triggers. Specifically for the Chatbot - Update Base Prompt operation, it updates the base prompt text of an existing chatbot. This is useful when you want to change the foundational instructions or context that guide the chatbot's behavior.

Common scenarios include:

  • Refining or correcting the chatbot’s initial prompt to improve response quality.
  • Updating the chatbot’s personality or tone by changing its base prompt.
  • Adjusting the chatbot’s context after new information or business rules are introduced.

Example: You have a customer support chatbot and want to update its base prompt to better handle refund requests. Using this node operation, you provide the chatbot ID and the new base prompt text, and the node sends the update request to the chatbot service.

Properties

Name Meaning
Chatbot Name or ID Select from a list of available chatbots or specify a chatbot ID via expression.
Base Prompt The new base prompt string to set for the chatbot, defining its initial instructions/context.

Output

The output JSON contains the response from the chatbot service API after attempting to update the base prompt. It includes:

  • success: A boolean indicating if the update was successful (true).
  • chatbotId: The ID of the chatbot updated.
  • Other fields returned by the API, which may include status messages or metadata.

If the update fails, the node throws an error with a descriptive message unless "Continue On Fail" is enabled, in which case the error details are included in the output JSON.

Dependencies

  • Requires an API key credential for authenticating with the chatbot service.
  • The node uses the base URL configured in the credentials to send HTTP POST requests to the /api/v2/update-chatbot-settings endpoint.
  • Proper configuration of the API key and base URL in n8n credentials is necessary.

Troubleshooting

  • Missing or invalid API credentials: Ensure the API key and base URL are correctly set in the node credentials.
  • Invalid chatbot ID: Verify that the chatbot ID exists and is accessible with your API key.
  • API errors: The node surfaces error messages returned by the chatbot service. Common issues might be malformed prompts or permission errors.
  • Network issues: Check connectivity to the chatbot service endpoint.
  • If the node returns an error like "Failed to fetch chatbots" or "Invalid response format", verify the API endpoint and credentials.
  • When using expressions for chatbot ID, ensure they resolve to valid IDs.

Links and References

  • n8n Expressions Documentation
  • Refer to your chatbot service API documentation for details on the /api/v2/update-chatbot-settings endpoint and base prompt usage.

Discussion