Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Items → Update

AI-generated

Overview

The Directus (DrWade) n8n node for the resource Items and operation Update allows you to update an existing item in a specified collection within your Directus instance. This is useful when you need to modify data records programmatically as part of an automated workflow, such as updating article content, changing user information, or modifying any custom data stored in Directus collections.

Practical examples:

  • Updating the title and body of an article in a CMS.
  • Modifying product details in an e-commerce catalog.
  • Changing status fields or metadata for project management items.

Properties

Name Type Meaning
ID String Unique ID of the item object to update.
Collection Options The unique name of the parent collection where the item resides.
Data (JSON) JSON The partial item object containing the fields and values to update.

Output

  • The output will be a single json object representing the updated item as returned by the Directus API.
  • The structure of this object depends on the schema of your collection and the fields you updated, but typically it will include all fields of the item after the update.
  • Example output:
    {
      "id": "15",
      "title": "Hello world!",
      "body": "This is our first article",
      "...": "other fields as defined in your collection"
    }
    

Dependencies

  • Directus API: You must have access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials (directusApi) configured in n8n.
  • Collection and Item: The specified collection and item ID must exist in your Directus instance.

Troubleshooting

  • Invalid ID or Collection: If the provided ID or collection does not exist, the node will throw an error indicating that the item was not found.
  • Malformed Data (JSON): If the Data (JSON) property is not valid JSON or does not match the expected schema, you may receive errors from the Directus API.
  • Permission Denied: Ensure the API credentials used have permission to update items in the specified collection.
  • Error Handling: If an error occurs and "Continue On Fail" is enabled, the node will output an error message in the json.error field.

Links and References


Summary:
This node operation is ideal for automating updates to structured data in Directus, making it valuable for content management, inventory systems, and any scenario where data needs to be kept up-to-date automatically.

Discussion