Skip to content

PDF Analysis → Delivery Note

The service task "PDF Analysis → Delivery Note" turns the raw output of the service task Analyze PDF (Textract blocks) into a delivery note object: delivery note number, delivery date, sender, all recognized key-value pairs and the items from the best matching table. The service only converts; the actual analysis of the PDF happens in the step before.

Technical name prio_mapTextractToDeliveryNote · Category in the "Select service task" dialog: Documents & PDF


When is this service used?

  • Hardware goods receipt: Musterfirma GmbH receives delivery notes from its distributors as PDF and takes number, date and items into the goods receipt.
  • Comparison with the order: The items (quantity, text) are checked against the order items before the delivery is confirmed.
  • Filing with search fields: The key-value pairs (e.g. "Your order") are stored as search fields on the document.

Prerequisites

The step before has to be Analyze PDF, with table and form recognition and three queries with the aliases delivery_note_number, delivery_date and sender. Without these queries the service falls back to pattern recognition (see Output). This service itself incurs no costs; the analysis costs arise in the step before.


Input

Field Type Required Meaning
Blocks array yes The Textract blocks from the PDF analysis. If the array is missing, the step aborts
DocumentMetadata object no Passed along but not evaluated

Since the PDF analysis returns exactly { DocumentMetadata, Blocks }, the input expression is usually the result of the previous step:

analysis

Step 1, Analyze PDF, with result path analysis:

{
  "pdf": deliveryNote,
  "options": { "tables": true, "forms": true },
  "queries": [
    { "Text": "What is the delivery note number?", "Alias": "delivery_note_number" },
    { "Text": "What is the delivery date?", "Alias": "delivery_date" },
    { "Text": "Who is the sender?", "Alias": "sender" }
  ]
}

Output

{
  "delivery_note_number": "LS-2026-04471",
  "delivery_date": "2026-11-05",
  "sender": "TechDistribution GmbH",
  "search_fields": [
    { "key": "Lieferschein-Nr.", "value": "LS-2026-04471" },
    { "key": "Ihre Bestellung", "value": "B-7781" }
  ],
  "positions": [
    { "position": 1, "quantity": "10", "text": "Notebook 14\" i7 32 GB" },
    { "position": 2, "quantity": "10", "text": "Dockingstation USB-C" }
  ]
}
Field Origin
delivery_note_number answer to the query delivery_note_number; otherwise a key-value pair with a key such as "Lieferschein-Nr.", "LS-Nr.", "Beleg-Nr.", "Delivery Note No."; otherwise N/A
delivery_date answer to the query delivery_date, converted to YYYY-MM-DD from DD.MM.YYYY, DD/MM/YYYY or DD-MM-YYYY. Unknown formats stay unchanged. Without a date the field is omitted
sender answer to the query sender; otherwise the first line with a legal form (GmbH, AG, KG, e.V., UG …) in the bottom fifth of the first page; otherwise N/A
search_fields all recognized key-value pairs, colon removed from the key
positions rows of the table whose header best matches quantity/pcs, pos./no. and description/article. Empty rows are dropped; without a text column the remaining cells are concatenated into text

Field names are in snake_case (delivery_note_number, search_fields), quantity is a text ("10"), not a number. The result is stored under the result path.


Errors and behavior

  • Only the input check throws: Blocks array is required. Expected Textract AnalyzeDocument output. With an error boundary event the process continues there; without one the instance ends in error with a resume point and an error email to the process owner.
  • Nothing recognized is not an error: Fields fall back to N/A or empty arrays, the process continues. Whether the result is usable is best checked by a gateway (delivery_note_number != "N/A" and $count(positions) > 0).
  • The service never returns {status, message}.
  • Time limit 900 seconds; retries play no role, as no external services are called.

Example

Goods receipt at Musterfirma GmbH: A distributor sends the delivery note as PDF by email, the process starts with the file under deliveryNote.

  1. Analyze PDF with the input above, result path analysis.
  2. PDF Analysis → Delivery Note with input expression analysis, result path delivery_note_data.
  3. Output as above: delivery_note_data.delivery_note_number = LS-2026-04471, two items.
  4. Next step: Resolve reference matches delivery_note_data.sender to the supplier record; then a database step creates the goods receipt with the items, and the user task "Check goods receipt" shows quantities and texts next to the order.

Frequently asked questions

In the dry run the fields are called deliveryNoteNumber and searchFields, in the real run delivery_note_number and search_fields.

The dry run shows a sample output from the catalog that differs from the real output; it also shows a German date instead of YYYY-MM-DD. Follow-up steps are built against the real names in snake_case as documented above. A mapping that only works in the dry run fails in the real run.

The items are empty although the delivery note has a table.

The header was not recognized as an item table. Terms such as Menge, Stück, qty, Pos, Nr, Bezeichnung, Artikel, Text are scored. For unusual column titles, AI: Extract data on the raw text helps.

Why is quantity a text?

The cells are taken over unchanged. For calculations, convert in the output expression with $number(quantity).


Next step

Resolve reference: match the recognized sender to the supplier record.