Document Generated
The event is published when a document is generated by Generate Document flow action. The event type document-generated can be used to filter this event. The corresponding Get Event Details flow action returns the Document Generated sub-type with useful information including file resource, contentversionId, name and parentId.
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.
Please use document-generated as the type filter when selecting this event in the decision element in flow builder.
The corresponding Get Event Details flow action returns the Document Generated details with useful information including file resource, contentversionId, name and parentId for further use. Refer to the image below for a list of outputs:

- File - This field specifies the metadata details of the generated file.
- This parameter is populated only if the Destination input parameter was configured in the corresponding Generate Document action. If not, it will be null.
- Field Details:
- When saved in Salesforce and linked to a record:
- id: The generated file's Content Document ID.
- library: salesforce.
- Other fields will be null.
- When saved in external storage:
- Contains metadata details of the file stored in the external storage.
- ContentVersionId - This is the content version Id of the file that is generated.
- If no Destination parameter is specified in the corresponding Generate Document action, the file is stored in the Salesforce File Library.
- This field holds the Content Version ID of the generated file in Salesforce.
- Name - The name of the generated document.
- ParentId - Record Id on which the document is generated.