Bonjour, merci pour votre réponse.
Voici une version simplifiée de mon flux de travail. Le nœud « setVar » est instancié au début sans erreurs. Le flux s’exécute correctement, et ce n’est qu’au nœud final que j’ai besoin de la valeur « mail » spécifiée dans « setVar ». Les deux nœuds précédant « setVar » sont inclus uniquement à titre illustratif.
Erreur
Problème dans le nœud « Send an Email »
Aucun destinataire défini
{
"nodes": [
{
"parameters": {
"fromEmail": "sender@mydomain",
"toEmail": "={{ $('setVar').first().item.json.mail }}",
"subject": "Subject",
"html": "={{ $json.html }}",
"options": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.emailSend",
"typeVersion": 2.1,
"position": [
-656,
16
],
"id": "f053b99c-d232-407b-91fc-2b1749ef66bf",
"name": "Send an Email",
"webhookId": "92fbf1a7-3faf-414e-8204-1043de1496e7",
"credentials": {
"smtp": {
"id": "SoaEmU7pgWAipLFL",
"name": "smtp"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "2b7df394-0865-4dea-b1cd-c8f2d569c363",
"name": "data",
"value": "={{ $('Get chat message').item.json.body.content.replace(/(\
<([^\
>]+)\
>)/ig, \"\") }}",
"type": "string"
},
{
"id": "78fc7e77-81bb-41ca-8ad4-2628742d0798",
"name": "mail",
"value": "={{ $json.mail }}",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-2016,
16
],
"id": "c3b0fd23-7645-4784-83aa-47515995e241",
"name": "setVar"
},
{
"parameters": {
"content": "Chaîner plusieurs agents n8n AI, sans étapes d'attente.",
"height": 256,
"width": 1024
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-1776,
-64
],
"typeVersion": 1,
"id": "f26fcd45-7595-4258-853b-8aac622430e3",
"name": "Sticky Note"
},
{
"parameters": {
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.chatTrigger",
"typeVersion": 1.4,
"position": [
-2464,
16
],
"id": "06ac703e-eb18-4818-a714-d381b00916b4",
"name": "When chat message received",
"webhookId": "1b1b9d28-77b3-4190-8ae1-faa56960f1ed"
},
{
"parameters": {
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
-2240,
16
],
"id": "cf6462ed-1f60-4717-b516-07842e6dfb2a",
"name": "getMail"
},
{
"parameters": {
"content": "Cette partie prend un peu moins de deux minutes à exécuter. Les données sont collectées au préalable pour alimenter le nœud « setVar ».",
"height": 384,
"width": 1600,
"color": 5
},
"type": "n8n-nodes-base.stickyNote",
"position": [
-2048,
-128
],
"typeVersion": 1,
"id": "423819c8-db3e-4d73-bca5-2c48e1300d12",
"name": "Sticky Note1"
}
],
"connections": {
"setVar": {
"main": [
[
{
"node": "Send an Email",
"type": "main",
"index": 0
}
]
]
},
"When chat message received": {
"main": [
[
{
"node": "getMail",
"type": "main",
"index": 0
}
]
]
},
"getMail": {
"main": [
[
{
"node": "setVar",
"type": "main",
"index": 0
}
]
]
}
},
"pinData": {},
"meta": {
"instanceId": "3692996d2c89e949777729662d6d3beae0269613695efc42c83cca2a1b55c270"
}
}