Actions100
- Activity Actions
- Asset Actions
- Authentication Actions
- Collection Actions
- Extension Actions
- Field Actions
- File Actions
- Folder Actions
- Item Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
The node is designed to update multiple items within a specified collection in a Directus data source. It allows users to provide an array of partial item objects, each identified by keys, and apply updates to those items in bulk. This operation is useful when you need to modify several records at once without making individual update calls for each item.
Practical examples include:
- Publishing multiple articles simultaneously by setting their status to "published".
- Updating the category or tags of several products in an inventory.
- Changing the state or approval status of multiple user-submitted entries in one request.
Properties
Name | Meaning |
---|---|
Collection Name | The unique name of the parent collection where the items reside. Example: "articles", "products". |
Data (JSON) | A JSON object containing two fields: keys (an array of item IDs to update) and data (the partial item object with fields to update). For example: json<br>{<br> "keys": [1, 2],<br> "data": {<br> "status": "published"<br> }<br>}<br> |
Output
The output contains a JSON field representing the result of the bulk update operation. Typically, this will confirm which items were updated and may include metadata about the operation's success or failure per item. The exact structure depends on the underlying API response but generally includes identifiers of updated items and status information.
No binary data output is expected from this operation.
Dependencies
- Requires connection to a Directus instance with appropriate permissions to update items in the specified collection.
- Needs an API authentication token or API key credential configured in n8n to authorize requests.
- The node relies on internal methods to load available collections dynamically for selection.
Troubleshooting
Common issues:
- Providing invalid or non-existent collection names will cause errors.
- Supplying incorrect item keys (IDs) that do not exist in the collection will result in partial or complete failure of the update.
- Malformed JSON in the Data property can cause parsing errors.
- Insufficient permissions to update items in the collection will lead to authorization errors.
Error messages and resolutions:
- "Collection not found": Verify the collection name is correct and exists in the Directus instance.
- "Invalid keys provided": Ensure the keys array contains valid item IDs present in the collection.
- "Unauthorized" or "Forbidden": Check that the API credentials have update permissions for the target collection.
- "Malformed JSON": Validate the JSON syntax in the Data property before execution.