n8n

How to Automate Stripe Invoice Backup to S3?

Back up last month’s Stripe invoice PDFs to your S3 bucket on the first day of each month. Ideal for finance and accounting teams that need a dependable archive for audits, bookkeeping, and sharing with external accountants.

A monthly schedule or a manual test starts the run. The flow prepares a target year and month, defaults to last month, and cleans the folder and bucket values. It calls Stripe to list invoices for the selected period, then splits the list so each invoice is handled on its own. Only invoice objects continue. For each one, the PDF link is downloaded and a clean S3 path is built using folder name, year, month, and a safe file name. Files are uploaded to your chosen S3 bucket. An error step protects against unexpected data.

Setup requires a Stripe API key and AWS credentials with permission to write to S3. Expect to replace hours of manual downloading and filing with a few minutes of automation. Great for monthly closes, audit trails, and consistent invoice retention without human error.

What are the key features?

  • Runs on a monthly schedule and also supports manual tests for ad hoc syncs.
  • ENV step calculates last month’s year and month and allows manual overrides.
  • Clean and Escape ENV sanitizes bucket and folder inputs to avoid bad paths.
  • Stripe HTTP call fetches invoices for the selected date range.
  • Split Out processes each invoice separately for reliable handling.
  • If check ensures only invoice objects pass through.
  • Downloads the invoice PDF from the invoice_pdf link on each record.
  • Builds the S3 key as folder year month filename for clear organization.
  • Uploads each PDF to the chosen S3 bucket using the computed path.
  • Stop and Error node raises an alert if unexpected data appears.

What are the benefits?

  • Reduce monthly filing time from 2 hours to 5 minutes
  • Automate 100 percent of invoice downloads and uploads
  • Improve naming accuracy by 100 percent with structured S3 keys
  • Handle thousands of invoices per month without slowing down
  • Connect Stripe and Amazon S3 with no manual steps
  • Maintain audit ready archives by year and month

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with Stripe and Amazon S3. See the Tools Required section above for links to create accounts with these services.
  3. Open the node named Get all Invoices* and in the Credential to connect with menu select Create new credential. Choose Stripe and follow the on screen steps. In your Stripe Dashboard, go to Developers then API keys and copy a secret key. Paste it into n8n and name the credential clearly, for example Stripe Prod.
  4. Still in Get all Invoices*, confirm the request URL is https://api.stripe.com/v1/invoices. Leave query settings as provided so invoices are pulled for the selected month.
  5. Open the node Upload to S3 Bucket* and create a new Amazon S3 credential. Enter Access Key ID, Secret Access Key, and Region for an IAM user with s3:PutObject permission. Name the credential clearly, for example AWS S3 Prod.
  6. In the ENV* node, set bucketName to your S3 bucket. Optionally set folderName for a subfolder. Leave year and month expressions to auto target last month, or enter numbers for a manual backfill.
  7. Check the Clean and Escape ENV node output to confirm bucketName and folderName look correct and safe.
  8. Click Test workflow to run a manual test. Watch the execution: invoices are fetched, filtered to invoice objects, PDFs are downloaded, and S3 paths are built.
  9. Open your S3 console and verify files appear under folderName year month with clear file names. Confirm you can open a PDF.
  10. Optional: In Upload to S3 Bucket*, review settings like storage class and ACL to match your retention policy.
  11. Activate the workflow and ensure the schedule trigger is enabled so it runs on the first day of each month.
  12. Troubleshooting: If you see Unexpected or missing Invoice Obj, check the Stripe response and API key. If invoice_pdf is empty, make sure invoices are finalized in Stripe. If upload fails, verify IAM permissions and the bucket region.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

Amazon S3

Sign up

AWS Free Tier: 5 GB S3 Standard storage, 20,000 GET requests, 2,000 PUT/COPY/POST/LIST requests, and 100 GB data transfer out / mo

Stripe

Sign up

Pay-as-you-go: $0 / mo; 2.9% + $0.30 per successful domestic card transaction (US).

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.