How to Trigger a Flow When a File Is Uploaded in Salesforce

How to Trigger a Flow When a File Is Uploaded in Salesforce

Record-triggered flow is one of the most common and powerful flow type in Salesforce. However, record-triggered flows come with certain limitations. One major limitation has always been that you couldn’t select ContentDocument or any file related object as the starting object. In other words, it wasn’t possible to trigger a flow when a file was uploaded in Salesforce.

This gap has long been a pain point for many Salesforce environments. The only workaround was to use Apex code, which meant involving developers even for simple automations related to file uploads.

Fortunately, with the Winter '26 release, Salesforce has finally addressed this limitation. A brand new feature now allows you to use an Automation Event-Triggered Flow that fires when someone uploads a file. This opens the door for declarative automations around file management, and no Apex required.

The New Option to Trigger a Flow When a File is Uploaded in Salesforce

It’s still not possible to select ContentDocument or any other file-related object as the starting object in a Record-Triggered Flow. However, with the Automation Event-Triggered Flow, you can now trigger a flow when a file is uploaded in Salesforce.

First, check if the Automation Event-Triggered Flow type is available in your org. Then check whether you can see File Attach under the event library. If you don’t see either of these options, open a case with Salesforce Support. They will enable them for your org.

Using Automation Event-Triggered Flow to Trigger a Flow When a File is Uploaded in Salesforce

As you can see in the screenshot, there are 603 "File Attach" events available in this environment. This is because Salesforce creates a separate File Attach event for each object. It allows you to trigger automations specifically when a user uploads file to that particular object.

Select the File Attach event that matches your use case. For example, choose "File Attach to Task" if you want the flow to trigger whenever a user uploads a file to a Task record.

Selecting an Event to Trigger a Flow When a File is Uploaded in Salesforce

After selecting the event, you can define filters to control when the flow should start. For example, if you want the flow to trigger only when a file with a specific name or file type is uploaded, set conditions using the Name and File Extension parameters.

Set Filters

The Automation Event-Triggered Flow includes a global variable called {!$Event}, which stores information about the uploaded file and its related record.

Event Global Variable

For example, if you selected the "File Attach to Task" event, the {!$Event} global variable contains details from both the ContentDocument record and the related Task record.

Values of the Event Global Variable

For instance, if you want to update the related Task record, simply add an Update Records element and use the {!$Event} global variable to set the field values. In this example, we’re marking a checkbox field and updating the Task Description with the title of the uploaded file.

Update Task When a File Is Uploaded

At the end, the flow will work like this:

Triggering a Flow When a File Is Uploaded in Salesforce

1 Trackback / Pingback

  1. New Flow Features of Winter '26 Release - Salesforce Time

Leave a Reply

Your email address will not be published.


*