Skip to content

Many attachments into one PDF, and nothing deleted until the merge is safe

An on-demand Make scenario gathers the attachments on an invoice in the accounting system, merges them into one PDF, uploads it to the invoice and only then deletes the originals. Every external call retries, and a failed upload stops the run before anything is deleted.

Billing & financeTool2026

Where this applies

Any business that keeps a sale's documents on the invoice in its accounting system and would rather send or archive one PDF than a dozen attachments.

files per merge, the PDF service's limit
15
external calls, each with its own retry
6
rule: nothing is deleted before the upload succeeds
1

The problem

When an invoice becomes the file for a sale, its attachments pile up: a signed delivery note, ID, payment proofs, a registration document, photos. A dozen separate files are awkward to send, slow to open and easy to miss one of. One merged PDF is what accounts and the customer actually want.

Merging is the easy part. The risk is in tidying up: the originals have to be deleted to leave one clean document, and a tool that deletes before it is sure the merged copy is stored can lose the whole pack. The merge service also has a limit on how many files it takes at once.

What we built

01

Only invoices worth merging

The tool is started on demand and picks up invoices from the accounting system. A filter passes only an invoice in a usable state, its attachments are listed, and a second filter goes on only when there is more than one, since a single attachment needs no merge.

02

The merge service's limit, written down

The attachment list is read up to fifteen files, the most the PDF service merges in one call, and the module's label says so, so the next person to edit it knows where the number came from. Each attachment is downloaded and an array aggregator gathers them into one bundle; a filter checks that at least one file came through before the merge is attempted.

03

Retry, then a fallback

Every external call (listing, downloading, merging, reading file ids, uploading and deleting) has a retry handler. The download and the merge also have a fallback: when the retries run out, a separate module makes a second attempt before the run resumes, so one stubborn file does not end the run.

04

Record the originals before writing anything

Before the merged file is uploaded, a raw API call records the ids of the invoice's existing files. That list, taken before the merged PDF exists, is what the tool later deletes, so the new file can never be mistaken for an original and removed.

05

Upload first, delete second

After a short wait the merged PDF is uploaded to the invoice. Only once that upload has succeeded does an iterator walk the recorded originals and delete each one that has a file id, each delete with its own retry. If the upload fails, the run stops there and every original is still in place, which the upload module's label states.

The outcome

  • Built in July 2026 and last revised on 15 October 2026. It is started by hand rather than on a schedule, and no run of it appears in the current billing period, so this page describes a design rather than a volume.

  • A separate, switched-off version of the same job is not described here.

Where it stops

It runs only when someone starts it, so invoices are not merged on their own, and it has no run history in the current period. One merge takes at most fifteen files, so it suits invoices with up to that many attachments. A failure part-way through the deletes leaves the merged PDF beside some of the originals, which is untidy but loses nothing. It has no alert of its own: a run that ends in an error is seen only in Make's history.

Built with

  • Make.com
  • Xero
  • PDF.co

Patterns used

  • Upload before delete
  • Record ids before writing
  • Retry, then fallback
  • Limit written on the module

Page copy drafted with AI assistance. Skofi is accountable for it. Editorial policy

Start here

Have something shaped like this?

If any part of the above resembles a problem you are living with, a short call is the fastest way to find out whether it is the same problem underneath.

Book a 15-minute callsaveez@skofi.tech

What happens on the call

  • 15 minutes, no deck
  • We map the process on the call
  • A written scope, or an honest no
Book a call