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 Asset - Get operation in this custom n8n node retrieves information about a specific asset (such as a file) from an external service, likely a Digital Asset Management or CMS platform. It allows users to fetch asset metadata and optionally include the actual file data. The node supports advanced options for customizing the returned data, such as specifying image transformations, output format, and quality.
Common scenarios:
- Downloading files or images stored in a remote system.
- Fetching asset metadata for further processing or integration.
- Generating thumbnails or transformed versions of images on-the-fly.
- Automating workflows that require access to digital assets based on their ID.
Practical examples:
- Retrieve a product image by its ID and resize it for use in an e-commerce listing.
- Download a PDF document from a CMS and send it via email.
- Fetch asset details and include a thumbnail preview for reporting purposes.
Properties
| Name | Type | Meaning |
|---|---|---|
| JSON/RAW Parameters | Boolean | Whether to provide query/body parameters as raw JSON or via the UI. Enables direct JSON input for advanced queries. |
| Query Parameters | JSON | Custom query parameters as a flat JSON object. Used when "JSON/RAW Parameters" is enabled. |
| ID | String | The unique identifier of the asset/file to retrieve. Required. |
| Include File Data | Boolean | If enabled, includes the actual file data along with the asset metadata. Useful for downloading the file itself. |
| Binary Property | String | The name of the binary property where the downloaded file will be stored in n8n. For multipart uploads, multiple mappings can be specified. |
| Additional Fields | Collection | Optional fields to customize the response: - Fit: How the image should fit within the requested dimensions. - Format: Output file format (jpg, png, tiff, webp). - Height/Width: Thumbnail size. - Key: Asset size key. - Quality: Image quality (1-100). - Transforms (JSON): Array of image transformations. - Without Enlargement: Prevents upscaling. |
Output
- json: Contains the asset metadata and, if requested, may also include information about the file data.
- Binary: If "Include File Data" is enabled, the node outputs the file content as a binary property (named according to "Binary Property"). This allows downstream nodes to process or save the file.
Dependencies
- External Service/API: Requires access to a compatible asset management or CMS API (e.g., Directus).
- API Key / Authentication: May require API credentials configured in n8n for authentication.
- n8n Configuration: Ensure the node has network access to the target API endpoint.
Troubleshooting
Common issues:
- Invalid Asset ID: If the provided ID does not exist, the node may return a "Not Found" error.
- Authentication Errors: Missing or incorrect API credentials can result in authorization failures.
- Incorrect Binary Property Name: If the "Binary Property" does not match downstream expectations, subsequent nodes may not find the file data.
- Malformed JSON in Query Parameters or Transforms: Supplying invalid JSON will cause parsing errors.
Error messages and resolutions:
"Asset not found": Check the ID value and ensure the asset exists in the source system."Invalid JSON": Verify that any JSON input (Query Parameters, Transforms) is correctly formatted."Missing required property": Ensure all required fields (like ID and Binary Property) are filled.
Links and References
- n8n Documentation: Working with Binary Data
- Directus API Reference
- Image Transformation Options (Sharp) (if relevant to transforms)