| name | codemation-document-scanner |
| description | CodemationDocumentScanner node — managed document/invoice/image extraction via the Codemation doc-scanner service. No Azure credentials required. Read before writing any workflow that scans documents, invoices, or images. |
| compatibility | Codemation core-nodes. Requires @codemation/core-nodes import. |
| tags | ocr, document, invoice, image, scan, extract, managed, confidence |
| uses | @codemation/core-nodes |
Codemation Document Scanner Node
Start here: call find_examples before reading further.
find_examples({ query: "CodemationDocumentScanner" }) — node-level usage and all analyzerType variants
find_examples({ query: "invoice scan post accounting" }) — end-to-end invoice extraction scenario
find_examples({ query: "document scanner confidence fields" }) — how to enable per-field confidence scores
Use this skill when
Writing a workflow that extracts text and/or structured fields from documents, invoices, or images
using the Codemation managed scanning service. No Azure credentials are required — the service is
pre-wired to the platform.
Use codemation-workflow-dsl for surrounding workflow structure.
Use codemation-ai-agent-node if you need to pass the extracted markdown to an LLM for further processing.
When to use CodemationDocumentScanner vs the standalone OCR nodes
| Situation | Use |
|---|
| Managed platform deployment, no Azure credential | codemationDocumentScannerNode (this skill) |
| Self-hosted / BYOK Azure Content Understanding | analyzeDocumentNode / analyzeInvoiceNode / analyzeImageNode from @codemation/core-nodes-ocr |
codemationDocumentScannerNode calls the internal doc-scanner service via HMAC — the workspace holds
no Azure key. The standalone OCR nodes call Azure directly using a per-workspace credential.
Choosing analyzerType
analyzerType | When to use | Azure analyzer | Field extraction | Confidence opt-in supported |
|---|
"document" | General PDFs, Word docs, HTML, text-heavy files | prebuilt-document | Yes | Yes |
"invoice" | Invoices, receipts — always prebuilt-invoice | prebuilt-invoice | Yes | Yes |
"image" | Photos, screenshots, diagrams | prebuilt-imageAnalyzer | No (markdown only) | No — image carries no extraction charge |
"auto" | Unknown mime type at author time | Routes on Content-Type: image/* → image, everything else → document | Depends on routed type | Depends on routed type |
Default is "auto". Set an explicit type whenever you know the content class — it avoids
unnecessary re-routing and makes the workflow self-documenting.
Output shape
{
markdown: string;
fields: Record<
string,
{
value: unknown;
confidence: number | null;
}
>;
}
item.json.markdown is the Markdown rendering of the document.
item.json.fields is a flat-or-nested map of structured fields found by the analyzer.
For analyzerType: "image", fields is always {}.
Fields may be sparse or absent for generic documents — extraction is best-effort.
WARNING: How to enable per-field confidence scores (LD6)
By default, confidence is null on every field. This keeps token cost low for the majority
of workflows that only need value.
To get a populated confidence (0–1 float) on each field, set includeConfidence: true:
codemationDocumentScannerNode.create(
{
binaryField: "data",
analyzerType: "invoice",
includeConfidence: true,
},
"Scan invoice",
"scan-invoice",
);
Cost implication: enabling confidence routes the request to a confidence-enabled analyzer variant,
which roughly doubles the contextualization token count for document/invoice analyzers.
Only enable it when your downstream logic actually reads field.confidence.
Images (analyzerType: "image") and auto-routed-to-image requests carry no field-extraction charge
regardless of this flag — they silently ignore includeConfidence (confidence stays null, never a 400).
API usage
import { codemationDocumentScannerNode } from "@codemation/core-nodes";
codemationDocumentScannerNode.create(
{
binaryField?: string;
analyzerType?: "document" | "invoice" | "image" | "auto";
contentType?: string;
includeConfidence?: boolean;
maxBytes?: number;
},
label?: string,
nodeId?: string,
)
Set an explicit nodeId whenever downstream nodes reference this node's output by id, or when
the node may be renamed later (avoids credential-binding orphaning).
Consuming fields downstream
import type { DocScannerOutput, DocScannerField } from "@codemation/core-nodes";
new Callback<DocScannerOutput>("Use fields", (items, _ctx) =>
items.map((item) => {
const vendorName = item.json.fields["VendorName"]?.value as string | undefined;
const vendorConf = item.json.fields["VendorName"]?.confidence;
return { ...item, json: { ...item.json, vendorName, vendorConf } };
}),
);
Read next when needed
codemation-workflow-dsl — workflow builder, trigger types, fluent vs low-level API.
codemation-ai-agent-node — pass item.json.markdown to an LLM for summarisation or extraction.