Перейти к основному содержимому

Безопасный Word Документ в n8n

Безопасный Word Документ является PDF4me действие узла в n8n который блокирует .docx Файл с паролем, ограничением на редактирование или и тем и другим. Используйте его для защиты конфиденциальных отчетов перед отправкой, предотвращения изменения подписанного шаблона или для того, чтобы рецензенты могли комментировать контракт, не изменяя его текст.

Что делает этот узел?

PDF4me Word: Безопасный Word Документ применяется два независимых вида защиты. Безопасно при открытии плюс Открыть пароль Определяет, откроется ли файл вообще. Тип защиты плюс Пароль защиты Определяет, что можно изменять после открытия файла: от полностью режима только для чтения до комментариев, полей форм или только отслеживаемых изменений. Используйте любой из этих режимов или оба одновременно.

Похожие записи в блоге
Пока нет публикации в блоге, посвященной этой функции — она скоро появится.
А пока что, загляните в блог PDF4me, где вы найдете обучающие материалы и рабочие процессы для всех платформ.
Посетите блог →

Аутентификация вашего API Запрос​

Каждый PDF4me узел в n8n требуется действительный Учетные данные для подключения кСоздайте или выберите тот, который содержит ваши данные. PDF4me API ключевой элемент, позволяющий рабочему процессу аутентифицировать запросы на обеспечение безопасности документов.

Важные факты, которые нельзя пропустить​

Два пароля, две разные работы
Пароль «Открыть» блокирует доступ к файлу. Пароль «Защита» блокирует редактирование. Установка одинакового значения для обоих параметров дает редактору доступ к обоим, что сводит на нет смысл ограничения.
Никогда не вводите пароль в узел.
Все введенные данные попадают непосредственно в сохраненный рабочий процесс. JSONЭтот код экспортируется и часто добавляется в Git. Используйте выражение, считывающее учетные данные или переменную окружения.
Защита применена, восстановить невозможно.
Это действие обеспечивает дополнительную защиту. В случае утери паролей путь к восстановлению через этот узел будет невозможен, поэтому сохраните оба значения перед запуском рабочего процесса в масштабе предприятия.
В узле PDF4me Word в n8n установлены следующие параметры: Операция — Защищенный документ Word, Метод ввода файла Word — Из предыдущего узла, Функция «Защита при открытии» включена, Тип защиты — Только для чтения, Имя выходного файла — secured_document.docx

Функция «Защита при открытии» переключается, а тип защиты — это отдельный выпадающий список, в котором здесь установлено значение «Только для чтения». Два поля для ввода пароля, расположенные ниже, независимы друг от друга.

Открытие пароля против ограничения редактирования​

ВопросОткройте парольОграничение на редактирование
Which fields set itSecure On Open and Open PasswordProtection Type and Protection Password
What it blocksOpening the document at allChanging the document once open
Can the recipient read itOnly with the passwordYes, reading is always allowed
Typical recipientA named person receiving something confidentialA reviewer or a form filler
Use it whenThe content must not be seen by othersThe content may be seen but not altered

Какие параметры обеспечивает безопасность? Word Необходимые документы?​

ПараметрНеобходимыйЧто это делаетПример
Credential to connect withRequiredThe PDF4me account credential the node authenticates with.PDF4ME account
OperationRequiredThe action this node performs. Select Secure Word Document.Secure Word Document
Word File Input MethodRequiredHow the .docx reaches the node: from the previous node as binary data, as a Base64 string, or from a URL.From Previous Node (Binary Data)
Binary Data Property NameConditionalName of the binary property holding the document. Appears when the file comes from the previous node.data
Document NameRequiredFilename of the input document including the extension. Drives format detection.document.docx
Secure On OpenOptionalToggle that requires a password before the document will open. Leave off if you only want an editing restriction.enabled
Open PasswordConditionalThe password needed to open the file. Required once Secure On Open is enabled. Supply it through an expression, not as literal text.{{ $env.DOC_OPEN_PW }}
Protection TypeOptionalEditing restriction applied to the document: Read Only, Allow Comments, Allow Form Fields, or Allow Revisions.Read Only
Protection PasswordConditionalThe password that lifts the editing restriction. Required once a Protection Type is chosen, and should differ from Open Password.{{ $env.DOC_EDIT_PW }}
Output File NameOptionalFilename of the returned secured document. Keep the .docx extension.secured_document.docx
Output Binary Data NameOptionalBinary property the secured document is written to. Leave as data unless a later node expects another name.data

Варианты типа защиты​

ВариантЧто может сделать получатель
Read OnlyView the document only. No edits of any kind are accepted.
Allow CommentsAdd and edit comments, but not change the document text itself.
Allow Form FieldsFill in form fields while the surrounding content stays locked.
Allow RevisionsEdit, but only with tracked changes recorded so every alteration is visible.

Выход​

ПолеТипЧто в нём содержится
fileNameStringName of the returned secured document.
fileSizeNumberSize of the secured document in bytes.
successBooleanWhether protection was applied. Branch on this so failures surface as alerts.
originalFileNameStringName of the input document as supplied in Document Name.
secureOnOpenBooleanWhether an open password was applied, echoed back for verification.
protectionTypeStringThe editing restriction applied, such as ReadOnly, or empty when none was set.
messageStringHuman-readable status text describing the result of the operation.

