Directus (DrWade) icon

Directus (DrWade)

Consume Directus API

Overview

The Directus (DrWade) n8n node for the resource Activity and operation Update allows you to update an existing comment on an activity within a Directus instance. This is useful in scenarios where you need to programmatically modify or correct comments associated with activities, such as updating status notes, correcting information, or appending additional context.

Practical examples:

  • Automatically updating a comment when a related task's status changes.
  • Correcting typos or errors in previously posted activity comments.
  • Adding follow-up information to an activity log entry after further review.

Properties

Name Type Meaning
Comment String The updated content of the comment. Supports Markdown formatting.
ID Number The unique identifier of the comment to be updated.
Update Fields Object Additional optional fields for the update. Currently supports "Meta" for response data.

Details:

  • Comment is required and represents the new text for the comment.
  • ID is required and specifies which comment will be updated.
  • Update Fields is optional and can include:
    • Meta: Specifies what metadata should be returned in the response.

Output

The output will be a single object per input item, under the json field. The structure of this object corresponds to the updated comment data as returned by the Directus API. Typical fields may include:

{
  "id": 123,
  "comment": "My updated comment",
  // ...other fields as provided by Directus for the comment entity
}
  • If the API returns additional metadata (when requested via the "Meta" field), it will also be included in the output.
  • No binary data is produced by this operation.

Dependencies

  • Directus API: You must have access to a running Directus instance.
  • API Credentials: The node requires valid Directus API credentials configured in n8n under the name directusApi.

Troubleshooting

Common issues:

  • Invalid ID: If the specified ID does not correspond to an existing comment, the API will likely return a "Not Found" error.
  • Missing Required Fields: Omitting the "Comment" or "ID" fields will result in validation errors.
  • Insufficient Permissions: The API credentials used must have permission to update activity comments; otherwise, you may receive a "Forbidden" or "Unauthorized" error.

Error messages and resolutions:

  • "error": "Not Found": Check that the ID is correct and the comment exists.
  • "error": "Missing required property: comment": Ensure the "Comment" field is filled in.
  • "error": "Forbidden" or "error": "Unauthorized": Verify your API credentials and permissions in Directus.

Links and References


Discussion