Skip to main content

Command Palette

Search for a command to run...

How to Merge PDFs in Bubble Without Timeouts Using n8n?

Avoid Bubble.io’s 30-second workflow timeout by offloading PDF merging to n8n. Learn how to integrate I Love PDF API, upload the merged file to Bubble

Updated
4 min read
How to Merge PDFs in Bubble Without Timeouts Using n8n?
A

Certified Bubble.io Developer • Airdev Certified • Top Rated Plus on Upwork with 100% Job Success. I've spent 3000+ hours building scalable MVPs, optimizing apps, and integrating everything from Stripe to AI. My journey: no-code → vibe code → code - and I write about all of it here. Looking for a developer who actually ships? Let's build something together.

If you try merging PDFs directly in Bubble.io, you may run into timeout issues - many users report external API calls taking more than ~30 seconds simply fail.
To build a more scalable solution, I moved the heavy lifting to n8n, which doesn’t have Bubble’s runtime restrictions. In this article, I walk through the design, implementation, and security considerations of combining Bubble, n8n, and the I Love PDF APIs.


Bubble API Workflow Limits

  • Bubble’s workflows (especially when calling an external API) are subject to timeout constraints -many users encounter errors like Failed to establish a connection after 30000 ms or request timed out When the external call takes longer.

  • Some forum discussion suggests that Bubble has a 5-minute limit on entire workflow sequences, but the more immediate bottleneck is the ~30s external API call ceiling.

  • This means that merging multiple or large PDF files inside a Bubble workflow is inherently risky - you might hit failures when the backend process takes too long or the HTTP request to an API doesn't respond fast enough.

Because of that, I decided to offload the process into a dedicated automation environment (n8n) so that Bubble just orchestrates inputs and gets the merged result back.


Bubble PDFs Merge using n8n Architecture

Here’s the improved design, refined with caveats:

Bubble → n8n (Webhook Trigger)

  • Bubble sends the list of PDF URLs + metadata to an n8n webhook (HTTP Request).

  • To avoid Bubble waiting indefinitely, the webhook should respond quickly (e.g. acknowledge receipt).

  • Later, n8n will call back Bubble with the merged file link.

n8n: PDF Download & I Love PDF Merge

  • Use n8n nodes (HTTP Request, Function, Loop) to download each PDF file.

  • Use I Love PDF Merge API (start merge task → upload each file → execute merge).

  • Store credentials (I Love PDF API key) securely in n8n’s credentials system, not in nodes.

n8n: Upload Merged PDF to Bubble File Manager

  • Use Bubble’s /fileupload endpoint to push the merged file.

  • Security warning: Bubble’s file upload API endpoint can be abused if left open. Many in the Bubble community call this a vulnerability.

  • To protect this, ensure only your backend (n8n) can call it (e.g., with a secret header, IP whitelisting, or checking an authorization token).

n8n → Bubble: Callback / Workflow Trigger

  • After upload, n8n calls a Bubble API endpoint (e.g. a backend workflow) passing the file URL or file ID.

  • Bubble updates its database and triggers subsequent workflows (e.g. emailing the PDF).

Error Handling / Retries

  • If any PDF upload or merge step fails, n8n can retry.

  • You can notify the admin or fallback logic inside n8n if something goes wrong.


Why This Bubble + n8n Solution Works Better?

  • No Bubble timeouts on heavy processing - n8n can run as long as needed without the same constraints.

  • Separation of concerns - Bubble remains the UI and data orchestrator; heavy file processing is handled elsewhere.

  • Credential safety - API keys remain in n8n’s credential store, not exposed in visuals.

  • Better error control - n8n supports structured retry logic, branching, error-handling, logging etc.

However, you need to be cautious about:

  • Ensuring the initial webhook from Bubble doesn’t block (i.e., respond quickly, don’t wait for the full merge).

  • Securing Bubble’s file upload endpoint so that malicious actors can’t upload arbitrary files.

  • Handling edge cases (network failures, large file sizes, etc.) robustly.


Security & Best Practices

  • Always use n8n’s credential store (not embedding secrets in nodes). n8n’s docs specify credentials are separate and private.

  • For your Bubble file upload endpoint:

    • Avoid leaving it wide open. Many community posts state that the /fileupload endpoint can be triggered without authentication in some setups.

    • Use headers or tokens to limit who can upload.

  • For Bubble → n8n webhook:

    • Validate incoming requests (signature, token) to prevent unwanted triggers.

    • Return a fast ACK, then process asynchronously.

  • Ensure your callback from n8n → Bubble is also authenticated/validated.


n8n template for PDF Merger

Here is the logic structure:

Bubble frontend → HTTP POST to n8n webhook (pdfUrls, metadata)
↓
n8n: Webhook receives → immediately respond 200 OK (maybe return a job ID)
↓
n8n: Process flow
    • Authenticate with I Love PDF (using secure credential)
    • Start merge task
    • For each URL: download and upload to merge task
    • Execute merge → get merged PDF URL
    • Download merged PDF
    • Upload to Bubble fileupload endpoint (with authorization)
↓
n8n → HTTP POST back to Bubble backend workflow endpoint: pass merged file URL & job ID
↓
Bubble backend workflow: update DB, trigger email or next step

Here is the template to import: Click here to request access.