メインコンテンツへスキップ

ドキュメントを生成する(複数) n8n

複数のドキュメントを生成する これはn8nのPDF4meノードアクションで、ノード内では「Generate Documents (Multiple)」と表示されます。単一のテンプレートとレコードの配列から、一度に複数の完成ファイルを生成します。請求書、顧客向けレター、地域別レポートなどのバッチ処理に使用でき、各ドキュメントは個別のn8nアイテムとして返されます。

このノードの機能

PDF4me: 文書を生成する(複数) 1つのテンプレートとレコードのリストを受け取り、1つのツールで多数の完成文書を生成します。 n8n 実行します。 言葉、 HTML、 または PDF テンプレート バイナリデータを介して、 Base64、 HTML コード、または URL プラス 大量のデータとして JSON または XML (レコードの配列または繰り返し) XML生成された各ファイルは個別の出力項目として返されるため、ループ、保存、メール送信、または個別にアップロードできます。このノードを代わりに使用してください。 ドキュメント生成(単一) 顧客リスト、請求書リスト、またはレコードリストがあり、1回の実行で各行ごとに完成したドキュメントを1つ作成したい場合。

関連ブログ記事
この機能に関するブログ記事はまだありません。近日公開予定です。
その間、PDF4me ブログを閲覧して、あらゆるプラットフォームのチュートリアルやワークフローをご覧ください。
ブログをご覧ください →

認証 API リクエスト​

毎 PDF4me ノード n8n 有効な 接続するための認証情報. 作成または選択して、 PDF4me API ワークフローがバッチ文書生成リクエストを安全に認証できるようにするためのキー。

見逃してはならない重要な事実​

1つ n8n 生成されたドキュメントあたりの項目
通常、正常に実行されると、生成されたファイルごとに 1 つのアイテムが返されます。各アイテムには、バイナリ データ出力名の下にバイナリ ファイルが含まれています。 JSON documentIndexとtotalDocumentsを含むメタデータにより、各ファイルを個別にループ処理、保存、またはメール送信できます。
配列を渡します(JSON) または繰り返し XML だから API レンダリングするファイルの数を把握している
のために JSON生成されたドキュメントごとにオブジェクトの配列を使用します。 XMLテンプレートが想定する繰り返しレコード構造(差し込み印刷スタイル)を使用してください。単一のオブジェクトでは1つのドキュメントしか生成されないため、この操作の目的が損なわれます。
CSVメールマージやGoogleドキュメントはここでは利用できません
テンプレート ファイル タイプは Word のみを提供します。 HTML、 PDFドキュメントデータ型は、 JSON または XML必要な場合は CSV 入力またはメールマージ/Googleドキュメントのテンプレートを使用する場合は、代わりに「ドキュメントの生成(単一)」を使用してください。
ドキュメントの生成 (複数) n8n ノードは、Pdf4me に接続するための認証情報、リソースの生成、生成操作のドキュメントの生成 (複数)、テンプレート ファイルタイプ Word、出力タイプ PDF、テンプレート ファイル入力タイプ バイナリ データ、テンプレート バイナリ プロパティ data、テンプレート ファイル名 template.docx、ドキュメント データタイプ JSON、ドキュメント データ入力タイプ テキスト、サンプル ドキュメント データ テキスト、出力ファイル名 generated_document、PDF 編集可能の保持切り替え、バイナリ データ出力名 data を示しています。

フルノードパネル。Wordテンプレート+ JSON テキストデータ + PDF 出力は典型的なメールマージの設定です

ドキュメント生成(複数) vs ドキュメント生成(単一)​

このタスクで最もよくある間違いは、2つのうちどちらかを間違えることです。どちらを選ぶかは、返ってくるファイルの数と、提供されるテンプレートやデータ形式によって決まります。

