DEV Community

Tasnem Islam Prome
Tasnem Islam Prome

Posted on Edited on

Automating Construction Invoice Workflows with n8n, Gmail and Notion

#automation #javascript #productivity #showdev

Managing construction operations involves more than tracking projects. Businesses also need to manage supplier invoices, project costs, equipment hire and payment statuses.

I explored these challenges through Construction Operations Automation, a portfolio prototype using Notion, n8n, Gmail and JavaScript.

The Problem

When invoices arrive through email, manually entering them into a project database creates several risks:

  • Duplicate invoices
  • Missing supplier information
  • Incorrect payment statuses
  • Inconsistent monthly reporting
  • Poor visibility of project expenditure

My objective was to design a workflow that reduces repetitive administration.

The Solution

The prototype connects email processing with structured Notion databases.

The workflow follows this sequence:

  1. Gmail receives an invoice.
  2. n8n retrieves the message.
  3. JavaScript extracts invoice information.
  4. Required fields are validated.
  5. The workflow checks for an existing invoice.
  6. A project cost record is created or updated.
  7. The supplier-month summary is created or updated.

The design also considers changes such as an invoice moving from Unpaid to Paid.

Example Invoice

A fictional test invoice contains:

  • Invoice reference: TEST-001
  • Supplier: Demo Building Supplies
  • Project: Sample Residence
  • Amount: 350
  • Status: Unpaid

The invoice reference helps the workflow identify existing records and avoid unnecessary duplicate creation.

What I Tested

The repository documents tests involving new invoices, duplicate handling, payment-status updates, missing fields and supplier-month summary creation.

Important Limitation

This is a sanitized portfolio reconstruction, not a production deployment.

One important improvement is still needed: monthly supplier totals should be recalculated from all relevant project cost records.

Without that, multiple invoice updates could produce incorrect aggregate values.

Other future improvements include error retries, audit logs, attachment handling and production monitoring.

What I Learned

This project helped me explore the relationship between business processes, database design and workflow automation.

A working automation is not just about connecting applications. It also needs reliable validation, consistent records and careful handling of repeated events.

GitHub: https://github.com/tasnem-tech/construction-operations-automation

Project website: https://tasnem-tech.github.io/construction-operations-automation/

I'm interested in how other developers approach reliable invoice processing and no-code/low-code automation.

Top comments (0)