HeyGen icon

HeyGen

Consume HeyGen API

Overview

This node integrates with the HeyGen API to upload documents as assets. It supports uploading files either from binary data available in the workflow or by fetching a file from a provided URL. This functionality is useful when you want to programmatically add documents, images, videos, or audio files to HeyGen's platform for further processing or storage.

Common scenarios include:

  • Uploading media files generated or processed earlier in an n8n workflow.
  • Importing external files via URLs into HeyGen for use in avatar creation, video generation, or other content creation tasks.
  • Automating asset management by integrating file uploads directly into your automation pipelines.

Example: You have a PDF or image stored in binary form in a previous node and want to upload it to HeyGen for use in AI-generated content.

Properties

Name Meaning
Binary Data Boolean option to specify if the upload source is binary data from the workflow.
Binary Property The name of the binary property holding the data to upload (used only if Binary Data is true).
File URL The URL of the file to upload (used only if Binary Data is false).

Output

The node outputs JSON data representing the response from the HeyGen API after uploading the document. This typically includes metadata about the uploaded asset such as its ID, status, and any relevant URLs or references returned by the API.

If binary data is uploaded, the node sends the raw binary content to the API but does not output binary data itself; the output remains JSON describing the upload result.

Dependencies

  • Requires an active HeyGen API credential configured in n8n to authenticate requests.
  • Uses the HeyGen API endpoint /asset for uploading documents.
  • If uploading via URL, the node performs an HTTP GET request to fetch the file before uploading.

Troubleshooting

  • No binary data exists on item!
    Occurs if "Binary Data" is enabled but the current input item lacks any binary data. Ensure the previous node outputs binary data.

  • No binary data property "[propertyName]" exists on item!
    Happens if the specified binary property name does not exist in the input item. Verify the correct binary property name is set.

  • File URL is required!
    Triggered when "Binary Data" is disabled but no file URL is provided. Provide a valid URL pointing to the file to upload.

  • Unsupported file type or MIME type detection issues
    The node attempts to infer MIME type from the file extension. If the file has an uncommon extension, the MIME type may default to application/octet-stream. This usually does not block upload but may affect how the file is handled downstream.

Links and References


This summary focuses exclusively on the Document resource's Upload operation as requested.

Discussion