側面文書を生成する(複数)ドキュメント生成(単一)
Files returnedMany, one n8n item per generated documentExactly one
Template typesWord, HTML, PDFWord, HTML, PDF, plus Mail Merge and Google Docs
Data formatsJSON or XML onlyJSON, XML, and CSV
Output typesPDF, Word, or Excel (HTML templates output HTML)PDF, Word (no Excel option)
Reach for it whenYou have a list of records and want one document per rowYou have a single record, CSV data, or a Mail Merge template

ドキュメント生成(複数)に必要なパラメータは何ですか?​

必須 n8n UI: 接続に使用する認証情報、テンプレートファイルタイプ、テンプレートファイル入力タイプ、ドキュメントデータタイプ、ドキュメントデータ入力タイプ、および出力タイプ(常に表示されます。選択肢はテンプレートファイルタイプによって異なります)。条件付き必須フィールド(テンプレートバイナリプロパティ、テンプレート Base64 コンテンツ、 HTML コード、テンプレートファイル URL(ドキュメントデータテキスト、ドキュメントバイナリプロパティなど)は、親の入力タイプが選択されている場合にのみ表示されます。出力ファイル名、保持 PDF 編集可能かどうか、およびバイナリデータ出力名はオプションであり、適切なデフォルト値が設定されています。

パラメータ必須その機能例
Template File TypeRequiredSelect the Template file type. Options: Word, HTML, PDF. Default is `Word`.Word
Output TypeConditionalFormat of the generated documents. Shown when Template File Type is Word. Options: PDF, Word, Excel. Default is `PDF`.PDF
Output File NameConditionalName for the generated files, without extension (the Output Type extension is added). When several documents are generated, `_1`, `_2` and so on is appended (for example `document_1.pdf`). If empty, the names returned by PDF4me are used, or `generated_document`. Shown when Output Type is PDF._1
Keep PDF EditableConditionalWhether to keep the generated PDF form fields editable. Shown when Output Type is PDF. Default is `No`.No
Output File NameConditionalName for the generated files, without extension (the Output Type extension is added). When several documents are generated, `_1`, `_2` and so on is appended (for example `document_1.pdf`). If empty, the names returned by PDF4me are used, or `generated_document`. Shown when Output Type is Word._1
Output File NameConditionalName for the generated files, without extension (the Output Type extension is added). When several documents are generated, `_1`, `_2` and so on is appended (for example `document_1.pdf`). If empty, the names returned by PDF4me are used, or `generated_document`. Shown when Output Type is Excel._1
Output TypeConditionalFormat of the generated documents. Shown when Template File Type is HTML. Options: HTML. Default is `HTML`.HTML
Output File NameConditionalName for the generated files, without extension (the Output Type extension is added). When several documents are generated, `_1`, `_2` and so on is appended (for example `document_1.pdf`). If empty, the names returned by PDF4me are used, or `generated_document`. Shown when Output Type is HTML._1
Output TypeConditionalFormat of the generated documents. Shown when Template File Type is PDF. Options: PDF, Word, Excel. Default is `PDF`.PDF
Output File NameConditionalName for the generated files, without extension (the Output Type extension is added). When several documents are generated, `_1`, `_2` and so on is appended (for example `document_1.pdf`). If empty, the names returned by PDF4me are used, or `generated_document`. Shown when Output Type is PDF._1
Keep PDF EditableConditionalWhether to keep the generated PDF form fields editable. Shown when Output Type is PDF. Default is `No`.No
Output File NameConditionalName for the generated files, without extension (the Output Type extension is added). When several documents are generated, `_1`, `_2` and so on is appended (for example `document_1.pdf`). If empty, the names returned by PDF4me are used, or `generated_document`. Shown when Output Type is Word._1
Output File NameConditionalName for the generated files, without extension (the Output Type extension is added). When several documents are generated, `_1`, `_2` and so on is appended (for example `document_1.pdf`). If empty, the names returned by PDF4me are used, or `generated_document`. Shown when Output Type is Excel._1
Template File Input TypeRequiredHow to provide the template file. Options: Binary Data, Base64 String, HTML Code, URL. Default is `Binary Data`.Binary Data
Template Binary PropertyConditionalName of the binary property containing the template file. Shown when Template File Input Type is Binary Data. Default is `data`.data
Template File NameConditionalName of the template file (including extension). If empty, the file name of the binary data is used. Shown when Template File Input Type is Binary Data.template.docx
Template File NameConditionalName of the template file (including extension). If empty, the file name of the binary data is used. Shown when Template File Input Type is Binary Data.template.docx
Template File NameConditionalName of the template file (including extension). If empty, the file name of the binary data is used. Shown when Template File Input Type is Binary Data.template.docx
Template Base64 ContentConditionalBase64 encoded template file content. Shown when Template File Input Type is Base64 String.UEsDBBQAAAAI...
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is Base64 String.template.docx
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is Base64 String.template.docx
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is Base64 String.template.docx
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is HTML Code.template.docx
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is HTML Code.template.docx
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is HTML Code.template.docx
HTML CodeConditionalWrite your HTML template code here. It will be automatically converted to base64. Shown when Template File Input Type is HTML Code.<h1>{{title}}</h1>
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is URL.template.docx
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is URL.template.docx
Template File NameConditionalName of the template file (including extension). Shown when Template File Input Type is URL.template.docx
Template File URLConditionalURL of the template file. Shown when Template File Input Type is URL.https://example.com/template.docx
Template File URLConditionalURL of the template file. Shown when Template File Input Type is URL.https://example.com/template.docx
Template File URLConditionalURL of the template file. Shown when Template File Input Type is URL.https://example.com/template.docx
Document Data TypeRequiredThe data type for the template. Options: JSON, XML. Default is `JSON`.JSON
Document Data Input TypeRequiredHow to provide the document data. Options: Text, Binary Data, Base64 String, URL. Default is `Text`.Text
Document Data TextConditionalJSON or XML data to fill the template with, matching Document Data Type. Shown when Document Data Input Type is Text.[{"name":"Alice"},{"name":"Bob"}]
Document Data TextConditionalJSON or XML data to fill the template with, matching Document Data Type. Shown when Document Data Input Type is Text.[{"name":"Alice"},{"name":"Bob"}]
Document Binary PropertyConditionalName of the binary property containing the data file. Shown when Document Data Input Type is Binary Data. Default is `data`.data
Document Data File NameConditionalName of the data file (including extension), used when the file is uploaded to PDF4me. If empty, the file name of the binary data is used. Shown when Document Data Input Type is Binary Data.customers.json
Document Data File NameConditionalName of the data file (including extension), used when the file is uploaded to PDF4me. If empty, the file name of the binary data is used. Shown when Document Data Input Type is Binary Data.customers.json
Document Base64 ContentConditionalBase64 encoded data file content. Shown when Document Data Input Type is Base64 String.W3sibmFtZSI6...
Document Data File NameConditionalName of the data file (including extension). Not used: the node does not send this value to PDF4me. Shown when Document Data Input Type is Base64 String.customers.json
Document Data File NameConditionalName of the data file (including extension). Not used: the node does not send this value to PDF4me. Shown when Document Data Input Type is Base64 String.customers.json
Document Data File NameConditionalName of the data file (including extension). Not used: the node does not send this value to PDF4me. Shown when Document Data Input Type is URL.customers.json
Document Data File NameConditionalName of the data file (including extension). Not used: the node does not send this value to PDF4me. Shown when Document Data Input Type is URL.customers.json
Document Data File URLConditionalURL of the data file. Shown when Document Data Input Type is URL.https://example.com/customers.json
Document Data File URLConditionalURL of the data file. Shown when Document Data Input Type is URL.https://example.com/customers.json
Binary Data Output NameOptionalCustom name for the binary data in n8n output. Default is `data`.data

テンプレートファイルタイプのオプション​

テンプレートの形式を選択してください。この選択によって出力タイプの選択肢が変わります。

n8n PDF4meの「ドキュメントの生成(複数)」ノードにあるテンプレートファイルタイプのドロップダウンリストには、Word(強調表示)、HTML、PDFの3つのオプションが表示されます。

テンプレートファイルタイプのドロップダウン。Word、 HTML、 または PDF (ここではメールマージやGoogleドキュメントは使用しません)

言葉デフォルト: .docx テンプレート
標準 PDF4me 口ひげのプレースホルダー付きワードテンプレート。出力タイプは PDFWord、Excelなど。一括請求書、顧客向けレター、個別レポート作成に最もよく使われるツールです。
HTMLHTML テンプレートを貼り付けました HTML コード
レンダリング HTML 口ひげのプレースホルダー付きテンプレート。出力タイプは HTML のみ。テンプレートファイル入力タイプと組み合わせてください。 HTML 生のコードを貼り付ける HTML インライン、またはバイナリデータを使用する / URL ホストされている.htmlファイルの場合。
PDFPDF テンプレート
既存の PDF テンプレートとして。出力タイプは PDFWord、またはExcel。 PDF 出力、保持を有効にする PDF 生成されたすべてのファイルでフィールドを編集可能にする場合は、編集可能です。

テンプレートファイル入力タイプのオプション​

テンプレートをノードに挿入する方法を選択してください。この選択によって、後続のフィールドが変更されます。

n8n PDF4meの「ドキュメント生成(複数)」ノードにあるテンプレートファイル入力タイプのドロップダウンには、次の4つのオプションが表示されます。バイナリデータ(説明付きで強調表示)、Base64文字列(説明付きで表示)、HTMLコード(説明付きで表示)、生のHTMLコードを手動で記述(HTMLテンプレートタイプでのみ利用可能)、URL(説明付きで表示)テンプレートファイルへのURLを指定

テンプレートファイル入力タイプ。バイナリデータ、 Base64 弦、 HTML コード、または URL

バイナリデータデフォルト: 前のノードからのファイル
Google Drive Download などの前のノードからテンプレートを直接読み取ります。 HTTP リクエスト、またはバイナリファイルの読み込み。設定 テンプレートバイナリプロパティ バイナリフィールド名(デフォルト) データ) テンプレートファイル名 オプションであり、指定された場合はアップロードされたファイル名が使用されます。
Base64文字列Base64-エンコードされたテンプレート
base64文字列を貼り付けるかマッピングして テンプレートのBase64コンテンツ。 テンプレートファイル名 拡張子がテンプレートファイルの種類(.docx、.html、.pdf)と一致するように、この設定が必要です。
HTMLコードペースト生 HTML 列をなして (HTML のみ)
テンプレート ファイル タイプが HTML全部または一部を貼り付ける HTML プレースホルダー付き {{タイトル}}、 {{コンテンツ}} の中へ HTMLコードノードはそれを基本的な <html> 欠落している場合はシェルを装備してください。 テンプレートファイル名 必須です (例: テンプレート.html)
URL公開リンクからダウンロード
提供する HTTPS URL で テンプレートファイルのURL。 PDF4me テンプレートを直接取得します。 URL オープン(認証なし)で テンプレートファイル名 拡張子がテンプレートタイプと一致するように、これは必須です。

