Knack icon

Knack

Interact with Knack API

Overview

This node integrates with the Knack API to manage records within Knack objects. Specifically, the Upload File operation under the Record resource allows users to upload files to Knack either from binary data available in the workflow or directly from a URL.

Typical use cases include:

  • Uploading user-generated files (images, documents) stored as binary data in previous workflow steps.
  • Fetching and uploading external files by providing their URLs.
  • Automating file uploads to Knack applications without manual intervention.

For example, you might use this node to upload profile pictures collected via a form (binary data) or import images hosted on external servers by specifying their URLs.

Properties

Name Meaning
Upload Source Choose whether to upload the file from Binary Data (file data present in the workflow) or from a URL (downloaded from the internet).
Binary Property (Required if Upload Source is Binary Data) The name of the binary property in the input item that contains the file to upload. Default is "data".
File URL (Required if Upload Source is URL) The direct URL of the file to be uploaded.
File Name (Optional if Upload Source is URL) The desired filename for the uploaded file. If not provided, the filename will be extracted from the URL.
Additional Options Collection of extra options; currently supports:
- Include Field Keys: Whether to duplicate field values with a "_raw" suffix (e.g., "Name" and "Name_raw"). Defaults to true.

Output

The node outputs JSON objects containing details about the uploaded file:

  • success: Boolean indicating if the upload was successful.
  • assetId: The unique identifier of the uploaded asset in Knack.
  • filename: The name of the uploaded file.
  • mimeType: The MIME type of the uploaded file.
  • size: Size of the uploaded file in bytes.
  • uploadSource: Indicates whether the file was uploaded from binary data or URL.
  • response: The full response object returned by the Knack API after upload.

Each output item is paired with its corresponding input item.

If an error occurs during upload and the node is configured to continue on failure, the output will contain an error field describing the issue instead of the success fields.

Dependencies

  • Requires valid credentials for the Knack API, including an application ID and an API key.
  • The node uses HTTP requests to communicate with the Knack API endpoints.
  • For URL uploads, the node performs an HTTP GET request to fetch the file content before uploading.
  • For binary uploads, the node expects binary data to be present in the workflow's input items.

Troubleshooting

  • Common Issues:

    • Invalid or missing API credentials will cause authentication failures.
    • Providing an incorrect binary property name will result in errors fetching the binary data.
    • Invalid or inaccessible file URLs will cause download failures.
    • Large files exceeding Knack's size limits may fail to upload.
  • Error Messages:

    • "Upload failed": General failure during upload, possibly due to network issues or invalid data.
    • Errors related to missing binary data or invalid property names.
    • HTTP errors when fetching files from URLs (e.g., 404 Not Found, 403 Forbidden).
  • Resolutions:

    • Verify API credentials are correctly set up in n8n.
    • Ensure the binary property name matches the actual binary data property in the workflow.
    • Confirm the file URL is accessible and points directly to a downloadable file.
    • Check Knack's file size limits and reduce file size if necessary.
    • Enable "Continue On Fail" in the node settings to handle errors gracefully during batch processing.

Links and References

Discussion