Hi everyone,
What is the error message (if any)?
My goal is to generete images based on actual pictures I have on a folder on my computer (local folder). I use a text file in my folder to retrieve the prompt that i need to use, and the images i need to modify. But when I run my workflow, I only end up with my images, and not my prompt, or the opposite depending on how i merge both.
This should be a simple problems but I am not used to this feature of n8n compared to other automation tools such as knime for exemple. Would you have an idea on how I can merge these two informations to set up my gemini nano banana node ?
Please share your workflow
This is my workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
{
“nodes”: [
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “5cfe14b7-c8aa-4328-91b2-bea4c548a20e”,
“leftValue”: “={{ $json.fileName }}”,
“rightValue”: “^#.*\\.png$”,
“operator”: {
“type”: “string”,
“operation”: “regex”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.filter”,
“typeVersion”: 2.3,
“position”: [
560,
208
],
“id”: “1f3415ae-9983-466a-bdac-27e53b450056”,
“name”: “Filtre les images a utiliser”
},
{
“parameters”: {
“operation”: “text”,
“destinationKey”: “prompt”,
“options”: {}
},
“type”: “n8n-nodes-base.extractFromFile”,
“typeVersion”: 1.1,
“position”: [
832,
464
],
“id”: “fb72575e-1ac6-4ad3-90c7-ad715725ee4a”,
“name”: “Récupère le contenu du .txt”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 3
},
“conditions”: [
{
“id”: “5cfe14b7-c8aa-4328-91b2-bea4c548a20e”,
“leftValue”: “={{ $json.fileName }}”,
“rightValue”: “_prompt_IA.txt”,
“operator”: {
“type”: “string”,
“operation”: “equals”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.filter”,
“typeVersion”: 2.3,
“position”: [
560,
464
],
“id”: “53acf130-0386-4b4e-a4c2-81f51fe4eef3”,
“name”: “Récupère le script pour les images”
},
{
“parameters”: {
“fileSelector”: “=/sources/Poses/{{ $json.fileName }}”,
“options”: {}
},
“type”: “n8n-nodes-base.readWriteFile”,
“typeVersion”: 1.1,
“position”: [
832,
208
],
“id”: “d4d36e1a-8339-4053-81ac-6297842c7ab2”,
“name”: “Lis chaque image présente”
},
{
“parameters”: {
“resource”: “image”,
“operation”: “edit”,
“modelId”: {
“__rl”: true,
“value”: “models/gemini-2.5-flash-image”,
“mode”: “list”,
“cachedResultName”: “models/gemini-2.5-flash-image (Nano Banana)”
},
“prompt”: “={{ $json.prompt }}”,
“images”: {
“values”: [
{}
]
},
“options”: {}
},
“type”: “@n8n/n8n-nodes-langchain.googleGemini”,
“typeVersion”: 1.1,
“position”: [
1360,
336
],
“id”: “51bc9cff-e9c9-49ec-920f-810381f5b190”,
“name”: “Edit an image”,
“alwaysOutputData”: true,
“credentials”: {
“googlePalmApi”: {
“id”: “gsddsg”,
“name”: “XaX”
}
}
},
{
“parameters”: {
“fileSelector”: “/sources/Poses/*”,
“options”: {}
},
“type”: “n8n-nodes-base.readWriteFile”,
“typeVersion”: 1.1,
“position”: [
64,
336
],
“id”: “ac917252-31d6-4c9a-a5e4-b57e996c96da”,
“name”: “Récupère les fichiers du dossier”
},
{
“parameters”: {},
“type”: “n8n-nodes-base.merge”,
“typeVersion”: 3.2,
“position”: [
1136,
336
],
“id”: “53eb35db-365c-42ee-af08-84d9831d86a5”,
“name”: “Merge”
}
],
“connections”: {
“Filtre les images a utiliser”: {
“main”: [
[
{
“node”: “Lis chaque image présente”,
“type”: “main”,
“index”: 0
}
]
]
},
“Récupère le contenu du .txt”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 1
}
]
]
},
“Récupère le script pour les images”: {
“main”: [
[
{
“node”: “Récupère le contenu du .txt”,
“type”: “main”,
“index”: 0
}
]
]
},
“Lis chaque image présente”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit an image”: {
“main”: [
]
},
“Récupère les fichiers du dossier”: {
“main”: [
[
{
“node”: “Filtre les images a utiliser”,
“type”: “main”,
“index”: 0
},
{
“node”: “Récupère le script pour les images”,
“type”: “main”,
“index”: 0
}
]
]
},
“Merge”: {
“main”: [
[
{
“node”: “Edit an image”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“templateCredsSetupCompleted”: true,
“instanceId”: “wvfvwdvfwdvw”
}
}
Share the output returned by the last node
Depending on how I connect the two informations (images and prompt), I often end up like in this workflow with no data from the txt file, that I need in my gemini node.
Information on your n8n setup
I run npm on a local server, using the latest version on docker hub.
Thank you.