ドキュメントデータタイプのオプション​

送信するデータ形式を選択してください。

n8n PDF4meの「ドキュメントデータタイプ」ドロップダウンリストで、JSONがハイライト表示され、XMLが2つのオプションとして表示されています。ツールチップには「パラメーター documentDataType」と表示されます。

文書データ型。 JSON または XML (いいえ CSV この作戦において)

JSONデフォルト:レコードの配列(最も一般的)
使用する JSON 各オブジェクトが生成されたドキュメントである配列、例: [{"name":"Alice"}, {"name":"Bob"}]ノードはペイロードの解析結果を検証します。単一のオブジェクトは1つのドキュメントを生成します。複数のドキュメントが必要な場合は配列を渡してください。
XML繰り返しレコード XML
使用する XML テンプレートが繰り返し行 (メールマージ形式) に期待する構造。ノードは詳細な検証を実行しません。 XML テンプレートのバインドポイントと一致します。

ドキュメントデータ入力タイプのオプション​

バルクデータがノードに入力される方法を選択してください。

n8n PDF4meの「ドキュメントデータ入力タイプ」ドロップダウンには、次の4つのオプションが表示されます。テキスト(説明付き):JSONまたはXMLデータを手動で入力、バイナリデータ(説明付き):前のノードのデータファイルを使用、Base64文字列(説明付き):Base64エンコードされたデータファイルを指定、URL(説明付き):データファイルへのURLを指定

