Xata icon

Xata

Consume Xata API

Overview

This node allows you to interact with the Xata database service from n8n. Specifically, for the Default resource and Delete operation, it enables you to delete a record from a specified table in your Xata workspace by its ID. This is useful for automating data cleanup, removing obsolete records, or integrating Xata data management into broader workflows.

Practical examples:

  • Automatically deleting user accounts or entries when they are removed from another system.
  • Cleaning up test data after running automated tests.
  • Removing outdated inventory items as part of an e-commerce workflow.

Properties

Name Type Meaning
Workspace Slug string The unique slug identifier for your Xata workspace.
Database Location options The region where your Xata database is hosted (e.g., us-east-1, us-west-2, eu-west-1).
Database Name string The name of the Xata database you want to access.
Branch Name string The branch within the database to target.
Table Name string The specific table from which you want to delete a record.
ID string The unique identifier of the record to delete.

Output

The output is a JSON array where each item corresponds to the result of a delete attempt for an input item. Each output object contains:

  • recordId: The ID of the deleted record.
  • respondeData: The full HTTP response data from the Xata API for the delete request.

If an error occurs and "Continue On Fail" is enabled, the output will include:

  • error: The error message describing what went wrong.

Example output:

[
  {
    "recordId": "abc123",
    "respondeData": { /* HTTP response details */ }
  },
  {
    "error": "Record not found, ID: xyz789 StatusCode: 404"
  }
]

Dependencies

  • Xata API: Requires a valid Xata API key configured in n8n credentials under "xataApi".
  • n8n Configuration: Ensure that the Xata node is properly installed and that credentials are set up in your n8n instance.

Troubleshooting

Common issues:

  • Missing Credentials: If no Xata API credentials are provided, the node will throw an error:
    "No credentials provided for Xata Api"

    • Resolution: Set up and select the correct Xata API credentials in the node.
  • Invalid Record ID: If the specified ID does not exist, the node may return an error like:
    "Record not found, ID: <id> StatusCode: 404"

    • Resolution: Double-check the ID value and ensure the record exists in the specified table.
  • Incorrect Database/Table/Branch: Providing incorrect names for the database, table, or branch can lead to failed requests.

    • Resolution: Verify all property values match those in your Xata workspace.
  • API Key Permissions: If the API key lacks permission to delete records, the operation will fail.

    • Resolution: Ensure the API key has sufficient permissions for the intended operation.

Links and References

Discussion