longrun.
Bubble file upload
Integrations / Bubble file upload

Bubble file upload

Send files generated by LongRun to your Bubble app’s storage.

1. Connect your Bubble app

The Bubble file upload integration delivers generated files to Bubble storage. Start in Settings → Integrations in LongRun and add your Bubble connection. Use the settings for the Bubble app and environment where you want the files stored. You do not need Bubble’s API Connector to configure this integration.

2. Send a generated file to Bubble

Open Settings → Integrations in LongRun and configure the Bubble file upload connection for your app. Copy its connection ID. In the request below, set STORAGE_CONNECTION_ID to that ID. Set output.storage to bubble. This example uses HTML to PDF; the same output settings apply to other actions that generate files.

Deliver a PDF to Bubble
curl --request POST "https://uselongrun.app/v1/pdf/html-to-pdf" \
  --header "Authorization: Bearer ${API_KEY}" \
  --header "Content-Type: application/json" \
  --data "$(jq -n --arg STORAGE_CONNECTION_ID "${STORAGE_CONNECTION_ID}" '{
  "inputs": {
    "html": "<h1>Receipt</h1>"
  },
  "output": {
    "storage": "bubble",
    "connection_id": $STORAGE_CONNECTION_ID
  }
}')"

3. Make the upload private when needed

Set private to true and provide attach_to with the Bubble Thing ID that owns the file. Configure and test the receiving app’s privacy rules with the intended user. Do not use a LongRun file or run ID here. If private is omitted, it defaults to false.

Private Bubble file
curl --request POST "https://uselongrun.app/v1/pdf/html-to-pdf" \
  --header "Authorization: Bearer ${API_KEY}" \
  --header "Content-Type: application/json" \
  --data "$(jq -n --arg STORAGE_CONNECTION_ID "${STORAGE_CONNECTION_ID}" --arg BUBBLE_THING_ID "${BUBBLE_THING_ID}" '{
  "inputs": {
    "html": "<h1>Private receipt</h1>"
  },
  "output": {
    "storage": "bubble",
    "connection_id": $STORAGE_CONNECTION_ID,
    "private": true,
    "attach_to": $BUBBLE_THING_ID
  }
}')"

4. Use the uploaded file

Submit the request and keep the returned run ID. Check the run until it completes. For this HTML-to-PDF example, read outputs.file.url to get the Bubble file URL. If delivery fails, inspect the run error and check your connection settings and Bubble privacy rules.

Check the run
curl --request GET "https://uselongrun.app/v1/runs/${RUN_ID}" \
  --header "Authorization: Bearer ${API_KEY}"