Skip to content

Binary Data Benchmark Workflow

This workflow provides a performance testing endpoint for binary file operations in n8n. It accepts file uploads via webhook, writes them to disk, reads them back, and returns the file data to measure the complete round-trip performance of binary data handling.

Purpose

No business context provided yet — add a context.md to enrich this documentation.

This workflow appears to be designed for benchmarking and testing binary file operations within n8n. It creates a complete cycle of file handling operations to measure performance characteristics of binary data processing.

How It Works

  1. Receive File Upload: A webhook endpoint accepts POST requests with binary file data
  2. Write to Disk: The uploaded file is saved to the local filesystem with a unique timestamp-based filename
  3. Read from Disk: The same file is immediately read back from the filesystem
  4. Return File: The file data is sent back to the client as a binary response

This creates a complete round-trip test of n8n's binary data handling capabilities, from HTTP input through filesystem operations and back to HTTP output.

Workflow Diagram

graph TD
    A[Webhook<br/>POST /binary-files-benchmark] --> B[Write File to Disk<br/>Save with unique filename]
    B --> C[Read File from Disk<br/>Load saved file]
    C --> D[Respond to Webhook<br/>Return binary data]

Trigger

Webhook Trigger - Method: POST - Path: /binary-files-benchmark - Response Mode: Response Node (synchronous) - Expected Input: Binary file data in the request body

Nodes Used

Node Type Node Name Purpose
Webhook Webhook Receives POST requests with binary file data
Read/Write File Write File to Disk Saves uploaded file to filesystem with unique name
Read/Write File Read File from Disk Reads the saved file back from filesystem
Respond to Webhook Respond to Webhook Returns the file data as binary response

External Services & Credentials Required

None - This workflow operates entirely within the n8n instance using built-in nodes and local filesystem operations.

Environment Variables

No environment variables are required for this workflow.

Data Flow

Input: - Binary file data via POST request to the webhook endpoint - File data is expected in the request body

Processing: - File is written to disk with filename pattern: file-{timestamp}-{random}.js - File is immediately read back from the same location - Original binary data is preserved throughout the process

Output: - Binary file data returned as HTTP response - Same content as originally uploaded (round-trip verification)

Error Handling

This workflow does not implement explicit error handling. Potential failure points include:

  • File Write Errors: Disk space, permissions, or filesystem issues
  • File Read Errors: File not found or read permission issues
  • Webhook Errors: Invalid request format or oversized files

Errors will result in workflow execution failure with n8n's default error responses.

Known Limitations

  • Files are written to the n8n instance's local filesystem, requiring adequate disk space
  • No cleanup mechanism for generated test files
  • File size limited by n8n's binary data handling capabilities
  • No validation of input file types or sizes
  • Hardcoded .js file extension regardless of actual file type

No related workflows identified from the provided context.

Setup Instructions

  1. Import Workflow

    • Copy the workflow JSON
    • Import into your n8n instance via the workflow import function
  2. Activate Workflow

    • Ensure the workflow is set to "Active" status
    • The webhook will be immediately available at the configured path
  3. Test the Endpoint

    1
    2
    3
    4
    curl -X POST \
      http://your-n8n-instance/webhook/binary-files-benchmark \
      -H "Content-Type: application/octet-stream" \
      --data-binary @your-test-file.txt
    

  4. Monitor Performance

    • Use the execution logs to measure processing times
    • Monitor filesystem usage if running extended benchmarks
    • Consider implementing file cleanup for long-running tests

Note: Ensure your n8n instance has sufficient disk space and appropriate file system permissions for the write operations.