workflows.fit
Back to n8n workflows
n8n templateFreeBy Pernille-AI

Sync AWS billing invoices with FreeAgent and PostgreSQL tracking

Automatically retrieve AWS invoices and create corresponding bills in FreeAgent, marking them as paid. This workflow eliminates manual data entry for AWS billing. What It Does 1. Fetches invoices from AWS Invoicing AP...

DevelopmentCore NodesData & StorageCodeSplit In BatchesPostgresHttp Request
Loading interactive preview...

Template notes

Automatically retrieve AWS invoices and create corresponding bills in FreeAgent, marking them as paid. This workflow eliminates manual data entry for AWS billing.

What It Does

1. Fetches invoices from AWS Invoicing API for the previous month 2. Filters invoices by issue date to ensure only new ones are processed 3. Checks PostgreSQL database for previously processed invoices 4. Creates a bill in FreeAgent with correct dates and amounts 5. Marks the bill as paid with a bank transaction explanation 6. Records the invoice in the database to prevent future duplication

Prerequisites

- AWS account with Invoicing API access - FreeAgent account with OAuth API access - PostgreSQL database (you could modify to use n8n Data Table?) - AWS IAM user with invoicing:ListInvoiceSummaries permission

Quick Setup Checklist

- [ ] Create PostgreSQL table (see below) - [ ] Add PostgreSQL credentials in n8n - [ ] Set up FreeAgent OAuth2 credentials - [ ] Update AWS access key and secret key in "Generate AWS Signature" node - [ ] Update AWS account ID in "Calculate Last Month" node - [ ] Get and update FreeAgent contact ID for AWS - [ ] Get and update FreeAgent category ID (cloud services/hosting) - [ ] Get and update FreeAgent bank account ID - Configuration Required

This template has placeholders that you need to replace: