Skip to content
NEWMeet Alaaddin, your AI genie with a voice. trig8n launches 1 January 2027. See what is new

Library / Files & Cloud Storage

Files & Cloud Storage

Extract and validate invoice PDFs into Excel with OpenAI GPT-4o-mini

On a schedule, it manages files with OpenAI / ChatGPT.

What it does

## InvoiceExtractor-Local ### How it works This workflow runs on a schedule, detects whether it is running in a local deployment, builds a local invoice-processing configuration, and creates an execution report. It reads PDF invoices from disk, extracts and cleans their text, sends the content to an OpenAI model, normalizes and validates the AI output, then writes structured JSON results. Valid, invalid, and extraction-error files are routed to separate local folders, removed from the input folder, and the batch loop continues until all files are processed. ### Setup steps - Configure the Schedule Trigger cadence for how often the local invoice folder should be processed. - Run n8n in a self-hosted/local environment with filesystem access enabled; the deployment detection node notes that NODE_FUNCTION_ALLOW_BUILTIN=fs is required. - Create and permission the expected local invoice directories, including the input folder and destination folders for valid, invalid, error, and report output files. - Add valid OpenAI credentials to the OpenAI node and confirm the selected model/prompt can return invoice data in the expected JSON structure. - Review the configuration and file path code nodes so their paths match the machine or container where n8n is running. ### Customization Adjust the invoice validation rules, OpenAI prompt/model, output JSON schema, local folder paths, and execution report content to match your invoice format and operational requirements.

The steps

  1. Clean Extracted Text
  2. OpenAI Invoice Processing
  3. Normalize AI Output
  4. Split JSON Output
  5. Extract Data from PDF
  6. When Scheduled at 4am
  7. Initialize Exec Report Content
  8. Generate Exec Report File
  9. Load PDFs from Disk
  10. Loop Over File Batches
  11. Convert JSON to File
  12. Manage Files on Disk
  13. Set Initial Configurations
  14. Transform Data to File Format

40 steps in total.

Similar automations