Duaer

Office tasks

Extract PDF invoices into an Excel sheet with Duaer

In Duaer, upload a batch of PDF invoices, read their text, pull out vendor, amount, tax ID, and date with Basic LLM Chain and Duaer Chat Model, then export one Excel sheet.

Build the invoice flow in Duaer

  1. Create a workflow and add Form Trigger. Add one field labelled Invoices, set Element Type to File, turn on Multiple Files, and set Accepted File Types to .pdf.
  2. Add a Code node, rename it Split files, and paste the code below. It turns one upload of many PDFs into one item per file, each on data.
  3. Add Extract from File, set Operation to Extract From PDF and Input Binary Field to data. Each invoice text lands in text.
  4. Add Basic LLM Chain with Duaer Chat Model on Chat Model, and pick a model under Model. Set Source for Prompt (User Message) to Define below and Prompt (User Message) to: Pull the fields out of this invoice text. Write unknown for anything missing and do not invent numbers. Write dates as YYYY-MM-DD. Invoice text: {{ $json.text }}
  5. On Basic LLM Chain, turn on Require Specific Output Format and attach Structured Output Parser to Output Parser. Set Schema Type to Generate From JSON Example and paste the example from the next section into JSON Example. Each invoice’s fields land in output.
  6. Basic LLM Chain outputs only output. Add Merge with Input 1 from Split files and Input 2 from Basic LLM Chain, Mode Combine, Combine By Position.
  7. Add Edit Fields, set Mode to JSON, and enter {{ { ...$json.output, file: $json.fileName } }}. Each item is one invoice, and file is its source file.
  8. Add Convert to File with Operation Convert to XLSX. All invoices become one sheet on binary.data.
const out = [];
for (const item of $input.all()) {
  for (const key of Object.keys(item.binary ?? {})) {
    out.push({
      json: { ...item.json, fileName: item.binary[key].fileName },
      binary: { data: item.binary[key] },
    });
  }
}
return out;

Columns in the Duaer invoice sheet

  • vendor: the company name on the invoice.
  • amount: a number string; currency: the currency code.
  • tax_id, invoice_number, invoice_date (YYYY-MM-DD).
  • file: the source PDF name.
{
  "vendor": "Acme Trading Co.",
  "amount": "1280.00",
  "currency": "CNY",
  "tax_id": "91310000MA1FL0000X",
  "invoice_number": "12345678",
  "invoice_date": "2026-09-30"
}

Anything missing from the invoice is unknown. Models can still make mistakes, so spot-check a few amounts and tax IDs after export.

Each invoice is one Duaer Chat Model call at the selected model’s price in AI credits. Refer to Duaer plans and credits. Reading the PDF and exporting Excel cost nothing.

Send the Excel file

On the Duaer canvas you can download the xlsx from the Convert to File output. To deliver it every run, add Send Email with data as the attachment, or upload it with Google Drive.

Questions

Can Duaer read scanned PDF invoices?

Extract From PDF in Duaer reads only the text layer. A scan or photo has none, so text is empty; run OCR first and pass that text to Basic LLM Chain.

How much does one invoice cost in Duaer?

One Duaer Chat Model call per invoice, at the selected model’s price in AI credits, shown in the Model dropdown. Reading the PDF and exporting Excel cost nothing.

In this section