# Document Merged

This event is published when the Merge Documents (Async) flow action finishes merging files into one PDF.

> Kind: Event · Updated: Nov 25, 2026

## Overview

This event is published when the Merge Documents (Async) flow action, or its Apex form, finishes a merge. CloudFiles publishes one event for each merge that worked.

Merge Documents (Async) returns nothing to the flow that calls it, so this event is how you learn that a merge is done and where the merged PDF was saved. Handle it in a separate flow, for example one that tells the record owner the merged PDF is ready.

When several merges are sent together, for example by a record-triggered flow that ran for many records at once, their events are published together once every merge in that group has finished.

When a merge fails, CloudFiles publishes an Error Event for that merge instead, with ErrorEventType document-merged.

## How to use this Event?

To use CloudFiles Events, first set up your flow as shown in the Intercepting CloudFiles Events article. It introduces the event type and the event details returned by the Get Event Details flow action.

Once you are familiar with these, the sections below show how to read this event.

## Event Type For Decision Filter

Use document-merged as the type filter when you select this event in the Decision element in Flow Builder.

## Output Fields From Get Event Details

In the outputs of Get Event Details, this event's fields are under Document Merged. Refer to the image below for the list.

![The Document Merged outputs of Get Event Details in the Flow Builder resource picker](https://media.help.cloudfiles.io/evt-document-merged-sf/12d3b421.png)

- Context - The value given in the Context input of the Merge Documents (Async) action, for example the Id of the record that started the flow. Use it to tell which record or merge the event belongs to.
- File - The merged PDF, as a Resource. Its Id, Name and Library are filled in, and Drive Id too for a file in external storage. Name is the name the PDF was saved under, which can differ from the File Name given to the action when the destination already held a file with that name. Filled in only when the merge had a Destination.
- Destination - The record or folder that was given as the Destination, as a Resource. Filled in only when the merge had a Destination.
- ContentVersionId - The ContentVersion Id of the merged PDF in Salesforce Files. Filled in only when the merge had no Destination.

> **Note** — File is filled in when the merge had a Destination, and ContentVersionId when it did not. Check for an empty value before you use either one.
