Production-ready Flow actions for creating and deleting public Content Distribution links (public URLs) for Salesforce files. Designed as a focused, low-dependency package that your admins can use in Flow and your developers can extend in Apex.
- Core classes: ContentDistributionManager.cls, ContentDistributionDeleter.cls
- Permission set: Content_Distribution_Manager.permissionset-meta.xml
- Create public Content Distribution URLs from Flow
- Delete distributions (links) safely in bulk or singly
- Optional expiration dates
- Control original file download
- Notify on link visits
- Bulk via Flow collections by passing a collection of Apex-defined inputs
- Minimal footprint, no external dependencies
- Send public links in email templates and automations
- Share files to guest users (Experience Cloud, marketing, CS)
- Auto-expire links for time-bound content
- Cleanup links after campaigns or case closure
sequenceDiagram
participant User as Package User
participant Docs as Documentation
participant Deploy as Deployment
participant Flow as Salesforce Flow
participant CDM as Content Distribution
Note over User,CDM: Documentation Journey
User->>Docs: Read README overview
Docs->>User: Understand features & benefits
User->>Docs: Follow deployment guide
Docs->>Deploy: Step-by-step instructions
Deploy->>User: Successful installation
User->>Docs: Review Flow examples
Docs->>Flow: Configuration guidance
Flow->>CDM: Implement content sharing
CDM->>User: Working solution
User->>Docs: Check troubleshooting
Docs->>User: Resolve issues quickly
User->>Docs: Explore best practices
Docs->>User: Optimize implementation
- Prerequisites
- Salesforce org with API access
- Salesforce CLI (sf) installed
- VS Code with Salesforce extensions (optional)
- Install
- Follow docs/DEPLOYMENT.md for scratch org/sandbox/production options
- Assign the permission set Content Distribution Manager to users who run the Flows
- Basic usage
- In Flow, add the action “Create Public Content URL” (from this package)
- Provide a Flow input (ContentDistributionManager.FlowInput) with contentVersionId; for bulk, pass a collection of FlowInput items
- Optionally set expirationDate, allowDownload, notifyOnVisit, deleteExisting, distributionName (AllowViewInBrowser and LinkLatestVersion default to true)
- Use the returned publicUrl(s) in emails, screen components, etc.
For complete, step-by-step instructions (CLI, VS Code, and Workbench), see: docs/DEPLOYMENT.md
Two invocable actions are included. Each supports single and bulk execution in Flow:
- Create: provided by ContentDistributionManager.cls
- Delete: provided by ContentDistributionDeleter.cls
Key inputs (create)
- contentVersionId (Id)
- distributionName (String, optional)
- expirationDate (Datetime, optional)
- allowDownload (Boolean)
- notifyOnVisit (Boolean)
- deleteExisting (Boolean)
Note: The action defaults AllowViewInBrowser and LinkLatestVersion to true.
Key outputs (create)
- publicUrl
- downloadUrl
- distributionId
- success (Boolean)
- alreadyExisted (Boolean)
- errorMessage (if any)
Key inputs (delete)
- Each item is a ContentDistributionDeleter.DeleteInput with one or both of:
- distributionId (Id)
- contentVersionId (Id) // deletes all distributions for the version
Key outputs (delete)
- recordsDeleted
- errorMessage (if any)
For the complete parameter and return details (labels, types, constraints), see the API Reference: docs/API_REFERENCE.md
See step-by-step examples (basic, advanced with expiration/notifications, bulk, cleanup) in: docs/FLOW_EXAMPLES.md
- Security
- Use expirations for sensitive files
- Limit original downloads when not required
- Assign the included permission set only to trusted automation users
- Performance
- Use collections to create/delete in bulk when possible
- Avoid unnecessary updates to distributions; prefer idempotent patterns
- Error handling
- Capture returned errors; route to Fault paths and logs
- Add visibility via Platform Events or custom logging where appropriate
- Lifecycle
- Use the cleanup Flow to remove stale links on a schedule
Common deployment and runtime issues plus fixes are documented here: docs/DEPLOYMENT.md Runtime Flow configuration issues and FAQs: docs/FLOW_EXAMPLES.md
Detailed developer documentation (method behavior, inputs/outputs, integration patterns): docs/API_REFERENCE.md
- Issues: open a GitHub issue with steps, expected/actual behavior, and logs
- PRs: see CONTRIBUTING.md
- License: LICENSE
- Changelog: CHANGELOG.md
Built for admins and developers who need secure, manageable public file sharing via Salesforce content distributions.