Hi everyone,
I'm building an automation using n8n together with the Front API, and I'm running into a major challenge regarding attachment ordering inside a Front draft. I would really appreciate deeper clarification from the community or the Front team, because this is critical for my use case.
Context
I'm a service provider and we onboard customers into different training programs. Each onboarding email contains multiple PDF attachments in a fixed order.
From these files:
-
6 documents are always the same and are already included inside a Front Message Template
-
3 documents are unique per customer (contract, schedule, and one additional document), and these three files are generated dynamically in n8n and added to the draft in the same step after the template content is applied
Because of this setup, I rely on a Front template for the 6 standard documents, and n8n is responsible for attaching the remaining 3 customer-specific PDFs.
Problem: There is no way to create a draft from a template via n8n
I discovered that:
-
Front templates can be created manually in the Front UI
-
Front templates can be fetched via the API (GET /message_templates)
-
But I could not find any endpoint that allows me to instantiate a template into a draft programmatically
Unless I'm misunderstanding something, it appears that the Front API does not currently support creating a draft directly from an existing message template. Because of this, I must manually rebuild the draft body in n8n and manually attach all files instead of relying on the template’s built-in content and attachments.
Since the template already provides 6 of the standard documents, being able to create a draft from that template via API would simplify the automation significantly.
If Front does support template-based draft creation via API, I would appreciate guidance.
Main Issue: Attachment order is not deterministic
I have tried two attachment strategies:
A) Upload all attachments in one PATCH request (multipart/form-data)
Even though I send all attachments in the exact desired order, the final order shown in the Front UI is not consistent. Sometimes they appear reordered, but I cannot identify the sorting logic.
B) Multiple PATCH calls — always resending the full list
Since PATCH replaces attachments rather than appending, I attempted:
PATCH 1 → attachments = [file1]
PATCH 2 → attachments = [file1, file2]
PATCH 3 → attachments = [file1, file2, file3]
…
PATCH 9 → full list of 9 in the desired order
Even with this method, Front sometimes displays attachments in a different order than the order sent to the API.
What I need to know
-
Does the Front API guarantee that attachment order will be preserved?
If yes:-
In which order?
-
The order they appear inside the multipart request?
-
Or does Front reorder attachments internally?
-
-
Is there a recommended method to reliably enforce attachment ordering?
For example: adding filename prefixes such as 01_, 02_, etc. → It did not work for me -
Is there a supported way to instantiate a message template via the API?
Since the template already contains 6 predefined attachments, being able to use it directly would make the automation far easier. -
If the API is not designed to maintain a fixed order, what does Front consider best practice for achieving predictable attachment ordering?
Any clarification or recommendations would be greatly appreciated.
