Databricks AI icon

Databricks AI

Use Databricks AI models for text generation and chat

Overview

This node integrates with Databricks AI models to generate text or chat responses based on user input. It is designed for scenarios where users want to leverage Databricks-hosted large language models (LLMs) for conversational AI, content generation, or assistance tasks. For example, it can be used to build chatbots, automate customer support replies, generate creative writing, or provide AI-driven suggestions within workflows.

The node sends a system message defining the AI's behavior and a user message as input, then receives generated text from the specified Databricks model. Users can customize generation parameters like maximum token length, randomness, and sampling methods.

Properties

Name Meaning
Model Name The name of the Databricks AI model to use for generating responses.
System Message A message that sets the context or behavior of the AI assistant (e.g., "You are an AI assistant").
User Message The actual message or prompt sent to the AI for generating a response.
Options Collection of optional parameters:
- Maximum Length Maximum number of tokens the AI should generate in its response (default 256).
- Temperature Controls randomness in output; 0 = deterministic, 2 = very random (default 0.7).
- Top P Alternative to temperature, controls nucleus sampling probability between 0 and 1 (default 1).
- Return Full Response If true, returns the entire API response including metadata instead of just the generated text.

Output

The node outputs JSON data with the following structure:

  • If Return Full Response is false (default):

    {
      "content": "Generated text from the AI",
      "role": "assistant",
      "input": {
        "systemMessage": "...",
        "userMessage": "..."
      }
    }
    

    This contains the AI-generated text under content, the role as "assistant", and echoes back the input messages.

  • If Return Full Response is true:
    The full API response from Databricks is returned under json, along with the original input messages under input. This includes all metadata and raw fields from the API.

The node does not output binary data.

Dependencies

  • Requires a valid Databricks API credential with:
    • Host URL for the Databricks instance.
    • An API authentication token with permission to invoke serving endpoints.
  • The node makes HTTP POST requests to the Databricks serving endpoint URL constructed as:
    {host}/serving-endpoints/{modelName}/invocations
    
  • No additional external dependencies beyond standard HTTP and n8n workflow helpers.

Troubleshooting

  • No credentials found error: Ensure that the Databricks API credential is configured correctly in n8n and linked to this node.
  • HTTP request failures: Check network connectivity, correct host URL, and validity of the API token.
  • Empty or missing response content: Verify that the model name is correct and the model is deployed and available on Databricks.
  • API rate limits or quota exceeded: Monitor usage limits on your Databricks account.
  • Invalid parameter values: Make sure numeric options like temperature and topP are within allowed ranges (temperature 0-2, topP 0-1).

If the node throws an error containing a response object, it surfaces the API error details to help diagnose issues.

Links and References

Discussion