Platform Events
All Event Types

Error Event

Overview

The event is triggered when a CloudFiles flow action fails, giving users real-time insights into the failed action. This event provides specific details about which file or resource caused the failure, empowering users to set up custom error handling workflows. The Error Event is currently configured for the Copy Salesforce File action, the Document Processed action, and includes support for the Process Document Using AI action.

With this feature, users can automate how they handle errors. For example, when a document processing action fails, you’ll receive details about the file that didn’t process correctly. From there, you can create flows to automatically track failed files or move them to a designated folder for manual intervention.

How To Use This Event?

To use CloudFiles Platform Events, you must first setup your platform event triggered flow as shown in the CloudFiles Event Handler Flow Template. This article will introduce you to the concepts of the event type in the CloudFiles Event Object as well as event details that are returned by the Get Event Details flow action.

Once you are familiar with these, you will understand how to interpret & use these as illustrated in the sections below.

Document image


Event Type For Decision Filter

Use error-event as the type filter when setting up a decision element in Flow Builder. This ensures that any error caused by CloudFiles actions, such as a failed document process, is captured and ready for handling.

Output Fields From Get Event Details

The corresponding Get Event Details flow action returns the Error Event sub-type with useful information including error event type, error reason etc for further use. Refer to the image below for a list of outputs and descriptions of the parameters returned in this sub-type.

Document image

  1. DocumentProcessedError - This contains corresponding details of the document for which Document Processed flow action failed. It includes file and context of the document.
  2. SalesforceFileCopiedError - This contains corresponding details of the document for which Copy Salesforce File flow action failed. It includes following details.
    1. Destination - The resource of the destination to which file were supposed to be copied.
    2. ContentVersionId - Content version Id of the file that was supposed to be copied.
    3. Record Id - Record Id of the record to which file belongs.
  3. ErrorEventType - The specific nature of the error. It is the corresponding platform event of the flow action which is failed. (e.g., salesforce-file-copied, document-processed).
  4. ErrorReason - An error prompt which is a description of an error (e.g., "something went wrong").

Use Cases

Here are some practical use cases for leveraging the Error Event to handle errors in CloudFiles workflows:

  1. Track Failed AI Document Processing - Automatically detect when a document fails to process using AI and move it to a specific folder for manual review and reprocessing.
  2. Automate Failed File Handling - Set up flows to track files that failed to copy, triggering automatic retries or alerts to team members for immediate action.
  3. Custom Error Reporting - Create a flow that tracks all failed actions and generates a report on error types, resources, and associated records to streamline troubleshooting