# n8n Printing: Send PDFs to Local Printers Automatically

> Set up n8n printing to send PDFs to local printers with an HTTP Request node. Follow the workflow, protect API keys, and handle retries without duplicates.

Published 2026-11-18 · https://printscaler.com/blog/n8n-printing-local-printers

![Automated cloud workflow sending a packing slip to a warehouse printer beside a shipping parcel](https://printscaler.com/blog/images/n8n-printing-local-printers-24.jpg)

You can print from n8n by sending a PDF or printer-ready document to a cloud printing API through an HTTP Request node. With PrintScaler, the workflow sends one HTTPS request, and an agent delivers the job to a physical printer connected to a Windows, macOS, Linux, or Raspberry Pi computer. This works with hosted or self-hosted n8n without opening inbound ports on the printer’s network.

This guide builds an n8n printing workflow for PDF packing slips, then explains how to handle printer selection, document access, retries, and offline computers.

## How n8n printing reaches a local printer

An automation running in the cloud cannot normally access a USB printer in your warehouse. Even a network printer usually sits behind a router on a private network that your hosted n8n instance cannot reach.

A printing service bridges that gap:

1. Your business application sends an event to n8n.
2. n8n validates the event and selects a printer.
3. An HTTP Request node submits the document to PrintScaler.
4. The PrintScaler agent receives the job and sends it to the connected printer.

The agent makes an outbound WebSocket connection, so this setup does not require printer port forwarding or inbound firewall rules.

For a self-hosted n8n installation, local printing through operating-system tools is another possibility, but it requires maintaining printer access and drivers where that execution happens. An API-based approach separates workflow hosting from the computer that actually reaches the printer.

## What you need before building the workflow

Prepare these items:

- An n8n instance with permission to create workflows and credentials.
- A PrintScaler account and API key.
- A printer connected to a supported computer.
- A PDF packing slip, available through a downloadable HTTPS URL.
- A stable event identifier from the system requesting the print.

For this example, the source system sends a payload like this:

```json
{
  "eventId": "fulfillment-48271-packing-slip-v1",
  "documentUrl": "https://files.example.com/slips/48271.pdf",
  "locationCode": "warehouse-east"
}
```

The URL is illustrative: replace it with a real PDF location. The event identifier should represent one intended print action, not a new random value generated on every retry.

Keep the initial workflow narrow. Use one document type, one trusted source, and one printer before adding warehouse routing or multiple output formats.

## Step 1: Connect and test your printer

[Download the PrintScaler agent](https://printscaler.com/download) and install it on the computer connected to your printer. Enter the dashboard pairing code to link that computer to your account.

Then:

1. Confirm the printer works through the computer’s operating system.
2. Check that the computer and printer appear in the PrintScaler dashboard.
3. Use the dashboard’s test-page button.
4. Record the printer ID you will use in n8n.

The examples below use printer ID `123`; replace it with your actual ID.

The agent starts automatically after reboots and updates itself. Nevertheless, the computer must be powered on and able to reach the internet for immediate printing. If warehouse staff routinely shut it down, plan for delayed jobs rather than assuming a cloud workflow can wake it.

For the first test, use an ordinary PDF and the printer’s default paper settings. That separates connectivity problems from document-layout problems.

## Step 2: Receive the print event in n8n

Create a workflow with a **Webhook** trigger using the `POST` method. Give it a descriptive path, such as `print-packing-slip`.

Configure authentication for the webhook rather than leaving a production print endpoint publicly callable. For example, use header authentication and configure the sending application with the matching secret. This inbound credential is separate from your PrintScaler API key.

Send a test event while the Webhook node is listening. An example request to your own n8n endpoint would look like this:

```bash
curl --request POST \
  'https://automation.example.com/webhook/print-packing-slip' \
  --header 'Content-Type: application/json' \
  --header 'X-Workflow-Secret: REPLACE_WITH_YOUR_SECRET' \
  --data '{
    "eventId": "fulfillment-48271-packing-slip-v1",
    "documentUrl": "https://files.example.com/slips/48271.pdf",
    "locationCode": "warehouse-east"
  }'
```

Use the actual test or production URL displayed by n8n. Configure the webhook authentication header name to match the request.

Inspect the received execution data. A Webhook node normally exposes the submitted JSON under `body`, so the event ID in this example is accessed as `$json.body.eventId`.

## Step 3: Validate and normalize the input

Add validation before the printing request. At minimum, reject events when:

- `eventId` is missing or empty.
- `documentUrl` is not an HTTPS URL.
- The URL host is not one of your approved document hosts.
- The location is unknown or unauthorized for the sender.

Use an IF node to route valid events forward and invalid events to a controlled rejection or alert path. A file extension alone does not establish that a URL serves a valid PDF.

Next, add an **Edit Fields** node, also called Set in some n8n versions. Create these fields:

| Field | Type | Value |
|---|---|---|
| `eventId` | String | `{{ $json.body.eventId }}` |
| `documentUrl` | String | `{{ $json.body.documentUrl }}` |
| `printerId` | Number | `123` |
| `title` | String | `{{ 'Packing slip ' + $json.body.eventId }}` |

Enter the expressions using n8n’s expression mode. Make `printerId` a number, not a string.

For this first workflow, the printer ID is deliberately fixed in your configuration. Do not let an untrusted webhook caller choose any printer in your account.

## Step 4: Store the PrintScaler API key securely

Create a **Header Auth** credential in n8n with:

- **Name:** `Authorization`
- **Value:** `Bearer YOUR_PRINTSCALER_API_KEY`

Use your actual key, including its `psk_` prefix where applicable. Select this credential in the HTTP Request node through the generic credential authentication option.

Do not put the API key in the incoming webhook payload, a document URL, or a visible Edit Fields value. A credential keeps authentication separate from the business data moving through the workflow.

Also review who can edit workflows and inspect execution data. Packing slips can contain customer names and addresses, while signed document URLs can temporarily grant access to those documents. Set your execution retention and operational access policies accordingly.

## Step 5: Configure the HTTP Request node

Add an **HTTP Request** node after Edit Fields.

Set the request configuration to:

| Setting | Value |
|---|---|
| Method | `POST` |
| URL | `https://api.printscaler.com/v1/printjobs` |
| Authentication | Your Header Auth credential |
| Send body | Enabled |
| Body content type | JSON |

Add these body fields using the node’s individual-field editor:

| Body field | Value |
|---|---|
| `printerId` | `{{ $json.printerId }}` |
| `contentType` | `pdf_uri` |
| `content` | `{{ $json.documentUrl }}` |
| `title` | `{{ $json.title }}` |

Ensure the evaluated `printerId` remains numeric. The resulting JSON should look like this:

```json
{
  "printerId": 123,
  "contentType": "pdf_uri",
  "content": "https://files.example.com/slips/48271.pdf",
  "title": "Packing slip fulfillment-48271-packing-slip-v1"
}
```

Add this request header as well:

| Header | Expression |
|---|---|
| `X-Idempotency-Key` | `{{ 'packing-slip:' + $json.eventId }}` |

This is the central API call. The [print job API reference](https://printscaler.com/docs#printjobs) documents the endpoint and supported content types.

Run the workflow manually with one test event. Inspect the HTTP response, then check the corresponding job in the PrintScaler dashboard and verify the physical output.

## Step 6: Make sure the PDF can actually be downloaded

A PDF URL that opens in your browser may still fail in an automated workflow. Your browser might have a login cookie that the document fetch does not have.

For `pdf_uri`, provide a URL that can be fetched without relying on your browser session. Common choices are a public document URL or a signed URL generated by your storage system.

Check the following:

- The URL returns the PDF itself, not a login page or preview screen.
- The document is available before the print request is submitted.
- Any signed URL has enough validity for the expected processing window.
- Access controls do not require a private network connection unavailable to the fetching service.

If the PDF must first be downloaded using credentials held by n8n, another option is to retrieve it inside the workflow and submit its Base64-encoded file bytes using `pdf_base64`. Take care to encode the actual PDF bytes, not the URL or a JSON wrapper.

Base64 also makes the request larger, so URL-based submission is generally simpler when secure downloadable URLs are available. Test delayed and offline cases with your chosen document-access method rather than assuming a short-lived URL will always remain usable.

## Make n8n printing safe to retry

A timeout does not prove that a print request failed. PrintScaler might have accepted the job before n8n stopped waiting for the response.

That is why the workflow adds an idempotency key before enabling automatic retries. A retried submission must reuse the same key for the same intended print action.

Use these rules:

- Keep the event ID stable when the source system retries delivery.
- Keep the idempotency key stable when n8n retries the HTTP request.
- Use a new print-action identifier for an intentional reprint.
- Do not reuse one key for unrelated documents or different destinations.

For example, a packing slip and a shipping label for the same order are separate print actions. Their keys should identify those actions separately.

Retry temporary connection failures and transient service errors with a delay. Investigate invalid payloads and authentication failures instead of repeatedly resubmitting them. Keep traffic within PrintScaler’s limit of 10 requests per second, with a burst of 30; high-volume workflows need pacing across concurrent executions, not just within one execution.

For a deeper treatment of retry behavior, see the guide to [preventing duplicate print jobs](https://printscaler.com/blog/prevent-duplicate-print-jobs).

## Track printing separately from workflow completion

A successful HTTP request means your workflow submitted a job successfully. It does not, by itself, mean someone is holding a finished packing slip.

PrintScaler exposes these job states:

`new`, `sent_to_client`, `queued`, `in_progress`, `done`, `error`, `cancelled`, and `expired`.

Maintain separate business statuses for “print requested” and later reported printing outcomes. Even a reported completion should not be treated as proof that an employee collected or checked the document.

For ongoing tracking, build a second n8n workflow that receives PrintScaler’s `printjob.state` webhooks. Verify the HMAC-SHA256 signature according to the [webhook documentation](https://printscaler.com/docs#webhooks), preserving the request representation required for verification. Make downstream updates safe to repeat because webhook delivery is retried.

When a computer is offline, jobs queue and print when it comes back, unless they expire first. Choose an expiration policy appropriate to the document: an old packing slip might still be useful, while a time-sensitive ticket may no longer be actionable.

## Route documents without trusting arbitrary printer IDs

After the single-printer workflow works, add a Switch node or a trusted configuration lookup for location-based routing.

For example:

| Approved location | Configured destination |
|---|---|
| `warehouse-east` | East packing-station printer ID |
| `warehouse-west` | West packing-station printer ID |
| Unknown location | Reject and notify an operator |

Authenticate the source and check its permitted locations before applying the mapping. A recognized location code alone is not authorization.

Keep routing configuration outside document content. If a warehouse replaces a printer, you should update one trusted mapping rather than changing every upstream automation.

You can also separate workflows by output format. PDFs are appropriate for packing slips and invoices. Printer-ready ZPL can be submitted using a RAW content type for compatible label printers, and ESC/POS can be used for compatible receipt printers. Do not send those commands through the PDF path.

For PDF shipping-label layout issues, the guide to [printing 4×6 PDF labels without scaling problems](https://printscaler.com/blog/print-4x6-pdf-shipping-labels) covers the document and paper-size checks.

## Test failure cases before switching on automation

A useful acceptance test includes more than one successful print:

| Test | What to verify |
|---|---|
| Deliver the same event twice | The same intended action does not produce duplicate jobs |
| Disconnect the agent computer | The job queues, then resumes or expires as intended |
| Submit an inaccessible PDF URL | The failure is visible and reaches your exception process |
| Send an unknown location | The workflow rejects it rather than choosing a default printer |
| Submit an intentional reprint | A new action identifier allows the new print request |
| Send a burst of events | Workflow pacing respects the API rate limit |

Keep the source event ID, destination printer ID, and returned job information available for troubleshooting. Avoid logging document contents or credentials unnecessarily.

Also test with the actual paper, tray, and printer used in production. A successful office-printer test does not validate a warehouse label layout.

## Start with one reliable printing workflow

The essential n8n printing workflow is small: receive an event, validate it, choose a trusted printer, and submit a PDF through an authenticated HTTP Request node. Stable idempotency keys and separate job-status tracking make that workflow much safer to operate.

PrintScaler charges per print request, not per page. The Free plan includes 100 prints per month and one connected computer; review the [current plans](https://printscaler.com/pricing) when estimating production volume.

[Create a free PrintScaler account](https://printscaler.com/signup), connect one printer, and test a single packing slip before expanding the workflow to your full fulfillment process.

## Frequently asked questions

### Can n8n Cloud print to a local USB printer?

Yes, through a service that bridges the cloud workflow to the printer’s local computer. With PrintScaler, n8n submits an HTTPS request and the PrintScaler agent delivers the job to the connected printer.

### Does PrintScaler require a dedicated n8n community node?

No. You can submit print jobs using n8n’s standard HTTP Request node with Bearer authentication and a JSON body.

### How do I print a PDF that requires authentication?

Provide a securely downloadable URL, such as an appropriately scoped signed URL, or retrieve the PDF within n8n and submit its Base64-encoded bytes using pdf_base64. A URL that only works with your browser’s login session is not sufficient.

### How do I stop n8n retries from printing duplicate documents?

Send an X-Idempotency-Key header that remains the same for every retry of one intended print action. Use a new action identifier for an intentional reprint or a different document.

### What happens if the printer’s computer is offline?

PrintScaler queues jobs while the computer is offline and sends them when it reconnects, unless their configured expiration time has passed. Your workflow should track job states separately from the initial API submission.

### Can n8n send ZPL labels or ESC/POS receipts through PrintScaler?

Yes. Use raw_uri or raw_base64 for printer-ready commands and send them to a compatible printer. Use pdf_uri or pdf_base64 for PDF documents instead.
