# Document Locked

This event is published when the Lock Document flow action saves a password-protected copy of a PDF.

> Kind: Event · Updated: Nov 3, 2026

## Overview

This event is published when the Lock Document flow action saves a password-protected copy of a PDF. CloudFiles publishes one event for each PDF the action locked, after the action has finished.

The action already returns the locked copy in its own outputs. This event is useful when the next step runs in a separate flow, for example a flow that emails every locked copy to the client on the record.

When the action cannot lock a PDF, it publishes an Error Event for that PDF instead, with ErrorEventType document-locked.

## 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.

![A Decision element filtering CloudFiles Events on the document-locked type](https://media.help.cloudfiles.io/evt-document-locked-sf/01.png)

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

## Event Type For Decision Filter

Use document-locked 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 Locked. Refer to the image below for the list.

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

- Context - The value given in the Context input of the Lock Document action, for example the Id of the record that started the flow. Use it to tell which record or run the event belongs to.
- File - The locked copy, as a Resource. Its Id, Name and Library are filled in, and Drive Id too for a file in external storage. For a copy saved as a Salesforce File, Library is salesforce and Id is the ContentDocumentId of the copy.
- WasProtected - True when the source PDF already had a password or restrictions before it was locked. That old protection does not carry over to the copy.

> **Note** — The event never carries the passwords given to the action.