ドキュメントデータ入力タイプ。テキスト、バイナリデータ、 Base64 文字列、または URL

文章デフォルト: 大量のデータをインラインで貼り付ける
完全なタイプまたは式マップ JSON 配列または XML の中へ 文書データテキストこのフィールドは、テキストを選択した場合の複数操作において必須です(単一の場合よりも厳格です)。
バイナリデータ前のノードのデータファイルを使用する
セット 文書バイナリプロパティ バイナリフィールド名(デフォルト) データテンプレートとデータバイナリのプロパティ名が同じアイテムから取得されている場合、両者が衝突しないように注意してください。
Base64文字列Base64エンコードされたデータファイル
すべてを提供する .json または .xml ファイルをbase64として ドキュメントのBase64コンテンツ。 ドキュメントデータファイル名 が必要です。
URL公開リンクからダウンロード
セット ドキュメントデータファイルのURL 公衆に HTTPS URL の JSON または XML データファイル。 ドキュメントデータファイル名 拡張子がデータ型と一致するように、これは必須です。

出力フィールド​

成功したランは1 n8n 生成されたドキュメントごとに1つのアイテム。各アイテムには、 JSON メタデータとバイナリファイル。

出力​

ノードが返すフィールド。

分野タイプ内容物
fileNameStringFile name of the resulting file.
mimeTypeStringMIME type of the resulting file, for example `application/pdf`.
fileSizeNumberSize of the resulting file in bytes.
successBooleanTrue when the operation succeeded.
documentIndexStringPosition of this document among the generated documents, starting at 1.
totalDocumentsNumberNumber of documents in PDF4me's response.
dataBinaryOne generated document per output item, in the chosen Output Type. If PDF4me returns a single file instead of a list, it is stored in the property `data` whatever Binary Data Output Name says.

