Quick overview
This workflow lets you upload multiple supplier quote PDFs via an n8n form, extracts key pricing and terms with Anthropic Claude Haiku, normalizes totals to include tax and shipping, ranks comparable quotes, and posts a summary to Slack while also showing a detailed HTML comparison page.
How it works
- Receives uploaded quote PDFs (and an optional request description) through an n8n form trigger.
- Splits the uploaded files so each PDF is processed individually and extracts text from each document.
- Skips scanned/image-only PDFs with no extractable text and marks them as unreadable.
- Sends the extracted text to Anthropic Claude Haiku to copy out the supplier, totals, tax, shipping, validity, and other terms as structured JSON with supporting quote snippets.
- Verifies the extracted snippets exist in the PDF text, determines whether totals include tax, adds tax when needed using the configured rate, parses validity dates, and calculates a comparable grand total including shipping when possible.
- Ranks non-expired quotes that have a comparable grand total, lists expired and non-comparable quotes with reasons, and builds both a Slack message and an HTML report.
- Posts the ranked comparison to a selected Slack channel and displays the HTML report as the form submission result.
Setup
- Add an Anthropic (Claude) credential and ensure the model ID is available in the Anthropic Chat node.
- Add a Slack credential and select the target channel in the Slack message step.
- Set the tax_rate (for cases where no tax amount is written) and timezone in the Config step, and optionally set a fixed today date for testing validity logic.
- Publish the form, copy its URL, and use it to upload 2–5 PDF quotes for the same request.
Requirements
- Anthropic API key (Claude Haiku 5.5 reads each quote, one call per PDF)
- Slack bot token with chat:write, invited to the channel you pick
- Supplier quotes as text-based PDFs (scanned image PDFs are listed as unreadable, not sent to the AI)
Customization
- Set tax_rate in Config (default 0.1 = 10%). It is used only when a quote shows a tax-excluded total with no tax amount
- Set today in Config to a date (YYYY-MM-DD) to test validity and expiry. Leave it empty in normal use
- Edit the wording of the result page and the Slack message in the L object at the top of each Code node
- Remove the Slack node and connect "Rank and build table" to "Show comparison" to use the form result page only
Additional info
Tested on n8n 2.36.8 with four fictional English quotes plus one scanned image PDF: a validity written as "30 days from issue", shipping "billed separately", line items that do not add up to the subtotal, a tax-excluded total that has expired, and a quote containing an instruction aimed at the AI. All were flagged as expected, and the instruction was ignored. The AI only copies words with quotes. Code checks that each quote is in the PDF text and decides everything else: tax basis, sums, dates and ranking. No credentials are included.