This community node for n8n allows you to print files directly from your workflows via a CUPS (Common UNIX Printing System) server.
This node acts as a client for your CUPS server, which must be online and accessible from your n8n instance. The server itself will manage all your printer drivers and configurations.
- Dynamic File Printing: Instead of a fixed file path, the node accepts binary data. This allows you to print files downloaded from an HTTP request, generated by another node, or read from a disk, all within the same workflow.
- Printer Discovery: Automatically discovers available printers on your CUPS server.
- Basic Print Options: Control the number of copies and specify page ranges.
- Advanced CUPS Options: For power users, a JSON field allows you to pass any additional CUPS-specific options (
-o) for total control over your print jobs (e.g., paper size, quality, orientation, duplex printing).
This node executes the lp command. Therefore, the cups-client package must be installed in the environment where n8n is running.
If you are using Docker for n8n, you need to add the installation of cups-client to your Dockerfile. Here is an example for a Debian/Ubuntu-based image:
# Add this line to your n8n Dockerfile
RUN apt-get update && apt-get install -y cups-client && rm -rf /var/lib/apt/lists/*This common error can occur if your n8n instance cannot resolve the printer's network name, especially if it's not on the same local network. To fix this, you must explicitly tell the CUPS client where the server is.
You can add this to your Dockerfile:
# Replace 192.168.1.100 with the actual IP address of your CUPS server
RUN echo "ServerName 192.168.1.100" >> /etc/cups/client.conf- CUPS Server IP: Enter the IP address of your CUPS server. This is required for the node to discover printers.
- Select Printer: Choose a printer from the auto-discovered list or manually enter the printer queue name.
- Binary Property: Specify the name of the binary property from the input item that contains the file you want to print (e.g.,
data). - Options (Optional):
- Quantity: Set the number of copies.
- Page Range: Define a specific page range (e.g.,
1-5, 8). - Advanced CUPS Options: For full control, provide a JSON object with any other options supported by your printer. These will be passed directly to the
lpcommand.
To print a document in A4 landscape format, on both sides of the paper, you could use the following JSON in the "Advanced CUPS Options" field:
{
"media": "A4",
"orientation-requested": "4",
"sides": "two-sided-long-edge"
}