Directus icon

Directus

Consume Directus API

Overview

This node integrates with the Directus API to update an existing activity comment. Specifically, for the "Activity" resource and the "Update" operation, it allows users to modify the content of a comment identified by its ID. This is useful in scenarios where you want to programmatically edit comments or notes associated with activities tracked in Directus, such as updating status messages, correcting information, or adding additional context.

Practical example:
You have an automation workflow that monitors project tasks and logs activity comments. If a comment needs correction or additional details after creation, this node can update the comment content without manual intervention.

Properties

Name Meaning
Comment The updated content of the comment. Supports Markdown formatting.
ID The unique identifier (index) of the comment to update. Must be a number greater than 0.
Update Fields Additional optional fields:
- Meta: Metadata to return in the response (string).

Output

The node outputs a JSON object representing the updated activity comment returned from the Directus API. The structure typically includes the updated comment data fields as provided by Directus.

  • json: Contains the updated comment data.
  • No binary data output is involved in this operation.

Dependencies

  • Requires a valid connection to the Directus API via an API key credential configured in n8n.
  • The node uses HTTP PATCH requests to the Directus endpoint activity/comment/{id}.
  • Proper permissions on the Directus instance are necessary to update activity comments.

Troubleshooting

  • Common issues:

    • Invalid or missing comment ID will cause the update to fail.
    • Insufficient permissions in Directus to update activity comments.
    • Network or authentication errors connecting to the Directus API.
  • Error messages:

    • "error": "Not Found": The specified comment ID does not exist.
    • "error": "Unauthorized" or "Forbidden": Check API credentials and user permissions.
    • JSON parsing errors if input parameters are malformed.
  • Resolutions:

    • Verify the comment ID exists before attempting update.
    • Ensure the API key has write access to activity comments.
    • Validate all input parameters, especially the comment text.

Links and References

Discussion