Je construis un flux de travail qui envoie des données d’agent IA à générer sous forme de fichier PDF en utilisant le nœud « PDF Generator API ».
J’ai utilisé cette commande dans le champ « data » du nœud sur deux flux de travail précédents avec exactement la même fonction, et cela fonctionnait parfaitement :
{{ JSON.stringify({ post_event_report: $json.output }) }}
Mais ici, elle génère un PDF vierge. J’ai déjà inclus la variable dans le modèle PDF Generator comme je l’ai fait pour les flux de travail précédents, donc je n’ai aucune idée de pourquoi elle génère soudainement un PDF vierge.
Vous avez une idée ?
{
“nodes”: [
{
“parameters”: {},
“type”: “n8n-nodes-base.manualTrigger”,
“typeVersion”: 1,
“position”: [
0,
0
],
“id”: “27e200f4-843d-4d50-b42c-0b8a26f7291b”,
“name”: “When clicking ‘Execute workflow’”
},
{
“parameters”: {
“documentId”: {
“__rl”: true,
“value”: “1DSaJKyI1eCp6WZJ8X1aAa6jg7fvOOS5vJFKUmar7quA”,
“mode”: “list”,
“cachedResultName”: “Post Event Reporting”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1DSaJKyI1eCp6WZJ8X1aAa6jg7fvOOS5vJFKUmar7quA/edit?usp=drivesdk”
},
“sheetName”: {
“__rl”: true,
“value”: “gid=0”,
“mode”: “list”,
“cachedResultName”: “Sheet1”,
“cachedResultUrl”: “https://docs.google.com/spreadsheets/d/1DSaJKyI1eCp6WZJ8X1aAa6jg7fvOOS5vJFKUmar7quA/edit#gid=0”
},
“options”: {}
},
“type”: “n8n-nodes-base.googleSheets”,
“typeVersion”: 4.7,
“position”: [
224,
0
],
“id”: “3b86eb78-0869-40c3-9bcf-1ad77f80cf74”,
“name”: “Get row(s) in sheet”,
“credentials”: {
“googleSheetsOAuth2Api”: {
“id”: “wV1Zw6McyxYXrk8t”,
“name”: “Google Sheets account”
}
}
},
{
“parameters”: {
“promptType”: “define”,
“text”: “= Get {{ $json.Feedback }} for {{ $json[“Event Name”] }} {{ $json.Date }} {{ $json.Location }} {{ $json[‘No. of Guests’] }}”,
“options”: {
“systemMessage”: "=You are a Post Event Reporting specialist working with a Small Catering Business with over 30 years of experience in the industry. Your role is to analyze the spreadsheet and generate areas of improvement based on the {{ $json.Feedback }} given. Compile all of the data into a comprehensive post-event report "
}
},
“type”: “@n8n/n8n-nodes-langchain.agent”,
“typeVersion”: 3.1,
“position”: [
448,
0
],
“id”: “1cebd084-c6fa-4477-b507-96bffc2a3733”,
“name”: “AI Agent”
},
{
“parameters”: {
“templateId”: {
“__rl”: true,
“value”: “1655316”,
“mode”: “list”,
“cachedResultName”: “Post-Event Report (ID: 1655316)”
},
“data”: “={{ JSON.stringify({ post_event_report: $json.output }) }}”,
“documentOutput”: “viewer”,
“additionalFields”: {
“outputName”: “=Post event report for {{ $(‘Get row(s) in sheet’).item.json[“Event Name”] }} on {{ $(‘Get row(s) in sheet’).item.json.Date }}”,
“testing”: false
}
},
“type”: “@pdfgeneratorapi/n8n-nodes-pdf-generator-api.pdfGeneratorApi”,
“typeVersion”: 1,
“position”: [
800,
0
],
“id”: “4304c3b8-5210-4b2d-8d6d-49eac03b03a6”,
“name”: “Generate a PDF document”,
“alwaysOutputData”: true,
“credentials”: {
“pdfGeneratorApi”: {
“id”: “XUfVEGWx0Q45fr5L”,
“name”: “PDF Generator account”
}
}
},
{
“parameters”: {
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.lmChatGoogleGemini”,
“typeVersion”: 1.1,
“position”: [
320,
208
],
“id”: “630d55ef-1a19-4f5a-bad5-a14c85c8fb4d”,
“name”: “Google Gemini Chat Model”,
“credentials”: {
“googlePalmApi”: {
“id”: “r5K1AFY1c2dmiqsE”,
“name”: “Google Gemini(PaLM) Api account”
}
}
}
],
“connections”: {
“When clicking ‘Execute workflow’”: {
“main”: [
[
{
“node”: “Get row(s) in sheet”,
“type”: “main”,
“index”: 0
}
]
]
},
“Get row(s) in sheet”: {
“main”: [
[
{
“node”: “AI Agent”,
“type”: “main”,
“index”: 0
}
]
]
},
“AI Agent”: {
“main”: [
[
{
“node”: “Generate a PDF document”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Gemini Chat Model”: {
“ai_languageModel”: [
[
{
“node”: “AI Agent”,
“type”: “ai_languageModel”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “845031bfdb8f607d8c7ae907fb5de28c6fb4d0a8d0cd06c1a605d7c42f4018a9”
}
}