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, Process Document using AI action, Set Resource Property action, and the Document Mapper action. It is also raised when DocuSign signing fails for a generated document, regardless of which document-generation action produced it.

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 Events, you must first setup your flow as shown in the Intercepting CloudFiles Events article. This article will introduce you to the concepts of the event type 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.

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.

  1. DocumentProcessedError - This contains corresponding details of the document for which Process Document using AI 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 the following details-
    • Destination - The resource of the destination to which files were supposed to be copied.
    • ContentVersionId - Content version Id of the file that was supposed to be copied.
    • Record Id - Record Id of the record to which the file belongs.
  3. ResourceUpdateError - This contains corresponding details of the resource for which Set Resource Property flow action failed. It includes the following details-
    • Resource - The Resource file or folder that failed to update its metadata.
    • Payload - The JSON payload string showing which field you attempted to update and the value. (e.g., "{"name":"value"}").
  4. DocumentMapperRunError - This contains details of the file and context for which the Document Mapper operation failed. It includes information such as -
    • File Id - The (internal or external) file that was processed to extract information from during the mapping.
    • Config Id - The Document Mapper configuration that was used in the run.
    • Record Id - The Record Id if the document mapper was run in "update" mode.
  5. 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, resource-updated, Document Mapper Run, document-signed).
  6. ErrorReason - An error prompt which is a description of an error (e.g., "something went wrong").
  7. DatasetCreatedError - This contains the details od the resources, context for which the Create Dataset failed. It includes information such as -
    • Resource - The Resource file that failed to create the dataset.
    • Name - Name of the datset for which the action failed.
  8. DocumentSignedError - This contains details of a failure in the DocuSign document-signing process. It can be raised for any document sent for signature, regardless of which document-generation action produced it. One error event is raised per document. It includes the following details-
    • Stage - The point at which signing failed, one of GENERATION_INCOMPLETE, ENVELOPE_SEND_FAILED, DOCUSIGN_DISCONNECTED, DELIVERY_FAILED, DECLINED or VOIDED.
    • EnvelopeId - The DocuSign envelope Id.
    • GroupId - The envelope group Id, identifying documents sent together in a single combined envelope.
    • RecordId - The Record Id on which the document was generated.
    • TemplateId - The CloudFiles Template Id of the document being signed.
    • FileName - The name of the document involved in the failure.
    • Context - Additional context for the failure.

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