Overview
The Xata node for n8n allows you to interact with the Xata database service. Specifically, when using the Default resource and the Update operation, this node updates an existing record in a specified table within your Xata workspace. This is useful for workflows where you need to modify data in-place, such as updating user profiles, changing order statuses, or correcting information in your database.
Practical examples:
- Updating a user's email address based on their ID.
- Modifying the status of an order in an e-commerce workflow.
- Changing configuration values in a settings table.
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 database you want to access. |
| Branch Name | string | The branch of the database to use (similar to Git branches). |
| Table Name | string | The name of the table containing the record to update. |
| ID | string | The unique identifier of the record you wish to update. |
| Send All Columns | boolean | Whether to send all columns from the input item to Xata. |
| Columns | string[] | (If "Send All Columns" is false) List of column names to update in the record. |
| Additional Options | collection | Extra options for the update operation: - Ignore Columns: Columns to exclude from update if "Send All Columns" is true. |
Output
- The output is a JSON object representing the updated record as returned by the Xata API.
- If an error occurs and "Continue On Fail" is enabled, the output will contain an
errorfield with the error message.
Example output:
[
{
"id": "rec_123",
"name": "Updated Name",
"email": "new@email.com",
// ...other fields as returned by Xata
}
]
Or, in case of error:
[
{
"error": "Record not found"
}
]
Dependencies
- External Service: Requires access to the Xata API.
- API Key: You must provide valid Xata API credentials via the
xataApicredential in n8n. - n8n Configuration: No special environment variables are required beyond standard credential setup.
Troubleshooting
Common Issues:
Missing Credentials: If no Xata API key is provided, the node will throw an error:
"No credentials provided for Xata Api"- Resolution: Ensure you have set up the
xataApicredential in n8n.
- Resolution: Ensure you have set up the
Invalid Record ID: If the specified ID does not exist, Xata may return an error indicating the record was not found.
- Resolution: Double-check the ID value and ensure the record exists.
Insufficient Permissions: If the API key lacks permission to update records, the operation will fail.
- Resolution: Verify that the API key has write access to the target database/table.
Incorrect Column Names: If you specify columns that do not exist in the table, the update may fail.
- Resolution: Ensure all column names match those defined in your Xata table schema.
Error Handling:
- If "Continue On Fail" is enabled, errors for individual items will be included in the output under the
errorfield, allowing the workflow to proceed with other items.