n8n is a good fit for image automation because it lets you see the whole trip: trigger, source download, HTTP request, validation, storage, catalog update, and error branch. That visibility is useful right up until the image turns into a long base64 string or disappears between two nodes because one of them expected JSON.

The main thing to understand is that an image is binary data traveling alongside an n8n item. The metadata may live in $json, while the file itself lives under a binary property such as data. If you preserve that split, the workflow is straightforward. If you flatten everything into JSON because JSON feels familiar, large batches become slow, memory gets interesting, and debugging starts to resemble archaeology.

We’ll build a production-shaped flow around the verified BackgroundErase n8n integration: download one source image, run the native Remove Background From File operation, receive a transparent PNG as binary, store the output, and update durable job state. The node labels can change between n8n releases. The data path is the part worth learning.

n8n rule

Keep metadata in JSON, keep the image in binary, and make every write safe to repeat.

  • Use one item per source image and retain a stable source ID on that item.
  • Download into a named binary property and select it in the native BackgroundErase file operation.
  • Keep the BackgroundErase result as binary data, not JSON.
  • Limit batches and concurrency instead of letting one trigger fan out without a ceiling.
  • Use an Error Trigger workflow plus explicit permanent-failure branches.

01

Build the thin workflow first

Start with one source and one destination. A webhook, Google Drive trigger, Airtable poll, S3 event, or manual test can all produce the first item. Normalize that item immediately so every later node sees the same keys: job ID, source ID, source URL or connector reference, output name, recipe version, and attempt count. The verified BackgroundErase node is available from n8n’s Nodes panel after an instance owner enables verified nodes, so you do not need to build a generic HTTP Request node just to get started.

Trigger Normalize item Download binary BackgroundErase Validate and store Update job

Normalized item metadata

{
      "jobId": "photo_sku-1842_catalog-v3",
      "sourceId": "drive:1AbCDef",
      "sourceVersion": "2026-07-11T15:04:20.000Z",
      "outputName": "sku-1842-background-removed.png",
      "recipeVersion": "catalog-v3",
      "attempt": 1
    }

Do not add review routing, three storage destinations, or a Shopify update until one real image can cross this thin path. Execute node by node and inspect both the JSON and Binary tabs. Pinned test data is useful for metadata, but be cautious about treating a pinned tiny file as proof that production photos will behave the same way.

02

Bring the source in as binary data

If the source node already outputs a file, inspect its binary property name. Many nodes use data, but connectors are free to choose something else. If the trigger gives you only a URL, add an HTTP Request node to download it and choose a file response. Keep the source metadata on the item so the binary body does not become an anonymous blob.

n8n describes binary data as file-type data such as images and documents and provides dedicated nodes for converting, extracting, and reading files. Its current overview is in the official binary data documentation. The practical point is simple: downstream nodes reference the binary property, not a giant string copied into a JSON field.

The binary tab is empty

The download node returned text or JSON. Check response format, redirects, authentication, and whether the URL is a preview page.

The file has no useful name

Set fileName from source metadata before storage so every output does not become data or response.bin.

The MIME type says HTML

A sign-in page or CDN error was downloaded. Stop before the processor; an .jpg filename does not overrule the body.

One item contains many files

Split attachments into one item per file and carry the parent record ID on each item. Retries should target one image, not a mystery array.

Prefer download then multipart

Passing image_url is fine when the source is direct, stable, and server-readable. For signed, session-bound, or connector-owned URLs, download the binary in n8n and send image_file. That keeps URL expiry and authentication inside the workflow that already knows how to fetch the source.

03

Configure the verified BackgroundErase node

Open the Nodes panel, search for BackgroundErase, and add the verified node maintained by BackgroundErase. Start with Remove Background From File when the previous node produced binary data. Choose the input binary property (usually data), select PNG with an RGBA channel, and write the result to a new binary property such as cleaned. If the source is already a public or signed URL, use Remove Background From Image URL instead. The published integration page lists both operations and the available output options.

Native node settings

Node: BackgroundErase
    Operation: Remove Background From File
    Input binary property: data
    Output format: PNG
    Channels: RGBA
    Size: Full
    Output binary property: cleaned

Naming the response property cleaned makes the next nodes easier to read: the original remains under data, and the processed PNG lives under cleaned. If you do not need the original after a durable source copy exists, remove it before a long series of nodes to reduce execution data. Do not remove it before the workflow has a recovery path.

The native node handles the authenticated BackgroundErase request and returns the processed image as binary. Keep the HTTP Request node as a fallback only when you need an endpoint or parameter that the verified integration does not expose yet.

Queue mode does not change plan access

This workflow needs Business or Enterprise API access; Starter is the manual Studio plan. Running n8n in queue mode changes execution and recovery, not how API images are metered. Use the workflow’s measured volume and the current pricing page for the estimate.

04

Prove the response is an image before storing it

A green HTTP node means the request met the node’s success rules. It does not prove the next storage node received a usable transparent PNG. Keep response status and headers when possible, require an image/* content type, and check that the binary property has a nonzero size. For a stricter workflow, inspect the PNG signature in a Code node.

PNG signature check in a Code node

const buffer = await this.helpers.getBinaryDataBuffer(0, "cleaned");
    const png = Buffer.from([0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a]);

    if (buffer.length < 8 || !buffer.subarray(0, 8).equals(png)) {
      throw new Error("BackgroundErase response was not a PNG");
    }

    return items;

Then upload cleaned to the destination: S3, Google Drive, a DAM, or a temporary object used by another API. Use a deterministic key such as products/sku-1842/catalog-v3/master.png. Save the destination’s object ID or key back onto the item before updating the control record. A URL alone may expire; the durable identifier is what lets a later node resume.

Successful output means

  • BackgroundErase returned a successful status and image content type.
  • The expected binary property exists and contains bytes.
  • The destination accepted the upload and returned a stable object or file ID.
  • The job record now points to that durable output.
  • Any downstream catalog update is tracked separately from image processing.

05

Limit batches and make duplicate work cheap

A trigger can hand n8n one item or ten thousand. Do not let the workflow create ten thousand simultaneous image requests just because the canvas permits a wide fan-out. Use Loop Over Items, a sub-workflow, queue-mode concurrency, or another bounded pattern. Start conservatively and increase only after you can see processing time, rate-limit responses, and memory behavior.

Read ready jobs Take small batch Process each item Commit status Continue

Before the API node, look up jobId in a durable data store. If that key is already complete for the same source version and recipe, attach the existing output to the item and skip processing. If another execution has a live processing lease, stop or defer this copy. Workflow execution IDs are useful diagnostics, but they are not business-level idempotency keys.

Idempotency key expression

{{$json.sourceId}}:{{$json.sourceVersion}}:{{$json.recipeVersion}}

    Example:
    drive:1AbCDef:2026-07-11T15:04:20.000Z:catalog-v3

Static workflow data is not a universal lock

For a personal low-volume flow, a lightweight n8n data store may be enough. For concurrent workers or expensive batches, use a database or queue that can enforce uniqueness and leases. Two executions reading “not processed” at the same moment can both be technically correct and financially annoying.

06

Branch on recoverability, not on vibes

Use explicit branches for input failure, retryable service failure, review, and success. A Switch or If node after normalized error data is easier to operate than sprinkling “Continue On Fail” across every node and hoping the final node notices something went wrong.

n8n branch policy
ConditionBranchAction
Missing, corrupt, or unsupported sourcePermanent failureWrite readable error; send to Needs review
429 responseRetryHonor Retry-After; reduce pressure
Timeout or transient 5xxRetryBack off with a maximum attempt count
Valid PNG but risky categoryReviewStore output; wait for human approval
Destination permission errorConfiguration failureKeep master; alert owner; do not reprocess
Existing completed idempotency keyDuplicateReturn stored output and finish

The review branch should carry both binary references and business context: source thumbnail URL, stored master key, SKU, recipe, and reason. Keep the durable file in object storage and send a reference through Slack, Airtable, email, or a review table. Holding a large binary file inside a multi-day Wait node is rarely the most peaceful option.

07

Give failed executions somewhere useful to go

Create a separate n8n error workflow beginning with Error Trigger and assign it in the main workflow’s settings. n8n’s error-handling documentation shows how failed execution details, workflow identity, and the last executed node arrive there. Use that information to update the job and alert an owner.

Include in the alert

  • Workflow and execution link, when execution data is retained.
  • Job ID, source ID, product or SKU, and attempt number.
  • Last node, HTTP status, concise error body, and whether the failure is retryable.
  • Stored source and output identifiers, if either step completed.
  • A link to the record where an operator can retry or move the item to review.

Use Stop And Error when your own validation detects an impossible state, such as a “successful” processor response with no image binary. That turns a quiet bad output into a visible failed execution. Error handling is much easier when the workflow is willing to admit it has failed.

08

Plan binary storage before the images get large

On self-hosted n8n, binary storage configuration matters. n8n documents that binary data is kept in memory by default, which can cause crashes with large files. Filesystem mode writes it to disk; queue mode uses database mode rather than filesystem mode. Check the current guidance in n8n’s scaling binary data guide before increasing batch size.

Small managed workflow

Keep batches modest, prune execution data, and avoid carrying both original and output through unnecessary nodes.

Self-hosted single instance

Configure binary persistence deliberately, monitor disk and memory, and confirm cleanup or pruning behavior.

Queue-mode workers

Use the supported shared binary mode, keep durable job state outside one execution, and apply global concurrency controls.

Very large backfills

Put sources and outputs in object storage and pass references through n8n, or move the hot loop to dedicated workers.

n8n can remain the orchestrator even after the heavy image loop moves elsewhere. It can accept the trigger, create the job, notify reviewers, and publish completed assets while a queue-backed worker handles byte transfer and API pacing. The useful boundary is wherever the workflow becomes easier to observe, not wherever “no-code” remains technically pure.

A workflow you can replay

Keep the picture binary and the state explicit.

One item, one source identity, one bounded processing attempt, and one durable output ID is the shape to protect. With that contract in place, n8n becomes a clear operations surface instead of a place where files vanish between cheerful green nodes.

Open the API docs
Maxwell Meyer

Written by

Maxwell Meyer

Cofounder at BackgroundErase

Maxwell is a cofounder of BackgroundErase, where he works on image-processing research and developer infrastructure.