Extract Archive

Extracts files from archive formats (ZIP, TAR, etc.) to make contents available for processing in your flow.

Quick Start

To get started:

  • Add the Extract Archive block to your flow
  • Provide the archive folder name via configuration
  • Optionally include filenames in the output
  • Receive extracted file paths in msg.payload

Configuration

Archive Name (required)

The name or path of the archive file to extract.

Include Filenames (optional)

When enabled, includes the original filenames in the output.

Common Input Format

msg.payload (string or object)

The path to the archive file or an object containing the archive path.

Example: "uploads/documents.zip"

Common Output Format

msg.payload (object)

msg.payload contains the extracted file paths and metadata.

Example:

{
  "extracted_files": [
    "documents/file1.pdf",
    "documents/file2.pdf"
  ],
  "extraction_path": "extracted/documents/"
}

Example

Input (msg.payload)

{
  "archive_path": "uploads/documents.zip"
}

Output (msg.payload)

{
  "extracted_files": [
    "documents/invoice.pdf",
    "documents/receipt.pdf"
  ],
  "extraction_path": "extracted/documents/"
}

Errors

When the block fails, it raises an error. Use a Catch block in your flow to handle failures and inspect the error payload.

Common mistakes

  • Invalid archive path: Ensure the archive file exists at the specified path.
  • Unsupported format: Check that the archive format is supported.
  • Permission issues: Ensure the extraction directory is writable.

Best Practices

  • Validate archive integrity before extraction
  • Clean up extracted files after processing
  • Use appropriate archive formats for your use case