An n8n Document Scanning Workflow That Starts at the Camera
Most n8n recipes about document scanning begin at a point that does not exist in reality: a file that is already somewhere tidy. In practice the document is a photo taken at an angle, on a loading dock, under a desk lamp, in a van with bad signal. The step that decides whether the rest of the workflow works is the one almost nobody writes down: getting that photo into a form the next node can actually read.
This is that step, wired into n8n. Once without code, once with an HTTP Request node.
What the workflow needs before it can talk about OCR
Three stages, and most tutorials only show the last two:
- Capture. A phone camera, a flatbed scanner, or a hosted link your field staff can open and scan from.
- Normalise. Detect the document in the frame, correct the perspective, clean the background. Skip this and every downstream step inherits a skewed, shadowed image: the OCR reads garbage, the classifier guesses, and someone blames the model.
- Hand off. A clean JPEG, or a searchable PDF, delivered where the workflow can pick it up.
n8n is genuinely good at stages 2 and 3. Stage 1 is where workflows stop, because a Webhook node needs something that posts to it, and a phone camera does not do that on its own.
Path A: no code, a hosted scanner that calls your Webhook
This is the path for field staff, drivers, front desks, and anyone who should not be installing anything.
- In the ScanKit dashboard, create an Instant Scanner. It gives you a link and a QR code, and it accepts one configuration: where the finished file should be posted.
- In n8n, add a Webhook node, method
POST, and copy its Production URL. - Paste that URL into the scanner as the delivery target. From then on, every scan posts the finished PDF (plus metadata) to your workflow.
- Model your workflow from the Webhook node onwards: the file arrives as binary on
$binary.data, the metadata as JSON in$json.
The person scanning only needs a browser. No account, no app, no training beyond "open this link, photograph the page". That is the difference between a workflow that gets used and one that gets demonstrated once.
Path B: with code, the HTTP Request node
When the images are already in your workflow (an email attachment, a Drive file, a Telegram photo), you do not need a hosted link: you need one HTTP call that cleans the image.
Set up the node like this:
- Method:
POST - URL:
https://api.scankit.io/scan/crop - Authentication: Header Auth, header name
Authorization, valueBearer YOUR_API_KEY. Store the key as an n8n credential, never as a plain parameter (see the mistakes below). - Send Body: on, Body Content Type:
Form-Data - Body parameters:
fileas type n8n Binary File, input data field namedata(or whatever the previous node called it)output_width=1536(what you want to read or print; 1024 to 2048 is the useful range)filter=whitefor paper,flatif you need the original coloursreturn_pdf=truewhen you want a searchable PDF instead of a JPEGocr_lang=engordeu, only used withreturn_pdf
- Response: set Put Output in Field to
dataso the returned PDF arrives as binary again and the next node can save it.
Multi-page documents in one call
Repeat the file parameter as files for each page, and ask for return_pdf=true. One request, one document, one searchable PDF, instead of a loop with N requests and a merge node afterwards. That is the difference between a 20-page contract taking one call and taking twenty.
What actually comes back
Input is a JPEG or PNG. Output is a JPEG, or with return_pdf a PDF with an OCR text layer. PDF is an output format here, not an input: if your workflow already has a PDF, split it into page images first, then send those.
The image is processed in the EU and not stored. That matters if the documents contain personal data, which is most of them.
Three mistakes that cost an afternoon
The key in the workflow JSON. n8n workflow exports are shared, versioned, pasted into forums. A key inside a node parameter travels with them. Use a credential, always.
A renamed binary property. "Put Output in Field: data" writes to $binary.data; if the next node expects file, it fails with an empty body that looks like an API problem and is not one.
No retry on a mobile connection. A photo upload from a phone on a bad connection fails once and succeeds on the second try. Turn on Retry On Fail with two attempts and a short wait; you will not build a fallback branch for something that heals itself.
What it costs, plainly
50 scans are free on signup, no card. Paid credit packs start at 19 EUR for 1,000 scans, 49 EUR for 3,000, and credits never expire. No subscription, no minimum. At that price the cleaning step is cheaper than the engineer-minutes spent debugging OCR output that was never going to work on a skewed photo.
Where to go next
The API page has a live box where you can drop a document and see the result without a key. The examples show finished n8n workflows for invoices and delivery notes, including the scanner and webhook wiring this article describes. And if you get stuck on a specific node, write to info@scankit.io: a workflow that almost works is exactly the kind of question worth answering.
Ready to get started with ScanKit?
Start building powerful document scanning features into your applications today.