<!-- Markdown twin of https://pixelvault.dev/integrations/n8n/ -->

[Integrations](/integrations/) / n8n

# Turn images into public URLs in n8n

Keep Google Drive as your source, or import a generated image before its URL expires. PixelVault hosts the image and returns a public CDN URL for your next workflow step.

## Use the PixelVault node

If you self-host n8n, you can install the community node `n8n-nodes-pixelvault` from **Settings → Community Nodes**. It adds a PixelVault node with **Upload Image** (from a binary field) and **Import Image From URL**, and returns the public URL as `{{ $json.url }}`. Source and details: [GitHub](https://github.com/pixelvault-dev/n8n-nodes-pixelvault) and [npm](https://www.npmjs.com/package/n8n-nodes-pixelvault).

The node is new and has not yet been verified by n8n, so it is not available on n8n Cloud. On Cloud, use the workflow templates below, which need no community package.

## Download a workflow

-   [Google Drive → PixelVault → public image URL](/workflows/pixelvault-google-drive.json)
-   [Image URL → PixelVault → public image URL](/workflows/pixelvault-image-url.json)

These templates use built-in n8n nodes. No community package is required. They stop after hosting the image; connect your publishing node separately.

## Set up credentials

1.  Create a PixelVault account and copy a project API key from your [dashboard](/dashboard/).
2.  Import the downloaded JSON using n8n’s workflow menu, **Import from File**.
3.  Open **Upload to PixelVault**. Under Generic Credential Type → Header Auth, create a credential with Name `Authorization` and Value `Bearer YOUR_PIXELVAULT_API_KEY`.
4.  Keep the API key in the credential, not in a node field or exported workflow.

Use authenticated uploads for durable storage. Keyless uploads expire. Hosted images are public: choose assets intended for publication, and retain them while scheduled posts or retries still need them.

## Option 1: Download from Google Drive

Open **Download image from Drive**, select your Google Drive credential, and replace the file ID with your image’s ID. The node downloads the file into the binary property `data`.

The next node sends `POST https://api.pixelvault.dev/v1/images` as Form-Data. The form field is `file`, its type is n8n Binary File, and its Input Data Field Name is `data`. Let n8n set the multipart Content-Type and boundary.

A Drive sharing page is not the image file. Downloading it through the Drive node lets you keep the original in Drive while hosting a separate public copy.

### Other binary sources

The upload step is not tied to Google Drive. Replace the Drive node with any node that outputs an image as binary data, such as a screenshot or image-generation node, and set Input Data Field Name to that node’s binary property. It is `data` by default, but some nodes use a different name.

## Option 2: Import a generated image URL

Replace `source_url` in **Set source image URL** with an HTTPS URL that returns image bytes. The upload node sends JSON containing `url` and `folder`. Import while the source URL is still valid. Sources requiring additional authentication should be downloaded in n8n first, then uploaded using the binary workflow.

## Use the result

Execute the workflow manually. **Public image URL** returns `image_url`, `image_id`, and `mime_type`. In the immediately following publishing node, map its image URL input to `{{ $json.image_url }}`. The raw upload response stores the URL at `data.url`.

For an Instagram image post, start with a JPEG that meets Meta’s current size and aspect-ratio requirements. Hosting alone does not convert or validate the image for Instagram. Keep the URL accessible from container creation through successful publication. This integration hosts images, not videos.

## Check before scheduling

-   Open the returned URL without signing in and confirm it serves the image.
-   Run a single test with your publishing node and account before enabling a schedule.
-   For a 401 response, check the credential and Bearer prefix. For 429, check account limits before retrying.
-   Reuse the stored image URL for publishing retries instead of uploading another copy each time.

These are starter templates; an end-to-end Instagram publish has not yet been verified for them.

References: [n8n HTTP Request](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.httprequest/) and [Meta content publishing](https://developers.facebook.com/docs/instagram-platform/instagram-api-with-instagram-login/content-publishing).
