Purchase Order Automation in n8n – batch-extract POs and generate EDI 850 files for your ERP [Workflow Included]

:waving_hand: Hey n8n Community,

A while back I built a purchase order extractor for a friend who was drowning in PO PDFs. It let him batch-upload the documents through a form and pull all the data into a Google Sheet through the easybits extractor. That alone saved him a lot of manual re-typing.

Last week he told me his company is moving onto SAP, and he asked whether the workflow could also spit out EDI files so he can push the orders straight into the ERP instead of keying them in by hand. So I built that in, and while I was at it I made the whole thing a good bit more robust.

How it’s set up:

  • Batch PDF upload: the form takes one or many PO PDFs at once, and a toggle lets you decide per submission whether you also want EDI files out.

  • Extraction: each PO runs through the easybits extractor one at a time and lands in a Google Sheet, one row per line item, with the source document name on every row so you can always trace a row back to its PDF.

  • EDI 850 generation (optional): when the toggle is on, each PO is also turned into a valid X12 850 EDI file and saved to a Drive folder, ready to upload into SAP. A separate sub-workflow handles the generation, so the main flow stays clean.

  • Duplicate check: after extraction it checks the PO number against what’s already in the sheet. If that PO was processed before, it skips it, so you never get double entries.

  • Flag summary: the completion screen tells you if any field was missing or looked off in an extraction, and lists any duplicates it skipped along with the PO number.

:movie_camera: Short video:

Showing a batch run of three POs with EDI generation switched on, then a re-upload of one of them so you can see the duplicate check catch it and report which document and PO number it was.

Both workflows (the main one plus the EDI sub-workflow) and a setup guide are here:

You’ll also find it alongside 20+ other n8n workflows in my repo. If it’s useful to you, a :star: really helps other builders discover it too: GitHub - felix-sattler-easybits/n8n-workflows: n8n workflow templates for automated data extraction and document processing. · GitHub

Curious how the rest of you are handling the PO-to-ERP step. Are you going through EDI, hitting a direct API, or still uploading into the ERP by hand?

Best,
Felix

2 curtidas

Hey Felix,
If you’re friend company is moving over to SAP it would most likely be SAP S4/Hana and if setup correctly done and they are using MRP and have set inventory as managed he will barely be touching the PO. The only time he might have to is if the BUOM is incorrectly set and that cause the PO to be raised as a fraction. What your friend will properly be asking you is a tool to help extract reports because that is one area i find users at my work constantly complaining about and I’m in the process of building the tool for it.
Will

1 curtida

Hey @willrenzo39, thanks so much for sharing these tips!

This is actually my first time integrating directly with SAP, so I’ve mainly been working with the information my friend got from SAP Support so far. They also mentioned EDI 850 files, but I’ll be able to give a proper update on the integration once everything is fully implemented.

For now, I’ve double-checked the EDI files generated by my workflow, and they are working as expected. So even if EDI 850 is ultimately what he needs, he’ll already have a working solution for that part.