content/guides/12.integrations/1.n8n/directus-n8n-actions.md
This guide covers how to use the Directus Node to perform actions on your Directus data in n8n workflows, including working with items, users, and files.
← Back to Directus + n8n Overview
The Directus node lets you perform actions on your Directus data. It works with three types of resources: Items, Users, and Files.
Quick reference of all available actions organized by resource type:
| Resource | Operation | Description |
|---|---|---|
| Items | Create | Add a new item to a collection |
| Items | Get | Retrieve a single item by ID |
| Items | Get Many | Retrieve multiple items with optional filters |
| Items | Update | Modify an existing item |
| Items | Delete | Permanently remove an item |
| Users | Invite | Send an invitation to a new user |
| Users | Get | Retrieve a single user by ID |
| Users | Get Many | Retrieve multiple users with optional filters |
| Users | Update | Modify an existing user |
| Users | Delete | Permanently remove a user |
| Files | Upload a File | Upload a file from binary data |
| Files | Import a File | Import a file from a URL |
| Files | Get | Retrieve a single file by ID |
| Files | Get Many | Retrieve multiple files with optional filters |
| Files | Update | Modify file metadata |
| Files | Delete | Permanently remove a file |
Most operations follow a similar pattern across resources. Set the Resource type (Item, User, or File), choose the Operation, and configure the required fields.
These operations work similarly across all resources:
Note for Items: When creating or updating items, you must select the Collection first. For Users and Files, no collection selection is needed.
::callout{icon="material-symbols:warning-rounded" color="warning"} Permanent Deletion Delete operations permanently remove data. Make sure this is what you want to do! ::
Note for Items: Select the Collection before configuring filters.
Items are content entries in your Directus collections (blog posts, products, pages, etc.). All standard operations require selecting a Collection first.
Example: Create a blog post
poststitle, content, statusSet Resource to User → Operation to Invite → Enter Email → Select Role.
All other operations (Get, Get Many, Update, Delete) follow the standard pattern above.
Set Resource to File → Operation to Upload a File. The file must come from a previous node that outputs binary data (like an HTTP Request node). Optionally set Title, Description, and Folder.
Set Resource to File → Operation to Import a File → Enter File URL
All other operations (Get, Get Many, Update, Delete) follow the standard pattern above.
You can use n8n expressions to reference data from previous nodes:
{{ $json.id }} - Get the ID from the previous node{{ $json.title }} - Get the title field{{ $json.email }} - Get the email fieldThis is especially useful when chaining Directus nodes together. For example, use {{ $json.id }} to update an item that was just created in a previous node.
When getting items, you can select specific fields to return. This is helpful when:
::callout{icon="material-symbols:info-outline"} Performance Tip Selecting only the fields you need reduces data transfer and improves workflow performance, especially with large collections. ::
For Get Many operations on Users and Files, use the Simplify option to get only the most commonly used fields. This makes the data easier to work with in subsequent nodes.
When working with Directus API through n8n, you may encounter various error codes. For a comprehensive list of Directus error codes and their meanings, refer to the official Directus Error Codes documentation.
If you get errors:
If you encounter issues: