extract-archive

n8n node to extract ZIP and RAR archive files. Supports binary data or file path input.

Package Information

Released: 6 mo ago
Downloads: 114 weekly / 312 monthly
Latest Version: 1.3.0
Author: Beltar

Documentation

n8n-nodes-extract-archive

Extract ZIP and RAR archive files in n8n.

Features

  • ZIP and RAR support with auto-detection
  • Binary data or file path input - use files from previous nodes or server paths
  • Password-protected archives support
  • File filtering - extract only specific file types
  • Subdirectory handling - include or exclude nested folders
  • Flexible output - single item with all files or one item per file

Requirements

This node requires extraction tools to be installed on your system.

Docker (n8n image)

The official n8n Docker image doesn't include a package manager, so we use a multi-stage build to copy the required binaries:

FROM alpine:latest AS builder

RUN apk add --no-cache \
    poppler-utils \
    unzip \
    7zip

FROM n8nio/n8n:latest

USER root

# Copy binaries from builder
COPY --from=builder /usr/bin/pdftoppm /usr/bin/
COPY --from=builder /usr/bin/pdfinfo /usr/bin/
COPY --from=builder /usr/bin/unzip /usr/bin/
COPY --from=builder /usr/bin/7z /usr/bin/
COPY --from=builder /usr/bin/7zz /usr/bin/

# Copy required libraries for poppler
COPY --from=builder /usr/lib/libpoppler* /usr/lib/
COPY --from=builder /usr/lib/libfreetype* /usr/lib/
COPY --from=builder /usr/lib/libfontconfig* /usr/lib/
COPY --from=builder /usr/lib/libjpeg* /usr/lib/
COPY --from=builder /usr/lib/libpng16* /usr/lib/
COPY --from=builder /usr/lib/libtiff* /usr/lib/
COPY --from=builder /usr/lib/liblcms2* /usr/lib/
COPY --from=builder /usr/lib/libopenjp2* /usr/lib/
COPY --from=builder /usr/lib/libexpat* /usr/lib/
COPY --from=builder /usr/lib/libbz2* /usr/lib/
COPY --from=builder /usr/lib/libbrotli* /usr/lib/
COPY --from=builder /usr/lib/libwebp* /usr/lib/
COPY --from=builder /usr/lib/libzstd* /usr/lib/
COPY --from=builder /usr/lib/liblzma* /usr/lib/
COPY --from=builder /usr/lib/libstdc++* /usr/lib/
COPY --from=builder /usr/lib/libgcc_s* /usr/lib/

RUN mkdir -p /opt/n8n-nodes && chown node:node /opt/n8n-nodes

USER node

RUN cd /opt/n8n-nodes && \
    npm init -y && \
    npm install @beltar/n8n-nodes-pdf-to-image @beltar/n8n-nodes-extract-archive

ENV N8N_CUSTOM_EXTENSIONS=/opt/n8n-nodes/node_modules

Debian/Ubuntu

sudo apt-get install unzip unrar

Alpine Linux

apk add unzip p7zip

macOS

brew install unzip unrar

Installation

In n8n

  1. Go to Settings → Community Nodes
  2. Enter @beltar/n8n-nodes-extract-archive
  3. Click Install
  4. Restart n8n

Manual installation

cd ~/.n8n
npm install @beltar/n8n-nodes-extract-archive

Usage

  1. Add the Extract Archive node to your workflow
  2. Connect a node that provides an archive file (binary data or file path)
  3. Configure the options:
    • Input Mode: Binary Data or File Path
    • Input Binary Field: Name of the binary property (for binary mode)
    • File Path: Path to archive on server (for file path mode)
    • Archive Type: Auto-detect, ZIP, or RAR
    • Password: For encrypted archives (optional)
    • Output Mode: Single item with all files, or one item per file
    • Output Binary Field: Name for the output binary property
    • Include Subdirectories: Whether to include nested files
    • File Filter: Comma-separated patterns (e.g., *.txt, *.pdf)

Output

Single Item Mode

Returns one item with:

  • json.totalFiles: Number of files extracted
  • json.archiveType: Type of archive (zip/rar)
  • json.files: Array of file info objects
  • json.binaryProperties: Array of binary property names
  • binary.file_1, binary.file_2, etc.: The extracted files

Multiple Items Mode

Returns one item per file with:

  • json.index: File index
  • json.totalFiles: Total number of files
  • json.fileName: Name of the file
  • json.filePath: Relative path within archive
  • json.fileSize: Size in bytes
  • json.archiveType: Type of archive
  • binary.file: The extracted file

Example Workflows

Extract and process each file

[HTTP Request: Download ZIP] → [Extract Archive] → [For Each File: Process]

Extract specific file types

[Read Binary File] → [Extract Archive (filter: *.pdf)] → [PDF to Image]

Extract from server path

[Set file path] → [Extract Archive (file path mode)] → [Upload to S3]

License

MIT

Author

Beltar

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

Discussion