Databricks icon

Databricks

Interact with Databricks API

Overview

This node integrates with the Databricks Unity Catalog API to manage data governance and metadata within a Databricks workspace. Specifically, the Create Function operation under the Unity Catalog resource allows users to create a new function inside a specified schema of a catalog. This is useful for automating the deployment or registration of user-defined functions (UDFs) or stored procedures in Databricks environments.

Typical use cases include:

  • Automating the creation of database functions as part of CI/CD pipelines.
  • Managing and versioning functions programmatically within Databricks Unity Catalog.
  • Integrating function creation into broader data workflows orchestrated by n8n.

Properties

Name Meaning
Catalog Select the Unity Catalog to work with. The list is dynamically loaded from your Databricks workspace.
Schema Select the schema within the chosen catalog where the function will be created. This list is dynamically populated based on the selected catalog.

Note: The provided properties snippet only includes Catalog and Schema. Additional properties related to the function creation (e.g., function name, definition, language) are not shown in the snippet but would typically be required for this operation.

Output

The node outputs JSON data representing the response from the Databricks Unity Catalog API after attempting to create the function. This typically includes details about the newly created function such as its name, schema, catalog, and other metadata returned by the API.

If an error occurs during the API call, the output JSON will contain error information including status codes and messages.

The node does not output binary data for this operation.

Dependencies

  • Requires an active Databricks workspace with Unity Catalog enabled.
  • Needs an API authentication token credential configured in n8n to authorize requests against the Databricks REST API.
  • The node uses the /api/2.1/unity-catalog/catalogs and /api/2.1/unity-catalog/schemas endpoints to populate options dynamically.
  • The base URL and authorization header are set from the provided credentials.

Troubleshooting

  • Common Issues:

    • Authentication errors: Ensure the API token credential is valid and has sufficient permissions to create functions in Unity Catalog.
    • Invalid catalog or schema selection: The catalog and schema must exist and be accessible by the authenticated user.
    • Missing required parameters: The function creation requires specific parameters (not fully detailed here); missing these will cause API errors.
  • Error Messages:

    • API Error: <status> <statusText>: Indicates the API responded with an error status. Check the detailed message for specifics (e.g., permission denied, invalid input).
    • Network Error: No response received from server: Suggests connectivity issues or incorrect base URL configuration.
    • Other validation errors returned by the API will appear in the output JSON's error field.
  • Resolution Tips:

    • Verify credentials and permissions in Databricks.
    • Confirm that the selected catalog and schema exist and are spelled correctly.
    • Review the API documentation for required fields when creating a function.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during workflow execution.

Links and References


Note: The source code provided shows the general structure of the node and how it handles different resources and operations, but the exact implementation details for the "Create Function" operation under "Unity Catalog" are not explicitly included. The summary above is based on the available property definitions and typical usage patterns of the Databricks Unity Catalog API.

Discussion