Skip to content

A lite weight content distribution manager for use with Salesforce Flows to convert File Uploads into Public Content Distributions

License

Notifications You must be signed in to change notification settings

chase-rpa/content-manager

Repository files navigation

Salesforce Content Distribution (Standalone Package)

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.

Features

  • 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

Use cases

  • 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

Documentation Journey

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
Loading

Quick start

  1. Prerequisites
  • Salesforce org with API access
  • Salesforce CLI (sf) installed
  • VS Code with Salesforce extensions (optional)
  1. Install
  • Follow docs/DEPLOYMENT.md for scratch org/sandbox/production options
  • Assign the permission set Content Distribution Manager to users who run the Flows
  1. 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.

Installation and deployment

For complete, step-by-step instructions (CLI, VS Code, and Workbench), see: docs/DEPLOYMENT.md

Flow actions

Two invocable actions are included. Each supports single and bulk execution in Flow:

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

Example Flow configurations

See step-by-step examples (basic, advanced with expiration/notifications, bulk, cleanup) in: docs/FLOW_EXAMPLES.md

Best practices

  • 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

Troubleshooting

Common deployment and runtime issues plus fixes are documented here: docs/DEPLOYMENT.md Runtime Flow configuration issues and FAQs: docs/FLOW_EXAMPLES.md

API reference

Detailed developer documentation (method behavior, inputs/outputs, integration patterns): docs/API_REFERENCE.md

Contributing and support

Acknowledgements

Built for admins and developers who need secure, manageable public file sharing via Salesforce content distributions.

About

A lite weight content distribution manager for use with Salesforce Flows to convert File Uploads into Public Content Distributions

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages