Actions111
- Item Actions
- Webhook Actions
- Collection Actions
- File Actions
- Activity Actions
- Asset Actions
- Authentication Actions
- Extension Actions
- Field Actions
- Folder Actions
- Permission Actions
- Preset Actions
- Relation Actions
- Revision Actions
- Role Actions
- Setting Actions
- User Actions
- Utility Actions
Overview
The "Import File Data" operation under the Utility resource is designed to import data from a file into a specified collection. This node is useful when you need to bulk upload or migrate data from external files (such as CSV, JSON, etc.) directly into your application's database or content management system. Common scenarios include onboarding new datasets, synchronizing data between systems, or restoring backups.
Practical Example:
You have a CSV file containing a list of articles. By using this node, you can import all articles into the "articles" collection in one step.
Properties
| Name | Meaning |
|---|---|
| Collection Name | Unique name of the collection to import the data to. Options are dynamically loaded. |
| Binary Property | Name of the Binary Property where the file is stored. |
Output
- The output will be a JSON object reflecting the result of the import operation.
- The structure typically includes information about the imported records, such as success status, number of records imported, and any errors encountered.
- If binary data is involved, it refers to the file being imported; however, the output itself is expected to be in JSON format summarizing the import results.
Dependencies
- Requires access to the target system or service where the collection resides (e.g., a Directus instance).
- May require authentication credentials or API keys configured in n8n for the connection.
- The file to be imported must be available as a binary property in the workflow.
Troubleshooting
Common Issues:
- Incorrect collection name: Ensure the collection exists and is spelled correctly.
- Missing or incorrect binary property: Verify that the file is attached to the correct binary property.
- File format issues: The file must be in a supported format (e.g., CSV, JSON) compatible with the import process.
Error Messages:
- "Collection not found": Check the collection name and ensure it exists in the target system.
- "Binary property missing": Make sure the file is uploaded and referenced by the correct binary property name.
- "Invalid file format": Confirm the file's format matches what the import expects.
Links and References
- n8n Documentation: Working with Binary Data
- n8n Documentation: Custom Nodes
- Directus Documentation (if applicable to your backend)