Hey Everyone! π Building a Cloudflare-Powered File Sharing App β Seeking Feedback on Architecture
Hey Everyone! 
Building a Cloudflare-Powered File Sharing App β Seeking Feedback on Architecture
Iβm working on a file-sharing application where users can upload files and get a shareable link for others to download or upload additional files. My goal is to make it efficient, scalable, and cost-effective using Cloudflareβs ecosystem.
High-Level Architecture:
Cloudflare R2 stores uploaded files.
Event notifications send messages to a Cloudflare Queue when a file is uploaded.
A Cloudflare Worker consumes these messages and triggers a Cloudflare Workflow to handle file transfers.
The workflow:
Initiates a multipart upload to a cheaper storage bucket.
Reads the R2 object as a stream and uploads it in chunks.
Processes parts in bulk, each bulk handled in a separate step.
Sends a complete command if successful or an abort command if any step fails.
Questions Iβd Love Feedback On:
How many workflows can run in parallel?
I trigger the workflow from a worker bound to a queueβhow long can a workflow run?
Whatβs the best approach for handling uploads from the client?
whats counts for sub-requests in a workflow ?
Option 1: Upload to a worker endpoint (via Cloudflare Access) and trigger a workflow to handle multipart upload. Is this possible?
Option 2: Upload directly to R2 using se a PUT request for file under 50 MIB, for larger files use multipart upload:
(a) Temporary credentials (Access Key/Secret Key) scoped to the user's prefix (username).
(b) Pre-signed URLs (short expiration) for uploads/downloads.
(c) Worker with access for authenticated user with zero trust.
Would love to hear your thoughts! Looking forward to the discussion.
Building a Cloudflare-Powered File Sharing App β Seeking Feedback on Architecture
Iβm working on a file-sharing application where users can upload files and get a shareable link for others to download or upload additional files. My goal is to make it efficient, scalable, and cost-effective using Cloudflareβs ecosystem.
High-Level Architecture:
Cloudflare R2 stores uploaded files.
Event notifications send messages to a Cloudflare Queue when a file is uploaded.
A Cloudflare Worker consumes these messages and triggers a Cloudflare Workflow to handle file transfers.
The workflow:
Initiates a multipart upload to a cheaper storage bucket.
Reads the R2 object as a stream and uploads it in chunks.
Processes parts in bulk, each bulk handled in a separate step.
Sends a complete command if successful or an abort command if any step fails.
Questions Iβd Love Feedback On:
Option 1: Upload to a worker endpoint (via Cloudflare Access) and trigger a workflow to handle multipart upload. Is this possible?
Option 2: Upload directly to R2 using se a PUT request for file under 50 MIB, for larger files use multipart upload:
(a) Temporary credentials (Access Key/Secret Key) scoped to the user's prefix (username).
(b) Pre-signed URLs (short expiration) for uploads/downloads.
(c) Worker with access for authenticated user with zero trust.
Would love to hear your thoughts! Looking forward to the discussion.






