Pipedream code-step recipe

Give the next Pipedream step a real file URL.

Receive a webhook body, buffer, base64 value, or temporary file URL in Pipedream and export a durable FilePost URL for the rest of the workflow.

Get free API key View the Python step Secret input · Node.js or Python · URL exported downstream
A Pipedream workflow passing a file to FilePost and a public URL downstream

Upload a file in Pipedream and pass the URL to the next step

Pipedream handles triggers, code, and downstream actions. FilePost handles the durable public file URL: keep the key in a secret input, upload the bytes, and export the response fields your next step needs.

Webhook or buffer in

Use request bodies and headers from an HTTP trigger, or map bytes from an earlier step.

Multipart upload

Use Python requests or Node.js axios and FilePost's dedicated upload host.

URL out

Export file_url, file_id, file_size, and expiry for later steps.

Python step

Define filepost_api_key as a secret input. Adapt the trigger field names to your workflow.

import requests

def handler(pd: "pipedream"):
    file_data = pd.steps["trigger"]["event"]["body"]
    file_name = pd.steps["trigger"]["event"]["headers"].get("x-filename", "upload.bin")
    content_type = pd.steps["trigger"]["event"]["headers"].get("content-type", "application/octet-stream")

    response = requests.post(
        "https://upload.filepost.dev/v1/upload",
        headers={
            "X-API-Key": pd.inputs["filepost_api_key"],
            "X-FilePost-Integration": "pipedream",
        },
        files={"file": (file_name, file_data, content_type)},
        timeout=60,
    )
    response.raise_for_status()
    result = response.json()

    pd.export("file_url", result["url"])
    pd.export("file_id", result["file_id"])
    pd.export("file_size", result["size"])
    return result

Choose the correct input path

Use multipart /v1/upload for bytes, /v1/upload/base64 when the previous step returns encoded content, and /v1/upload/url when it returns a public temporary URL. Add expires_in when the artifact should disappear after processing.

For the longer Node.js example and webhook response step, read the Pipedream file upload guide. For AI-oriented patterns, see FilePost for AI agents.

Questions we actually get

Where should the API key live?

Use a secret Pipedream input or environment value. Never place the key in a public webhook response, a shared workflow field, or a browser bundle.

Can I upload a generated base64 file?

Yes. Use the JSON base64 endpoint from a code step, or decode the value first and send it as multipart data.

Do Pipedream uploads count against the FilePost limit?

Yes. Every successful upload counts against the connected account's monthly quota. The quota and relevant upgrade action are returned by the API when the account approaches its limit.

Make the file step reusable.

Start with one Pipedream webhook. Once the next step receives a working URL, reuse the same upload boundary for every file-producing workflow.

Get free API key 1 provisional / 15 verified uploads per month · no credit card