Salesforce Record-Triggered Flow for ContentVersion Files

There are a number of use cases where a Salesforce Admin or Developer may want to handle File upload events using Salesforce Flow Builder. Example use cases include:

  • Applying OCR text recognition on uploaded images using iDialogue content analysis
  • Converting files to other file types and formats
  • Verifying files contain certain keywords
  • Associating files with other Salesforce records via ContentDocumentLinks
  • Notifying a record owner whenever a customer uploads a file to a document room

iDialogue raises CONTENT_VERSION_INSERT and CONTENT_VERSION_UPDATE platform events for these types of use cases (note: as of Winter '23, "Record-Triggered Flows" did not support ContentVersion object types. This platform event approach provides an equivalent alternative).

Implement this solution in 4-steps:

1. Begin by creating a new Flow of type "Platform Event-Triggered Flow".

Select Platform Event-Triggered Flow

2. Select the "iDialogue Event" type.

Choose Platform Event

3. Add conditional branch decisions to check for ContentVersion Insert and Update events.

$​Record> Event Type = CONTENT_VERSION_INSERT
$​Record> Event Type = CONTENT_VERSION_UPDATE

Add conditional branch decisions to check for ContentVersion Insert and Update events

4. Finally, add any custom flow handlers to process the ContentVersion insert or update events, such as making callouts to the iDialogue Content Intelligence API for file processing.

​Note: that these platform events are always raised in an AFTER trigger context.
add any custom flow handlers