Generate Barcode Label PDFs in n8n

Import a workflow that submits one label batch, checks its job, waits between polls, and downloads a PDF as binary data.

G Gookit Team
· · 5 min read

Use n8n to turn product records into a barcode-label PDF. The workflow below sends one batch to Gookit Label API, checks the returned job ID, and downloads the completed file into n8n’s binary output.

It uses standard HTTP Request nodes. You do not need a Gookit-specific node, and importing the file does not activate a scheduled automation.

This workflow was executed with n8n 2.39.8 against the live API. Its wait branch was also exercised with simulated rate-limited and pending responses. That test does not configure your own n8n credentials or upstream trigger.

Prepare a key and template

Create an independent developer key and the 50 × 30 mm name/SKU template from the batch tutorial. Check that your account has output allowance. This workflow requests three labels: two Trail Bottle copies and one Desk Tray copy.

Import the JSON into an inactive n8n workflow. Open Input and replace REPLACE_WITH_YOUR_TEMPLATE_ID with the saved template ID. Keep the two sample records for the first run.

In n8n, create a Header Auth credential with header name Authorization and value Bearer YOUR_DEVELOPER_API_KEY. Select it in Submit and Status. Leave Download without authentication: that request goes to the returned storage URL. n8n documents generic authentication and file responses in its HTTP Request node.

Follow the branches

Start → Input → Submit → Status → Decide → Completed?
↑ ├─ yes → Download
└──── Wait ←──────┘ no
NodeWhat it does
InputSets the template, records and polling start time
SubmitSends one POST /print
StatusChecks the job ID returned by Submit
DecideRejects errors, observes Retry-After and bounds the wait
CompletedSelects download or another status check
WaitPauses before checking the same job
DownloadSaves the response as binary field data

The branch returns to Status, never Submit. Keep Retry On Fail disabled on Submit: an interrupted POST may already have created a job.

Run and inspect the first result

Execute the workflow manually. Inspect Submit’s output and retain its jobId. When Download succeeds, open the binary data output and save the PDF.

Expect three pages with this ROLL template. Confirm Trail Bottle appears twice, Desk Tray once, and both SKUs match the barcodes. A sheet template may put the same three labels on one page, so PDF page count is not a universal label count.

The workflow stops after its local waiting deadline or a failed/unknown status. Its two-minute window is an example policy, not a completion-time promise. HTTP requests have separate timeouts.

Recover without creating another batch

If Status or Download fails after Submit succeeded, copy the saved job ID and check that job using the API reference or the resume command in our client examples. Re-running the whole workflow starts at Submit and can consume allowance again.

On 429, the workflow reads Retry-After and only waits if it fits the remaining window. Other non-success status responses stop the run. A failed job also stops; inspect the error before deciding on a new request.

Replace the sample with your upstream data

Feed the workflow one JSON item containing templateId and an items array. Aggregate selected source records before Submit if you want one combined PDF; sending one n8n item per product through an HTTP node can create separate API requests.

Keep name and SKU as strings and quantity as a positive integer. Check the total against the API limits before enabling a trigger. Add a file destination only after you decide who should be able to access the resulting PDF; the download URL is temporary and should not be treated as permanent storage.