n8nで複数のドキュメントを生成する設定方法を教えてください。​

  1. 追加 PDF4me あなたの n8n ワークフローを設定します。 リソース に 生成する そして 操作の生成 に 文書を生成する(複数)。
  2. で 接続するための認証情報選択してください PDF4me 認証情報またはクリック 新しい認証情報を作成する そしてあなたの API 鍵。
  3. セット テンプレートファイルの種類 に 言葉 (デフォルト)、 HTML、 または PDF。
  4. セット 出力タイプ。 PDFWord、またはExcel for Word / PDF テンプレート; HTML のみ HTML テンプレート。
  5. セット テンプレートファイル入力タイプ に バイナリデータ (デフォルト)、 Base64 弦、 HTML コード (HTML のみ)、または URL そして、一致するテンプレートフィールドに加えて テンプレートファイル名 必要に応じて。
  6. セット 文書データタイプ に JSON (デフォルト)または XML。
  7. セット ドキュメントデータ入力タイプ に 文章 (デフォルト)そしてあなたの JSON 配列を 文書データテキストまたはバイナリデータを選択します。 Base64 文字列、または URL データファイルを提供してください。
  8. セット 出力ファイル名 読みやすいものに invoice ファイルは次のように返されます invoice_1.pdf、 invoice_2.pdf、...
  9. 出力する場合 PDF テンプレートにフォーム フィールドがある場合は、 保つ PDF 編集可能。
  10. 離れる バイナリデータ出力名 として data 下流ノードで別のプロパティ名が必要な場合を除きます。ノードを実行し、複数の出力項目を「バッチ分割」、「バイナリファイル書き込み」、「メール送信」、または「クラウドストレージアップロード」にルーティングします。

