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
- Revisions Actions
- Roles Actions
- Settings Actions
- Users Actions
- Utilities Actions
Overview
The Utilities → Import File Data operation in this n8n node allows you to import data from a file (such as CSV, JSON, etc.) directly into a specified Directus collection. This is particularly useful for bulk data imports, migrations, or automating the process of adding large datasets to your Directus instance.
Common scenarios:
- Migrating data from legacy systems into Directus.
- Automating regular imports of data files received via email, FTP, or other sources.
- Bulk updating or seeding collections with new records from external files.
Practical example:
You receive a CSV export of product data every week. Using this node, you can automatically import that file into your "products" collection in Directus without manual intervention.
Properties
| Name | Type | Meaning |
|---|---|---|
| Collection | options | Unique name of the collection to import the data to. Select from available collections. |
| Binary Property | string | Name of the binary property where the file is stored in the input item. |
Output
- The output will be a single object per execution containing a
jsonfield. - The structure of the
jsonfield depends on the response from the Directus API after importing the file. Typically, it contains information about the import result, such as the number of records imported, any errors, or status messages. - If the response is a primitive value (string, number, boolean), it will be wrapped in an object under the key
result.
Example output:
{
"json": {
"imported": 100,
"errors": [],
"status": "success"
}
}
or, if the response is a simple value:
{
"json": {
"result": "Import completed successfully"
}
}
Dependencies
- Directus API: Requires access to a running Directus instance.
- API Credentials: You must configure the
directusApicredentials in n8n for authentication. - Binary Data: The file to be imported must be present in the binary property of the incoming n8n item.
Troubleshooting
Common issues:
- Missing Binary Data: If the specified binary property does not exist or is empty, the import will fail.
- Invalid File Format: If the file format is not supported by Directus or does not match the expected schema, the import may fail or only partially succeed.
- Collection Not Found: If the specified collection does not exist in Directus, an error will occur.
- Permission Denied: Ensure the API credentials have permission to import data into the target collection.
Error messages and resolutions:
"Cannot read property 'fileName' of undefined": The binary property name is incorrect or missing. Double-check the property name."Request failed with status code 4xx/5xx": Indicates an issue with the Directus API endpoint, permissions, or server availability."Invalid file format": Ensure the uploaded file matches the required format for the target collection.