Проверка protectionType В ответе содержится самый дешевый способ подтвердить, что именно то ограничение, которое вы хотели установить, и было применено.

Как настроить безопасность? Word Документ в n8n?​

  1. Добавить PDF4me Word добавьте узел к вашему рабочему процессу и установите Операция к Безопасный Word Документ.
  2. Выберите свой PDF4me учетные данные или создайте их и вставьте свои. API ключ.
  3. Выберите Word Метод ввода файла и поставлять .docx через поле под ним.
  4. Набор Название документа с правильным расширением.
  5. Для открытия ворот включите Безопасно при открытии и установить Открыть пароль из учетных данных или переменной среды.
  6. Для редактирования шлюза установите Тип защиты и предоставить другой Пароль защиты.
  7. Набор Имя выходного файла заканчивающийся в .docx.
  8. Запустите узел, подтвердите. secureOnOpen и protectionType В ответном сообщении перенаправьте защищенный файл дальше.

Типичные конфигурации​

Примеры рабочих процессовCommon n8n workflow patterns using Secure Word Document.
Отправить конфиденциальный отчет
  1. На этапе составления отчета создается документ, содержащий конфиденциальные данные.
  2. Функция Secure On Open применяет пароль, хранящийся в переменной среды.
  3. Файл отправляется по электронной почте, а пароль передается по отдельному каналу связи.
Распространить договор для комментариев.
  1. Для параметра «Тип защиты» установлено значение «Разрешить комментарии».
  2. Рецензенты вносят пометки, не изменяя текст ни одного пункта.
  3. Обратная связь поступает без последующего согласования изменений.
Распространите заполняемую форму.
  1. Функция «Разрешить поля формы» сохраняет окружающий текст неизменным.
  2. Получатели заполняют только те поля, которые для них предназначены.
  3. Возвращаемые формы достаточно согласованы для автоматического анализа.
Заблокируйте утвержденный шаблон
  1. Шаблон утверждается и публикуется на общем диске.
  2. Защита «Только для чтения» предотвращает скрытое локальное редактирование.
  3. Все работают, опираясь на одну и ту же авторитетную формулировку.

Практические советы​

Keep passwords out of the workflow
An expression reading a credential or environment variable keeps the secret out of exported workflow JSON and out of version control.
Use different values for the two passwords
Reusing one value means anyone who can open the file can also unlock editing, which removes the distinction you set up.
Pick the least restrictive type that works
Allow Comments or Allow Revisions often serves a review better than Read Only, because reviewers can still express changes.
Verify protectionType in the response
The echoed value confirms the restriction landed as intended, which is faster than opening a sample in Word every run.
Secure last in the chain
Watermarking, merging, and header updates all need an editable file. Apply protection after those steps, not before.
Record the passwords before scaling up
This action applies protection and offers no recovery. Store both values in your secret manager before running it across a batch.

Шпаргалка​

ПолеЦенить
OperationSecure Word Document
Word File Input MethodFrom Previous Node (Binary Data)
Binary Data Property Namedata
Document Namedocument.docx
Secure On Openenabled
Open Password{{ $env.DOC_OPEN_PW }}
Protection TypeRead Only
Protection Password{{ $env.DOC_EDIT_PW }}
Output File Namesecured_document.docx
Output Binary Data Namedata

Часто задаваемые вопросы​

What is the difference between the open password and the protection password?+
The open password gates the file itself: without it the document will not open at all. The protection password gates editing: the document opens for anyone but stays restricted until that second password is entered. They are separate fields and should hold different values, because a recipient who needs to read but not edit should only ever receive the first one.
What do the Protection Type options do?+
Read Only stops edits entirely. Allow Comments permits commenting but no text changes. Allow Form Fields permits filling fields while the rest stays locked. Allow Revisions permits editing only with tracked changes recorded. Microsoft describes the equivalent desktop behaviour under restricting changes in Word.
Where should I store the passwords in n8n?+
Not in the node. A password typed directly into either field is saved inside the workflow JSON, which gets exported, shared, and often committed to version control. Reference an n8n credential or an environment variable through an expression so the secret stays out of the workflow definition.
Can I apply both an open password and an editing restriction at once?+
Yes. Secure On Open and Protection Type are independent, so a document can require a password to open and still be read-only afterwards. That combination suits a confidential document a named recipient may read but nobody may alter.
How do I remove the protection later?+
Editing restrictions are lifted in Word by supplying the protection password, and the open password is entered when the file is opened. Keep both values in your secret store rather than relying on memory, because this action applies protection and there is no recovery path through it if the passwords are lost.

Связанные действия​

Безопасный Excel
Та же самая идея защиты применяется и к электронным таблицам, поступающим в рамках одного рабочего процесса.
Защитить документ
Примените защиту паролем к PDF а не Word файл.
Добавить водяной знак на изображение Word Документ
Перед тем как заблокировать документ, пометьте его каким-либо знаком или символом.
Отключить отслеживание изменений в Word
Отключите запись правок — это другой параметр, отличный от ограничения «Разрешить правки».

Аналогичная задача на других платформах.​

Получить помощь​