典型的な構成​

ワークフローの例Common n8n workflow patterns using Generate Documents (Multiple).
JSON配列からのメールマージ。顧客への手紙
  1. Google Sheetsノードは、顧客の名前、住所、残高を含む顧客リストをワークフローに取り込みます。
  2. コードまたはセットノードは行をパッケージ化します JSON オブジェクトの配列(顧客ごとに1つのオブジェクト)。
  3. PDF4me テンプレートファイルタイプ Word、出力タイプでドキュメント生成(複数)を実行します PDFテンプレートファイル入力タイプはバイナリデータ、ドキュメントデータ入力タイプはテキストです。出力ファイル名は 顧客への手紙。
  4. このノードは、顧客ごとに 1 つのアイテムを返します。 customer_letter_1.pdf、 customer_letter_2.pdf、 等々。
  5. ループオーバーアイテムノードは各アイテムを送信します PDF 該当する顧客にGmail経由で送信するか、Googleドライブにアップロードします。
テンプレートとデータは両方ともファイルとして n8n
  1. 一方のノードが.docxテンプレートをダウンロードし、もう一方のノードが.json形式の顧客ファイルをダウンロードします。マージノードがこれらを結合し、両方のバイナリファイルを1つのアイテムに格納します。
  2. PDF4me ドキュメント生成(複数)は、テンプレートファイル入力タイプバイナリデータ(テンプレートバイナリプロパティ テンプレートフィールド名に設定)およびドキュメントデータ入力タイプバイナリデータ(文書バイナリプロパティ データフィールド名に設定します。
  3. セット ドキュメントデータファイル名 データファイルに名前が付けられていない場合 data.json。
  4. 生成されたファイルは個別のアイテムとして返され、 SharePoint 顧客IDにちなんで名付けられたドキュメントライブラリ。
ホスト型テンプレート + ホスト型データ。請求書バッチ
  1. 毎晩実行されるスケジュールトリガーによって、請求書バッチ処理が実行されます。
  2. PDF4me 「ドキュメント生成(複数)」は「テンプレートファイル入力タイプ」に設定されています。 URL (テンプレートファイルのURL S3 上の .docx 請求書テンプレートとドキュメント データ入力タイプを指します URL (ドキュメントデータファイルのURL 生成されたものを指す billing-cycle.json ファイル)。
  3. テンプレートファイル名 は invoice.docx そして ドキュメントデータファイル名 は billing-cycle.json。
  4. 出力タイプは PDF出力ファイル名は 請求書、そしてキープ PDF 編集可能はオフになっています。
  5. 返品された商品はすべて、Dropbox内の顧客フォルダにアップロードされ、Outlook経由でメールで送信されます。
貼り付けたコードからのHTMLバッチ → パーソナライズされたランディングページ
  1. Webhookトリガーは、マーケティングキャンペーンが開始されたときに作動します。
  2. PDF4me 「ドキュメントの生成(複数)」はテンプレートファイルタイプで設定されています。 HTML テンプレートファイル入力タイプ HTML コード。 HTML ヒゲのプレースホルダーが付いたノードに直接貼り付けられます。
  3. ドキュメントデータ型は JSONドキュメント データ入力タイプはテキストで、式はキャンペーンのリード リストを JSON 配列。
  4. 出力タイプは HTMLノードは1つを返します HTML リードごとにファイルを作成。
  5. Write Binary Fileノードは、生成された各バイナリファイルを保存します。 HTML パブリックウェブフォルダにリンクを送信し、別のノードが各リードにパーソナライズされたリンクを送信します。
WordテンプレートからのExcel出力。バッチレポート
  1. 日次スケジュールトリガーは、PostgreSQLからKPIの数値を取得します。
  2. Setノードは行を領域ごとにグループ化します。 JSON 配列、地域ごとに1レコード。
  3. PDF4me テンプレートファイルタイプ Word、出力タイプ Excel、ドキュメントデータタイプを指定してドキュメントを生成する (複数) JSONドキュメントデータ入力タイプはテキストです。出力ファイル名は 地域レポート。
  4. このノードは、名前の付いた領域ごとに 1 つの .xlsx ファイルを返します。 region_report_1.xlsx、 region_report_2.xlsx、 等々。
  5. Microsoft OneDriveノードは、各ファイルを分析チーム用の対応するリージョンフォルダにアップロードします。

実践的なヒント​

Shape your data as rows
One record per output document. Single objects yield one file. defeats the purpose of this operation.
Use Generate Document (Single) for CSV / Mail Merge / Google Docs
Generate Documents (Multiple) only accepts JSON or XML data and Word / HTML / PDF templates.
"No binary data found" errors
Double-check Template Binary Property and Document Binary Property names. The Merge node from a fan-in workflow can rename binary properties.
Document Data Text is strictly required
On the Multiple operation, leaving the Text field empty rejects the node, stricter than Single.
Name outputs with a meaningful prefix
Use Output File Name like <code>invoice</code> or <code>customer_letter</code> so files are easy to scan in storage (avoid the generic <code>generated_document_*</code> default).
Plan for multiple items downstream
Use Split In Batches, Loop Over Items, or any node that handles many items. not just the first one.

チートシート​

分野価値
ResourceGenerate
OperationGenerate Documents (Multiple)
Template File TypeWord
Output TypePDF
Template File Input TypeBinary Data
Template Binary Propertydata
Document Data TypeJSON
Document Data Input TypeText
Document Data Text(bulk JSON array with multiple records)
Output File Namemy_document (optional, becomes prefix)
Binary Data Output Namedata
CredentialsPDF4me API credential

よくある質問​

How is Generate Documents (Multiple) different from Generate Document (Single)?+
Multiple renders many documents per run, one n8n item per generated document. Single produces exactly one file. Multiple supports fewer template types (Word, HTML, PDF only, no Mail Merge or Google Docs), only JSON or XML data (no CSV), and adds Excel as an output option for Word and PDF templates. Use Single for one-off documents, CSV data, Mail Merge, Google Docs, or PDF form templates.
What shape should my JSON data have?+
A JSON array where each object becomes one generated document, e.g. [{"name":"Alice","email":"[email protected]"},{"name":"Bob","email":"[email protected]"}] generates two files. The node validates that the payload parses; the API drives how many documents are produced based on the records you pass.
What does Output File Name do when many documents come back?+
It becomes a prefix. Setting Output File Name to invoice with Output Type PDF produces invoice_1.pdf, invoice_2.pdf, ... If you leave it empty, filenames come from the API or default to generated_document_1, generated_document_2, ...
Can I use CSV data with Generate Documents (Multiple)?+
No. Document Data Type only offers JSON and XML on this operation. Use Generate Document (Single) for CSV input or any other workflow that needs CSV.
How do I handle the multiple output items in n8n downstream?+
Each generated document is its own n8n item with the binary file under Binary Data Output Name (default data) and metadata fields like documentIndex and totalDocuments. Wire the node into Split In Batches, Loop Over Items, Write Binary File, or any cloud-storage / email node. they iterate over all items automatically.
Can I keep generated PDFs editable?+
Yes. Enable Keep PDF Editable when Output Type is PDF. Every generated PDF in the batch keeps its AcroForm field definitions. With Keep PDF Editable off, the form is flattened to static text on each file.
What happens if the API returns a single file instead of a list?+
You will get one n8n item only. Downstream nodes that already handle multiple items behave correctly for the single-item case. Always design the rest of the flow to handle 1..N items, not exactly N.
My data file is not named data.json. does it matter?+
When using Binary Data input, set Document Data File Name explicitly so the API treats the payload with the correct extension. Same applies to the template: use Template File Name when the binary does not carry a recognisable filename.

関連アクション​

他のプラットフォームでの同じタスク​

ヘルプが必要な場合​