Unsure about which data to send to PDF Node

Hey Everyone

For the past couple of days, I’ve been stuck on this workflow. My aim is to send spreadsheet data to the pdf node so it can create a customized Quote.

However, Whenever I’ve attempted to create a quote using the spreadsheet data, the template has turned up blank. I’ve already asked about this topic yesterday: Can't create PDF Template to send to workflow - #2 by kjooleng

One solution was to map variables from my template to the JSON i.e. {“customer.name” {{ $(“Edit Fields”).item.json[“What’s your name?”] }}. I attempted that, but still got a blank template

Another solution offered was to change the Data section in the pdf generator node to this:

{
“quote_content”: “{{ $json.output }}”
}

Along with updating the pdf template to include this variable. I’ve tried this method, along with adding “quote_content” to individual JSON Arrays in my PDF Generator API Template. But I’m still getting a blank template.

I’ve also switched to using a custom template without any new variables, so I can get the data passed across without worrying about any external variables.

What steps am I missing here?

Any help would be much appreciated

{
“nodes”: [
{
“parameters”: {
“formTitle”: “Get a Quote for a Function”,
“formDescription”: “Hey there!\n\nMy name’s Quotebot, your friendly quoting assistant for every function you need.\n\nJust answer the questions below, and we’ll get back to you ASAP”,
“formFields”: {
“values”: [
{
“fieldLabel”: “What function are you hosting?”
},
{
“fieldLabel”: “How many people are expected to attend?”,
“fieldType”: “number”
},
{
“fieldLabel”: “Do any guests have Dietary Requirements?”
},
{
“fieldLabel”: “When will your function be held?”,
“fieldType”: “date”
},
{
“fieldLabel”: “What’s your name?”
},
{
“fieldLabel”: “What’s your email address?”,
“fieldType”: “email”
},
{
“fieldLabel”: “What is the event name?”
},
{
“fieldLabel”: “What is the venue address?”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.formTrigger”,
“typeVersion”: 2.5,
“position”: [
-64,
64
],
“id”: “f097eb29-0b1f-4d29-9e1f-67a3674f68f6”,
“name”: “On form submission”,
“webhookId”: “388b123e-f115-4213-9bd7-b4ad56bea13a”
},
{
“parameters”: {
“promptType”: “define”,
“text”: “=Hi There\n\nCould you please write a full quote for {{ $(“Edit Fields”).item.json[“What’s your name?”] }} and send it to {{ $(“Edit Fields”).item.json[“What’s your email address?”] }}?\n\nClient Details:\n- Function Type: {{ $(“Edit Fields”).item.json[“What function are you hosting?”] }}\n- Expected Attendees: {{ $(“Edit Fields”).item.json[“How many people are expected to attend?”] }}\n- Dietary Requirements: {{ $(“Edit Fields”).item.json[“Do any guests have Dietary Requirements?”] }}\n- Function Date: {{ $(“Edit Fields”).item.json[“When will your function be held?”] }}\n- Event Name: {{ $json[‘What is the event name?’] }}\n- Venue Address {{ $json[‘What is the venue address?’] }}\n\n”,
“options”: {
“systemMessage”: “=You are a Catering Business Quoting Expert.\n\nYou’re given access to an MCP Client Server\n\nI need you to use it to create a Quote for a client and send it to them as an email \n\n{{ $today }}”
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3.1,
“position”: [
384,
64
],
“id”: “982cc05d-25be-4b87-a048-d6f39591c952”,
“name”: “AI Agent”,
“alwaysOutputData”: true,
“onError”: “continueRegularOutput”
},
{
“parameters”: {
“modelName”: “models/gemini-2.5-flash-lite”,
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1.1,
“position”: [
400,
288
],
“id”: “76de3829-d663-44b0-a562-1b7ea31e98c1”,
“name”: “Google Gemini Chat Model”,
“credentials”: {
“googlePalmApi”: {
“id”: “r5K1AFY1c2dmiqsE”,
“name”: “Google Gemini(PaLM) Api account”
}
}
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “1fb0c0f2-eff7-4900-9ca9-15950c133260”,
“name”: “What function are you hosting?”,
“value”: “={{ $json[“What function are you hosting?”] }}”,
“type”: “string”
},
{
“id”: “c4171ed1-c773-4dec-9126-57d400eb9bbd”,
“name”: “How many people are expected to attend?”,
“value”: “={{ $json[“How many people are expected to attend?”] }}”,
“type”: “number”
},
{
“id”: “feeaa131-f6c7-47d0-b16a-a107e56c5d8d”,
“name”: “Do any guests have Dietary Requirements?”,
“value”: “={{ $json[“Do any guests have Dietary Requirements?”] }}”,
“type”: “string”
},
{
“id”: “c5318dd3-dbcc-4a18-ab72-90c2eda07fb2”,
“name”: “When will your function be held?”,
“value”: “={{ $json[“When will your function be held?”] }}”,
“type”: “string”
},
{
“id”: “754d4f71-338b-4b3e-ba87-c66852b76799”,
“name”: “What’s your name?”,
“value”: “={{ $json[“What’s your name?”] }}”,
“type”: “string”
},
{
“id”: “5432c27a-958f-4f76-9fa0-3663ab7b8f19”,
“name”: “What’s your email address?”,
“value”: “={{ $json[“What’s your email address?”] }}”,
“type”: “string”
},
{
“id”: “3644948e-b74b-42fe-8456-0261a87e81a2”,
“name”: “What is the event name?”,
“value”: “={{ $json[‘What is the event name?’] }}”,
“type”: “string”
},
{
“id”: “19d462d9-c51e-421e-8e7e-f900742ffd99”,
“name”: “What is the venue address?”,
“value”: “={{ $json[‘What is the venue address?’] }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
160,
64
],
“id”: “400a62c7-dab9-4924-88cc-5cab0a0e14ac”,
“name”: “Edit Fields”
},
{
“parameters”: {
“endpointUrl”: “https://timb.app.n8n.cloud/mcp/8d44ab8f-e11c-492a-9b68-b3fbafec81f5”,
“include”: “selected”,
“includeTools”: [
“furniture_Rentals”,
“Payment”,
“Additional_Service”,
“Pricing”,
“Menu_Drinks”,
“Staffing”,
“Venue_Logistics”,
“Ingredients”
],
“options”: {}
},
“id”: “22441ba6-367a-48ca-9f76-938338ecb6c3”,
“name”: “MCP Client Tool”,
“type”: “@n8n/n8n-nodes-langchain.mcpClientTool”,
“typeVersion”: 1.3,
“position”: [
528,
288
]
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “acf6fc3f-89fd-4c14-865f-c9bb597e4b62”,
“name”: “output”,
“value”: “={{ $json.output }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
736,
64
],
“id”: “15f99c2a-3831-4241-94f2-574c4f794f5f”,
“name”: “Edit Fields1”
},
{
“parameters”: {
“sendTo”: “barrtimm@gmail.com”,
“subject”: “Job’s wedding Quote”,
“emailType”: “text”,
“message”: “=Hey there here’s your quote”,
“options”: {
“appendAttribution”: false,
“attachmentsUi”: {
“attachmentsBinary”: [
{
“property”: “={{ $json.filename }}”
}
]
}
}
},
“type”: “n8n-nodes-base.gmail”,
“typeVersion”: 2.2,
“position”: [
1408,
64
],
“id”: “e0df1045-382b-47b2-bb57-8120a7554cbb”,
“name”: “Send a message”,
“webhookId”: “528a735e-f777-4a86-9115-82bab5906ab7”
},
{
“parameters”: {
“templateId”: {
“__rl”: true,
“value”: “1650471”,
“mode”: “list”,
“cachedResultName”: “Job Blob Quote (ID: 1650471)”
},
“data”: “={“quote_content”: “{{ $json.output }}” }”,
“documentOutput”: “file”,
“additionalFields”: {}
},
“type”: “@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi”,
“typeVersion”: 1,
“position”: [
944,
64
],
“id”: “ea60f1cf-803e-4b97-b2fa-bc03045c7394”,
“name”: “Generate a PDF document”,
“credentials”: {
“pdfGeneratorApi”: {
“id”: “XUfVEGWx0Q45fr5L”,
“name”: “PDF Generator account”
}
}
}
],
“connections”: {
“On form submission”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“AI Agent”: {
“main”: [
[
{
“node”: “Edit Fields1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“MCP Client Tool”: {
“ai_tool”: [
[
{
“node”: “AI Agent”,
“type”: “ai_tool”,
“index”: 0
}
]
]
},
“Edit Fields1”: {
“main”: [
[
{
“node”: “Generate a PDF document”,
“type”: “main”,
“index”: 0
}
]
]
},
“Generate a PDF document”: {
“main”: [
[
{
“node”: “Send a message”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {
“On form submission”: [
{
“What function are you hosting?”: “wedding”,
“How many people are expected to attend?”: 69,
“Do any guests have Dietary Requirements?”: “yes - Jack Pescatarian”,
“When will your function be held?”: “2026-09-23”,
“What’s your name?”: “Skoot”,
“What’s your email address?”: “barrtimm@gmail.com”,
“What is the event name?”: “Skkoot and toots wedding”,
“What is the venue address?”: “10 Stanley La”,
“submittedAt”: “2026-06-17T07:48:32.786+10:00”,
“formMode”: “test”
}
]
},
“meta”: {
“instanceId”: “845031bfdb8f607d8c7ae907fb5de28c6fb4d0a8d0cd06c1a605d7c42f4018a9”
}
}

Hey Tim,

A blank PDF almost always comes down to one of two things: the data you send to the PDF Generator API node isn’t valid JSON, or the template variable name doesn’t match the key you’re sending. Looking at your workflow, I’m fairly sure it’s the first one.

The likely culprit is your data field. Right now it’s ={ "quote_content": "{{ $json.output }}" }. The issue: $json.output is AI-generated text, so it contains line breaks, quotes and apostrophes. When n8n drops that raw text inside your hand-written JSON string, those characters break the JSON (an unescaped quote or a newline inside the value = invalid JSON), so the PDF Generator API gets something it can’t parse and renders the template with no data, i.e. blank.

The fix: let n8n build the JSON for you so it’s always escaped correctly. Set the Data field to ={{ JSON.stringify({ quote_content: $json.output }) }}. That way quote_content always arrives as a clean, valid value.

Then verify two things. First, that output is actually populated: open the AI Agent’s last execution and confirm output holds the full quote text. Your agent has onError: continueRegularOutput, so if the Gemini/MCP step silently failed it would pass an empty output downstream and you’d get a blank PDF even with the mapping fixed. Second, the exact variable name in the template: in Job Blob Quote (1650471) the placeholder must be exactly {{quote_content}}, same spelling and no extra spaces, or the value won’t land.

Do the JSON.stringify change first and re-run; that fixes the “I sent data but it’s blank” case the vast majority of the time. If output is still empty after that, paste what the agent returns and we’ll trace it from there.

1 Like