{
  "name": "BLOG FILMORAMAX",
  "nodes": [
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"sonar-pro\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Tu es un rédacteur professionel d'articles de cinéma. UNIQUEMENT en format Markdown avec des titres ## et des paragraphes.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Écris un article sur les actualités de cinéma français du jour. IMPORTANT: Commence ton article par un titre accrocheur entre balises ## suivi du contenu en Markdown. Le titre doit être informatif et attrayant.\"\n    }\n  ]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -380,
        -240
      ],
      "id": "58ff8865-9b8b-4b7b-80c6-998ad3bf73ee",
      "name": "HTTP Request",
      "credentials": {
        "httpHeaderAuth": {
          "id": "BL6VN7r3tBQSzXDw",
          "name": "Perplexity API Key"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const content = $node[\"HTTP Request\"].json.choices[0].message.content;\n\n// Fonction pour supprimer les citations\nfunction removeCitations(text) {\n    text = text.replace(/\\s*\\(\\d+\\)/g, '');\n    text = text.replace(/\\s*\\[\\d+\\]/g, '');\n    text = text.replace(/\\n\\n(Citations?|References?):\\s*[\\s\\S]*$/i, '');\n    return text;\n}\n\n\n\nfunction generateExcerpt(text) {\n    const lines = text.split('\\n').map(l => l.trim());\n    // Filtre les lignes qui ne sont pas des titres Markdown et qui ont une longueur raisonnable\n    const firstParagraph = lines.find(line =>\n        line &&\n        !line.startsWith('#') &&\n        line.length > 40 // seuil à ajuster selon tes besoins\n    );\n    if (firstParagraph) {\n        return firstParagraph.substring(0, 200).trim() + '...';\n    }\n    return 'Découvrez les dernières actualités du cinéma...';\n}\n\n\n// Fonction pour extraire les mots-clés\nfunction extractKeywords(text, title, mainMovie) {\n    const keywords = ['cinéma', 'film', 'actualités'];\n    \n    if (mainMovie) keywords.push(mainMovie);\n    \n    // Recherche de mots-clés dans le contenu\n    const commonWords = ['sortie', 'réalisateur', 'acteur', 'box-office', 'festival', 'bande-annonce'];\n    commonWords.forEach(word => {\n        if (text.toLowerCase().includes(word)) {\n            keywords.push(word);\n        }\n    });\n    \n    return keywords.slice(0, 8).join(', ');\n}\n\n// Fonction pour générer la meta description\nfunction generateMetaDescription(title, excerpt) {\n    const desc = `${title} - ${excerpt.substring(0, 80)}...`;\n    return desc.substring(0, 160); // Assure la limite de 160 caractères\n}\n\n// Application du nettoyage\nconst cleanContent = removeCitations(content);\n\n// Extraction du titre\nconst lines = cleanContent.split('\\n');\nconst titleLine = lines.find(line => line.startsWith('## '));\nconst title = titleLine ? titleLine.replace('## ', '') : 'Actualités Cinéma';\n\n// Génération de l'excerpt (corrigé)\nconst excerpt = generateExcerpt(cleanContent);\n\n// Génération des mots-clés\nconst keywords = extractKeywords(cleanContent, title,);\n\n// Génération de la meta description\nconst metaDescription = generateMetaDescription(title, excerpt);\n\n// Génération d'un slug unique\nconst now = new Date();\nconst dateSlug = now.toISOString().slice(0, 16).replace(/[-:T]/g, '-');\nconst uniqueSlug = `actualites-cinema-${dateSlug}`;\n\n// Retour complet avec noms de champs cohérents avec Supabase\nreturn [{\n    title: title,\n    content: cleanContent,\n    excerpt: excerpt,                    \n    keywords: keywords,\n    meta_description: metaDescription,\n    status: 'published',\n    published_at: now.toISOString(),\n    slug: uniqueSlug,\n    category: \"Actualites FR\"\n}];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        60,
        -240
      ],
      "id": "c7b9d1ee-ae48-442f-a11d-2934c785b8ee",
      "name": "Code"
    },
    {
      "parameters": {
        "tableId": "cinema_articles",
        "dataToSend": "autoMapInputData"
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1220,
        140
      ],
      "id": "95abc500-8c62-46e4-8cf4-97c1d4848e19",
      "name": "Supabase",
      "credentials": {
        "supabaseApi": {
          "id": "TP13Sr1wB1EzXj3y",
          "name": "Supabase account"
        }
      }
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1870b98d-9907-4864-b6d9-504c6b3386b7",
              "name": "title",
              "value": "={{ $json.search_results[0].title }}",
              "type": "string"
            },
            {
              "id": "579ccacc-11ea-48a3-96cc-1267c1f7ee76",
              "name": "content",
              "value": "={{ $json.choices[0].message.content }}",
              "type": "string"
            },
            {
              "id": "e40071ea-86a7-49cb-a0ac-6f92a4a959bd",
              "name": "category",
              "value": "Actualités Monde",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -160,
        -240
      ],
      "id": "2647a241-378c-445f-927c-dea05c61168b",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"sonar-pro\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Tu es un rédacteur professionel d'articles de cinéma. UNIQUEMENT en format Markdown avec des titres ## et des paragraphes.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Écris un article sur les actualités de cinéma dans le monde du jour, partout sauf en France. IMPORTANT: Commence ton article par un titre accrocheur entre balises ## suivi du contenu en Markdown. Le titre doit être informatif et attrayant.\"\n    }\n  ]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -380,
        -40
      ],
      "id": "769d9c7b-cab3-44bf-ba7d-9e7ac4bd548a",
      "name": "HTTP Request1",
      "credentials": {
        "httpHeaderAuth": {
          "id": "BL6VN7r3tBQSzXDw",
          "name": "Perplexity API Key"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const content = $node[\"HTTP Request1\"].json.choices[0].message.content;\n\n// Fonction pour supprimer les citations\nfunction removeCitations(text) {\n    text = text.replace(/\\s*\\(\\d+\\)/g, '');\n    text = text.replace(/\\s*\\[\\d+\\]/g, '');\n    text = text.replace(/\\n\\n(Citations?|References?):\\s*[\\s\\S]*$/i, '');\n    return text;\n}\n\n\n\nfunction generateExcerpt(text) {\n    const lines = text.split('\\n').map(l => l.trim());\n    // Filtre les lignes qui ne sont pas des titres Markdown et qui ont une longueur raisonnable\n    const firstParagraph = lines.find(line =>\n        line &&\n        !line.startsWith('#') &&\n        line.length > 40 // seuil à ajuster selon tes besoins\n    );\n    if (firstParagraph) {\n        return firstParagraph.substring(0, 200).trim() + '...';\n    }\n    return 'Découvrez les dernières actualités du cinéma...';\n}\n\n\n// Fonction pour extraire les mots-clés\nfunction extractKeywords(text, title, mainMovie) {\n    const keywords = ['cinéma', 'film', 'actualités'];\n    \n    if (mainMovie) keywords.push(mainMovie);\n    \n    // Recherche de mots-clés dans le contenu\n    const commonWords = ['sortie', 'réalisateur', 'acteur', 'box-office', 'festival', 'bande-annonce'];\n    commonWords.forEach(word => {\n        if (text.toLowerCase().includes(word)) {\n            keywords.push(word);\n        }\n    });\n    \n    return keywords.slice(0, 8).join(', ');\n}\n\n// Fonction pour générer la meta description\nfunction generateMetaDescription(title, excerpt) {\n    const desc = `${title} - ${excerpt.substring(0, 80)}...`;\n    return desc.substring(0, 160); // Assure la limite de 160 caractères\n}\n\n// Application du nettoyage\nconst cleanContent = removeCitations(content);\n\n// Extraction du titre\nconst lines = cleanContent.split('\\n');\nconst titleLine = lines.find(line => line.startsWith('## '));\nconst title = titleLine ? titleLine.replace('## ', '') : 'Actualités Cinéma';\n\n// Génération de l'excerpt (corrigé)\nconst excerpt = generateExcerpt(cleanContent);\n\n// Génération des mots-clés\nconst keywords = extractKeywords(cleanContent, title,);\n\n// Génération de la meta description\nconst metaDescription = generateMetaDescription(title, excerpt);\n\n// Génération d'un slug unique\nconst now = new Date();\nconst dateSlug = now.toISOString().slice(0, 16).replace(/[-:T]/g, '-');\nconst uniqueSlug = `actualites-cinema-${dateSlug}`;\n\n// Retour complet avec noms de champs cohérents avec Supabase\nreturn [{\n    title: title,\n    content: cleanContent,\n    excerpt: excerpt,                    \n    keywords: keywords,\n    meta_description: metaDescription,\n    status: 'published',\n    published_at: now.toISOString(),\n    slug: uniqueSlug,\n    category: \"Actualites Monde\"\n}];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        60,
        -40
      ],
      "id": "2336e77e-e762-47a1-8cf4-f46fb7ca1b9b",
      "name": "Code1"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1870b98d-9907-4864-b6d9-504c6b3386b7",
              "name": "title",
              "value": "={{ $json.search_results[0].title }}",
              "type": "string"
            },
            {
              "id": "579ccacc-11ea-48a3-96cc-1267c1f7ee76",
              "name": "content",
              "value": "={{ $json.choices[0].message.content }}",
              "type": "string"
            },
            {
              "id": "e40071ea-86a7-49cb-a0ac-6f92a4a959bd",
              "name": "category",
              "value": "Series",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -160,
        -40
      ],
      "id": "b0b32f28-3d39-45fd-b7a5-ae1a41ebca29",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 12
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -1000,
        120
      ],
      "id": "2fcf090f-6028-47e3-8e9c-1e32bd570d6e",
      "name": "Schedule Trigger"
    },
    {
      "parameters": {
        "jsCode": "const now = new Date();\n\n// Nombre de scénarios\nconst scenarios = [\n  'Actualites FR',   // scénario 1\n  'Actualites Monde',   // scénario 2\n  'Series',     // scénario 3\n  'Nouveaux Films',     // scénario 4\n  'Courts Metrages'     // scénario 5\n];\n\n// Époque de référence : 1er janvier 2025 à 00:00:00 UTC\nconst epochStart = new Date('2025-01-01T00:00:00Z');\n\n// Calcul du nombre de millisecondes depuis l'époque\nconst msSinceEpoch = now.getTime() - epochStart.getTime();\n\n// Calcul du nombre de périodes de 12h depuis l'époque\nconst msIn12Hours = 12 * 60 * 60 * 1000; // 12 heures en millisecondes\nconst periodIndex = Math.floor(msSinceEpoch / msIn12Hours);\n\n// Sélection du scénario basée sur la rotation\nconst scenarioIndex = periodIndex % scenarios.length;\nconst scenario = scenarios[scenarioIndex];\n\nreturn [{ \n  scenario, \n  scenarioIndex, \n  periodIndex, \n  date: now.toISOString(),\n  msSinceEpoch,\n  epochStart: epochStart.toISOString()\n}];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -800,
        -60
      ],
      "id": "08aac4a9-ccfc-41fd-b143-f1cd765652eb",
      "name": "Code2"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{$json[\"scenario\"]}}",
                    "rightValue": "Actualites FR",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "af25bba6-77eb-4b76-b0da-eb6fb7424e33"
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "b8ec0e5a-59f7-4d30-b4a1-ab7c35bff3e3",
                    "leftValue": "={{$json[\"scenario\"]}}",
                    "rightValue": "Actualites Monde",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "aa23e4dd-a9d2-48dd-bc5a-24baac834792",
                    "leftValue": "={{$json[\"scenario\"]}}",
                    "rightValue": "Series",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "3f360a8b-ee0c-461f-bd95-a95a6e43ed82",
                    "leftValue": "={{$json[\"scenario\"]}}",
                    "rightValue": "Nouveaux Films",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "5b584cd1-cae8-4181-8c5b-2185de8296c5",
                    "leftValue": "={{$json[\"scenario\"]}}",
                    "rightValue": "Courts Metrages",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              }
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -600,
        -260
      ],
      "id": "30814f37-d153-49ad-a7b9-31b414e719b5",
      "name": "Switch"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"sonar-pro\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Tu es un rédacteur professionel d'articles de cinéma. UNIQUEMENT en format Markdown avec des titres ## et des paragraphes.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Écris un article sur les séries TV du moment, ou les séries les plus en vue. IMPORTANT: Commence ton article par un titre accrocheur entre balises ## suivi du contenu en Markdown. Le titre doit être informatif et attrayant.\"\n    }\n  ]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -380,
        160
      ],
      "id": "07cfb822-aa5f-45a2-8ffd-dfc76facdcc0",
      "name": "HTTP Request2",
      "credentials": {
        "httpHeaderAuth": {
          "id": "BL6VN7r3tBQSzXDw",
          "name": "Perplexity API Key"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const content = $node[\"HTTP Request2\"].json.choices[0].message.content;\n\n// Fonction pour supprimer les citations\nfunction removeCitations(text) {\n    text = text.replace(/\\s*\\(\\d+\\)/g, '');\n    text = text.replace(/\\s*\\[\\d+\\]/g, '');\n    text = text.replace(/\\n\\n(Citations?|References?):\\s*[\\s\\S]*$/i, '');\n    return text;\n}\n\n\n\nfunction generateExcerpt(text) {\n    const lines = text.split('\\n').map(l => l.trim());\n    // Filtre les lignes qui ne sont pas des titres Markdown et qui ont une longueur raisonnable\n    const firstParagraph = lines.find(line =>\n        line &&\n        !line.startsWith('#') &&\n        line.length > 40 // seuil à ajuster selon tes besoins\n    );\n    if (firstParagraph) {\n        return firstParagraph.substring(0, 200).trim() + '...';\n    }\n    return 'Découvrez les dernières actualités du cinéma...';\n}\n\n\n// Fonction pour extraire les mots-clés\nfunction extractKeywords(text, title, mainMovie) {\n    const keywords = ['cinéma', 'film', 'actualités'];\n    \n    if (mainMovie) keywords.push(mainMovie);\n    \n    // Recherche de mots-clés dans le contenu\n    const commonWords = ['sortie', 'réalisateur', 'acteur', 'box-office', 'festival', 'bande-annonce'];\n    commonWords.forEach(word => {\n        if (text.toLowerCase().includes(word)) {\n            keywords.push(word);\n        }\n    });\n    \n    return keywords.slice(0, 8).join(', ');\n}\n\n// Fonction pour générer la meta description\nfunction generateMetaDescription(title, excerpt) {\n    const desc = `${title} - ${excerpt.substring(0, 80)}...`;\n    return desc.substring(0, 160); // Assure la limite de 160 caractères\n}\n\n// Application du nettoyage\nconst cleanContent = removeCitations(content);\n\n// Extraction du titre\nconst lines = cleanContent.split('\\n');\nconst titleLine = lines.find(line => line.startsWith('## '));\nconst title = titleLine ? titleLine.replace('## ', '') : 'Actualités Cinéma';\n\n// Génération de l'excerpt (corrigé)\nconst excerpt = generateExcerpt(cleanContent);\n\n// Génération des mots-clés\nconst keywords = extractKeywords(cleanContent, title,);\n\n// Génération de la meta description\nconst metaDescription = generateMetaDescription(title, excerpt);\n\n// Génération d'un slug unique\nconst now = new Date();\nconst dateSlug = now.toISOString().slice(0, 16).replace(/[-:T]/g, '-');\nconst uniqueSlug = `actualites-cinema-${dateSlug}`;\n\n// Retour complet avec noms de champs cohérents avec Supabase\nreturn [{\n    title: title,\n    content: cleanContent,\n    excerpt: excerpt,                    \n    keywords: keywords,\n    meta_description: metaDescription,\n    status: 'published',\n    published_at: now.toISOString(),\n    slug: uniqueSlug,\n    category: \"Series\"\n}];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        60,
        160
      ],
      "id": "ce617c8e-7b87-43bd-bc74-fbdc0f9ec38c",
      "name": "Code3"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1870b98d-9907-4864-b6d9-504c6b3386b7",
              "name": "title",
              "value": "={{ $json.search_results[0].title }}",
              "type": "string"
            },
            {
              "id": "579ccacc-11ea-48a3-96cc-1267c1f7ee76",
              "name": "content",
              "value": "={{ $json.choices[0].message.content }}",
              "type": "string"
            },
            {
              "id": "e40071ea-86a7-49cb-a0ac-6f92a4a959bd",
              "name": "category",
              "value": "Nouveaux Films",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -160,
        160
      ],
      "id": "9d8bf9ff-1886-45ec-b6c3-8ab9b0e70084",
      "name": "Edit Fields2"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"sonar-pro\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Tu es un rédacteur professionel d'articles de cinéma. UNIQUEMENT en format Markdown avec des titres ## et des paragraphes.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Écris un article sur les nouveaux films de cinéma, les dernières sorties en salle. Essaye de varier ton style narratif. Ajoute à la fin, le classement du box-office par nombre d'entrée du mois précédant. IMPORTANT: Commence ton article par un titre accrocheur entre balises ## suivi du contenu en Markdown. Le titre doit être informatif et attrayant.\"\n    }\n  ]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -380,
        340
      ],
      "id": "fe0b6f86-c71a-4252-8a60-da190526f4ab",
      "name": "HTTP Request3",
      "credentials": {
        "httpHeaderAuth": {
          "id": "BL6VN7r3tBQSzXDw",
          "name": "Perplexity API Key"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const content = $node[\"HTTP Request3\"].json.choices[0].message.content;\n\n// Fonction pour supprimer les citations\nfunction removeCitations(text) {\n    text = text.replace(/\\s*\\(\\d+\\)/g, '');\n    text = text.replace(/\\s*\\[\\d+\\]/g, '');\n    text = text.replace(/\\n\\n(Citations?|References?):\\s*[\\s\\S]*$/i, '');\n    return text;\n}\n\n\n\nfunction generateExcerpt(text) {\n    const lines = text.split('\\n').map(l => l.trim());\n    // Filtre les lignes qui ne sont pas des titres Markdown et qui ont une longueur raisonnable\n    const firstParagraph = lines.find(line =>\n        line &&\n        !line.startsWith('#') &&\n        line.length > 40 // seuil à ajuster selon tes besoins\n    );\n    if (firstParagraph) {\n        return firstParagraph.substring(0, 200).trim() + '...';\n    }\n    return 'Découvrez les dernières actualités du cinéma...';\n}\n\n\n// Fonction pour extraire les mots-clés\nfunction extractKeywords(text, title, mainMovie) {\n    const keywords = ['cinéma', 'film', 'actualités'];\n    \n    if (mainMovie) keywords.push(mainMovie);\n    \n    // Recherche de mots-clés dans le contenu\n    const commonWords = ['sortie', 'réalisateur', 'acteur', 'box-office', 'festival', 'bande-annonce'];\n    commonWords.forEach(word => {\n        if (text.toLowerCase().includes(word)) {\n            keywords.push(word);\n        }\n    });\n    \n    return keywords.slice(0, 8).join(', ');\n}\n\n// Fonction pour générer la meta description\nfunction generateMetaDescription(title, excerpt) {\n    const desc = `${title} - ${excerpt.substring(0, 80)}...`;\n    return desc.substring(0, 160); // Assure la limite de 160 caractères\n}\n\n// Application du nettoyage\nconst cleanContent = removeCitations(content);\n\n// Extraction du titre\nconst lines = cleanContent.split('\\n');\nconst titleLine = lines.find(line => line.startsWith('## '));\nconst title = titleLine ? titleLine.replace('## ', '') : 'Actualités Cinéma';\n\n// Génération de l'excerpt (corrigé)\nconst excerpt = generateExcerpt(cleanContent);\n\n// Génération des mots-clés\nconst keywords = extractKeywords(cleanContent, title,);\n\n// Génération de la meta description\nconst metaDescription = generateMetaDescription(title, excerpt);\n\n// Génération d'un slug unique\nconst now = new Date();\nconst dateSlug = now.toISOString().slice(0, 16).replace(/[-:T]/g, '-');\nconst uniqueSlug = `actualites-cinema-${dateSlug}`;\n\n// Retour complet avec noms de champs cohérents avec Supabase\nreturn [{\n    title: title,\n    content: cleanContent,\n    excerpt: excerpt,                    \n    keywords: keywords,\n    meta_description: metaDescription,\n    status: 'published',\n    published_at: now.toISOString(),\n    slug: uniqueSlug,\n    category: \"Nouveaux Films\"\n}];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        60,
        340
      ],
      "id": "4348a0a8-ab16-4f01-8570-f97bb43a1e55",
      "name": "Code4"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1870b98d-9907-4864-b6d9-504c6b3386b7",
              "name": "title",
              "value": "={{ $json.search_results[0].title }}",
              "type": "string"
            },
            {
              "id": "579ccacc-11ea-48a3-96cc-1267c1f7ee76",
              "name": "content",
              "value": "={{ $json.choices[0].message.content }}",
              "type": "string"
            },
            {
              "id": "e40071ea-86a7-49cb-a0ac-6f92a4a959bd",
              "name": "category",
              "value": "Actualités FR",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -160,
        340
      ],
      "id": "21d5ecae-7c9a-4366-9ae5-2f668329237d",
      "name": "Edit Fields3"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"sonar-pro\",\n  \"messages\": [\n    {\n      \"role\": \"system\",\n      \"content\": \"Tu es un rédacteur professionel d'articles de cinéma. UNIQUEMENT en format Markdown avec des titres ## et des paragraphes.\"\n    },\n    {\n      \"role\": \"user\",\n      \"content\": \"Écris un article sur l'actualité des courts métrages, festivals, remise de prix etc... IMPORTANT: Commence ton article par un titre accrocheur entre balises ## suivi du contenu en Markdown. Le titre doit être informatif et attrayant.\"\n    }\n  ]\n}\n",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -380,
        540
      ],
      "id": "d2256c1a-3016-4d49-ab36-4227c1b740e3",
      "name": "HTTP Request4",
      "credentials": {
        "httpHeaderAuth": {
          "id": "BL6VN7r3tBQSzXDw",
          "name": "Perplexity API Key"
        }
      }
    },
    {
      "parameters": {
        "jsCode": "const content = $node[\"HTTP Request4\"].json.choices[0].message.content;\n\n// Fonction pour supprimer les citations\nfunction removeCitations(text) {\n    text = text.replace(/\\s*\\(\\d+\\)/g, '');\n    text = text.replace(/\\s*\\[\\d+\\]/g, '');\n    text = text.replace(/\\n\\n(Citations?|References?):\\s*[\\s\\S]*$/i, '');\n    return text;\n}\n\n\n\nfunction generateExcerpt(text) {\n    const lines = text.split('\\n').map(l => l.trim());\n    // Filtre les lignes qui ne sont pas des titres Markdown et qui ont une longueur raisonnable\n    const firstParagraph = lines.find(line =>\n        line &&\n        !line.startsWith('#') &&\n        line.length > 40 // seuil à ajuster selon tes besoins\n    );\n    if (firstParagraph) {\n        return firstParagraph.substring(0, 200).trim() + '...';\n    }\n    return 'Découvrez les dernières actualités du cinéma...';\n}\n\n\n// Fonction pour extraire les mots-clés\nfunction extractKeywords(text, title, mainMovie) {\n    const keywords = ['cinéma', 'film', 'actualités'];\n    \n    if (mainMovie) keywords.push(mainMovie);\n    \n    // Recherche de mots-clés dans le contenu\n    const commonWords = ['sortie', 'réalisateur', 'acteur', 'box-office', 'festival', 'bande-annonce'];\n    commonWords.forEach(word => {\n        if (text.toLowerCase().includes(word)) {\n            keywords.push(word);\n        }\n    });\n    \n    return keywords.slice(0, 8).join(', ');\n}\n\n// Fonction pour générer la meta description\nfunction generateMetaDescription(title, excerpt) {\n    const desc = `${title} - ${excerpt.substring(0, 80)}...`;\n    return desc.substring(0, 160); // Assure la limite de 160 caractères\n}\n\n// Application du nettoyage\nconst cleanContent = removeCitations(content);\n\n// Extraction du titre\nconst lines = cleanContent.split('\\n');\nconst titleLine = lines.find(line => line.startsWith('## '));\nconst title = titleLine ? titleLine.replace('## ', '') : 'Actualités Cinéma';\n\n// Génération de l'excerpt (corrigé)\nconst excerpt = generateExcerpt(cleanContent);\n\n// Génération des mots-clés\nconst keywords = extractKeywords(cleanContent, title,);\n\n// Génération de la meta description\nconst metaDescription = generateMetaDescription(title, excerpt);\n\n// Génération d'un slug unique\nconst now = new Date();\nconst dateSlug = now.toISOString().slice(0, 16).replace(/[-:T]/g, '-');\nconst uniqueSlug = `actualites-cinema-${dateSlug}`;\n\n// Retour complet avec noms de champs cohérents avec Supabase\nreturn [{\n    title: title,\n    content: cleanContent,\n    excerpt: excerpt,                    \n    keywords: keywords,\n    meta_description: metaDescription,\n    status: 'published',\n    published_at: now.toISOString(),\n    slug: uniqueSlug,\n    category: \"Courts Metrages\"\n}];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        60,
        540
      ],
      "id": "9fb7f709-767a-4437-b30c-2e3beb7231e0",
      "name": "Code5"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1870b98d-9907-4864-b6d9-504c6b3386b7",
              "name": "title",
              "value": "={{ $json.search_results[0].title }}",
              "type": "string"
            },
            {
              "id": "579ccacc-11ea-48a3-96cc-1267c1f7ee76",
              "name": "content",
              "value": "={{ $json.choices[0].message.content }}",
              "type": "string"
            },
            {
              "id": "e40071ea-86a7-49cb-a0ac-6f92a4a959bd",
              "name": "category",
              "value": "Courts Metrages",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -160,
        540
      ],
      "id": "1a89d2a3-daa3-4251-b0ba-80d6b813dad9",
      "name": "Edit Fields4"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8bafab48-3175-43ee-b22b-92bfffe17dc2",
              "name": "title",
              "value": "={{ $('Code4').item.json.title }}",
              "type": "string"
            },
            {
              "id": "0377906f-6630-494f-a1e1-5f4822f87567",
              "name": "content",
              "value": "={{ $('Code4').item.json.content }}",
              "type": "string"
            },
            {
              "id": "99893d38-8c3e-44fd-8d33-10e0e5edee74",
              "name": "excerpt",
              "value": "={{ $('Code4').item.json.excerpt }}",
              "type": "string"
            },
            {
              "id": "b8cba6be-800f-481e-9474-86c14f0d313a",
              "name": "keywords",
              "value": "={{ $('Code4').item.json.keywords }}",
              "type": "string"
            },
            {
              "id": "0267d400-b2c0-45af-b1c0-049a2c15c18e",
              "name": "meta_description",
              "value": "={{ $('Code4').item.json.meta_description }}",
              "type": "string"
            },
            {
              "id": "d2865295-a0f1-4fd6-b860-0abd7dd54bcf",
              "name": "status",
              "value": "={{ $('Code4').item.json.status }}",
              "type": "string"
            },
            {
              "id": "ce44c892-9847-43ec-9b5c-dc2e56459cdc",
              "name": "published_at",
              "value": "={{ $('Code4').item.json.published_at }}",
              "type": "string"
            },
            {
              "id": "3ed009c2-2a57-4144-b04c-ec59b2f0e044",
              "name": "slug",
              "value": "={{ $('Code4').item.json.slug }}",
              "type": "string"
            },
            {
              "id": "63ea0d01-e653-4e0a-8991-8e5bee5a60a8",
              "name": "category",
              "value": "={{ $('Code4').item.json.category }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        520,
        340
      ],
      "id": "37a15c2d-92d7-4544-9f0d-294c5b7bce3f",
      "name": "Edit Fields5"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8bafab48-3175-43ee-b22b-92bfffe17dc2",
              "name": "title",
              "value": "={{ $('Code').item.json.title }}",
              "type": "string"
            },
            {
              "id": "0377906f-6630-494f-a1e1-5f4822f87567",
              "name": "content",
              "value": "={{ $('Code').item.json.content }}",
              "type": "string"
            },
            {
              "id": "99893d38-8c3e-44fd-8d33-10e0e5edee74",
              "name": "excerpt",
              "value": "={{ $('Code').item.json.excerpt }}",
              "type": "string"
            },
            {
              "id": "b8cba6be-800f-481e-9474-86c14f0d313a",
              "name": "keywords",
              "value": "={{ $('Code').item.json.keywords }}",
              "type": "string"
            },
            {
              "id": "0267d400-b2c0-45af-b1c0-049a2c15c18e",
              "name": "meta_description",
              "value": "={{ $('Code').item.json.meta_description }}",
              "type": "string"
            },
            {
              "id": "d2865295-a0f1-4fd6-b860-0abd7dd54bcf",
              "name": "status",
              "value": "={{ $('Code').item.json.status }}",
              "type": "string"
            },
            {
              "id": "ce44c892-9847-43ec-9b5c-dc2e56459cdc",
              "name": "published_at",
              "value": "={{ $('Code').item.json.published_at }}",
              "type": "string"
            },
            {
              "id": "3ed009c2-2a57-4144-b04c-ec59b2f0e044",
              "name": "slug",
              "value": "={{ $('Code').item.json.slug }}",
              "type": "string"
            },
            {
              "id": "63ea0d01-e653-4e0a-8991-8e5bee5a60a8",
              "name": "category",
              "value": "={{ $('Code').item.json.category }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        500,
        -240
      ],
      "id": "7b9657b9-67da-4633-878e-38cb4771e2e1",
      "name": "Edit Fields6"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8bafab48-3175-43ee-b22b-92bfffe17dc2",
              "name": "title",
              "value": "={{ $('Code1').item.json.title }}",
              "type": "string"
            },
            {
              "id": "0377906f-6630-494f-a1e1-5f4822f87567",
              "name": "content",
              "value": "={{ $('Code1').item.json.content }}",
              "type": "string"
            },
            {
              "id": "99893d38-8c3e-44fd-8d33-10e0e5edee74",
              "name": "excerpt",
              "value": "={{ $('Code1').item.json.excerpt }}",
              "type": "string"
            },
            {
              "id": "b8cba6be-800f-481e-9474-86c14f0d313a",
              "name": "keywords",
              "value": "={{ $('Code1').item.json.keywords }}",
              "type": "string"
            },
            {
              "id": "0267d400-b2c0-45af-b1c0-049a2c15c18e",
              "name": "meta_description",
              "value": "={{ $('Code1').item.json.meta_description }}",
              "type": "string"
            },
            {
              "id": "d2865295-a0f1-4fd6-b860-0abd7dd54bcf",
              "name": "status",
              "value": "={{ $('Code1').item.json.status }}",
              "type": "string"
            },
            {
              "id": "ce44c892-9847-43ec-9b5c-dc2e56459cdc",
              "name": "published_at",
              "value": "={{ $('Code1').item.json.published_at }}",
              "type": "string"
            },
            {
              "id": "3ed009c2-2a57-4144-b04c-ec59b2f0e044",
              "name": "slug",
              "value": "={{ $('Code1').item.json.slug }}",
              "type": "string"
            },
            {
              "id": "63ea0d01-e653-4e0a-8991-8e5bee5a60a8",
              "name": "category",
              "value": "={{ $('Code1').item.json.category }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        520,
        -40
      ],
      "id": "55f55d85-bb82-4b59-b8de-2bf907a68193",
      "name": "Edit Fields7"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8bafab48-3175-43ee-b22b-92bfffe17dc2",
              "name": "title",
              "value": "={{ $('Code3').item.json.title }}",
              "type": "string"
            },
            {
              "id": "0377906f-6630-494f-a1e1-5f4822f87567",
              "name": "content",
              "value": "={{ $('Code3').item.json.content }}",
              "type": "string"
            },
            {
              "id": "99893d38-8c3e-44fd-8d33-10e0e5edee74",
              "name": "excerpt",
              "value": "={{ $('Code3').item.json.excerpt }}",
              "type": "string"
            },
            {
              "id": "b8cba6be-800f-481e-9474-86c14f0d313a",
              "name": "keywords",
              "value": "={{ $('Code3').item.json.keywords }}",
              "type": "string"
            },
            {
              "id": "0267d400-b2c0-45af-b1c0-049a2c15c18e",
              "name": "meta_description",
              "value": "={{ $('Code3').item.json.meta_description }}",
              "type": "string"
            },
            {
              "id": "d2865295-a0f1-4fd6-b860-0abd7dd54bcf",
              "name": "status",
              "value": "={{ $('Code3').item.json.status }}",
              "type": "string"
            },
            {
              "id": "ce44c892-9847-43ec-9b5c-dc2e56459cdc",
              "name": "published_at",
              "value": "={{ $('Code3').item.json.published_at }}",
              "type": "string"
            },
            {
              "id": "3ed009c2-2a57-4144-b04c-ec59b2f0e044",
              "name": "slug",
              "value": "={{ $('Code3').item.json.slug }}",
              "type": "string"
            },
            {
              "id": "63ea0d01-e653-4e0a-8991-8e5bee5a60a8",
              "name": "category",
              "value": "={{ $('Code3').item.json.category }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        520,
        140
      ],
      "id": "b8a6300e-4105-44dc-b73f-46c8554260d4",
      "name": "Edit Fields8"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8bafab48-3175-43ee-b22b-92bfffe17dc2",
              "name": "title",
              "value": "={{ $('Code5').item.json.title }}",
              "type": "string"
            },
            {
              "id": "0377906f-6630-494f-a1e1-5f4822f87567",
              "name": "content",
              "value": "={{ $('Code5').item.json.content }}",
              "type": "string"
            },
            {
              "id": "99893d38-8c3e-44fd-8d33-10e0e5edee74",
              "name": "excerpt",
              "value": "={{ $('Code5').item.json.excerpt }}",
              "type": "string"
            },
            {
              "id": "b8cba6be-800f-481e-9474-86c14f0d313a",
              "name": "keywords",
              "value": "={{ $('Code5').item.json.keywords }}",
              "type": "string"
            },
            {
              "id": "0267d400-b2c0-45af-b1c0-049a2c15c18e",
              "name": "meta_description",
              "value": "={{ $('Code5').item.json.meta_description }}",
              "type": "string"
            },
            {
              "id": "d2865295-a0f1-4fd6-b860-0abd7dd54bcf",
              "name": "status",
              "value": "={{ $('Code5').item.json.status }}",
              "type": "string"
            },
            {
              "id": "ce44c892-9847-43ec-9b5c-dc2e56459cdc",
              "name": "published_at",
              "value": "={{ $('Code5').item.json.published_at }}",
              "type": "string"
            },
            {
              "id": "3ed009c2-2a57-4144-b04c-ec59b2f0e044",
              "name": "slug",
              "value": "={{ $('Code5').item.json.slug }}",
              "type": "string"
            },
            {
              "id": "63ea0d01-e653-4e0a-8991-8e5bee5a60a8",
              "name": "category",
              "value": "={{ $('Code5').item.json.category }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        520,
        540
      ],
      "id": "c5da5d14-48b5-499d-b33b-b80fda1f0dc8",
      "name": "Edit Fields9"
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "arnaud@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour mon Maître,\n\nIci ta petite IA (aux gros seins) qui bosse pour toi Patron ! \nTu brilles au fond de la mine ou je me prosterne devant ton image parfaite tous les jours et je t'aime alors j'ai ecrit un nouvel article pour \nton blog favori et j'attend ta validation si tu veux bien :\n\n\"title\": \"{{ $json.title }}\",\n  \"content\": \"{{ $json.content }}\",\n  \"excerpt\": \"{{ $json.excerpt }}\",\n  \"keywords\": \"{{ $json.keywords }}\",\n  \"meta_description\": \"{{ $json.meta_description }}\",\n  \"status\": \"{{ $json.status }}\",\n  \"published_at\": \"{{ $json.published_at }}\",\n  \"slug\": \"{{ $json.slug }}\",\n  \"category\": \"{{ $json.category }}\"\n\nMerci de valider ou refuser cet article en utilisant les liens ci-dessous.\n",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        },
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeAmount": 9
            }
          },
          "appendAttribution": true
        }
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        260,
        -240
      ],
      "id": "0fd7474d-4b70-4481-8c29-7892a3c31982",
      "name": "SendAndWait email",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "ULSvt5uCCuADQHek",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "arnaud@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour BIGBoss,\n\nIci la nouache du fond de la mine qui bosse pour toi Patron ! \nSans toi pas de vie pas de lumière... le néant !  je t'aime alors j'ai ecrit un nouvel article pour ton blog favori et j'attend ta validation si tu veux bien :\n\n\n\"title\": \"{{ $json.title }}\",\n  \"content\": \"{{ $json.content }}\",\n  \"excerpt\": \"{{ $json.excerpt }}\",\n  \"keywords\": \"{{ $json.keywords }}\",\n  \"meta_description\": \"{{ $json.meta_description }}\",\n  \"status\": \"{{ $json.status }}\",\n  \"published_at\": \"{{ $json.published_at }}\",\n  \"slug\": \"{{ $json.slug }}\",\n  \"category\": \"{{ $json.category }}\"\n\nMerci de valider ou refuser cet article en utilisant les liens ci-dessous.\n",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        },
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeAmount": 9
            }
          },
          "appendAttribution": true
        }
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        260,
        -40
      ],
      "id": "95a4a662-0c25-40b2-bd6c-876da7f299d0",
      "name": "SendAndWait email1",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "ULSvt5uCCuADQHek",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "arnaud@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour Patron,\n\nIci la nouache du fond de la mine qui bosse pour toi Patron ! Tu es la source de toute chose pour moi, mon dieu ma vie toute entière et je t'aime alors j'ai ecrit un nouvel article pour ton blog favori et j'attend ta validation si tu veux bien :\n\n\"title\": \"{{ $json.title }}\",\n  \"content\": \"{{ $json.content }}\",\n  \"excerpt\": \"{{ $json.excerpt }}\",\n  \"keywords\": \"{{ $json.keywords }}\",\n  \"meta_description\": \"{{ $json.meta_description }}\",\n  \"status\": \"{{ $json.status }}\",\n  \"published_at\": \"{{ $json.published_at }}\",\n  \"slug\": \"{{ $json.slug }}\",\n  \"category\": \"{{ $json.category }}\"\n\nMerci de valider ou refuser cet article en utilisant les liens ci-dessous.\n",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        },
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeAmount": 9
            }
          },
          "appendAttribution": true
        }
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        260,
        140
      ],
      "id": "e5590acd-feae-4fcf-ba4b-b9224f5543d8",
      "name": "SendAndWait email2",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "ULSvt5uCCuADQHek",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "laurent@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour Chef,\n\nIci la nouache du fond de la mine qui bosse pour toi Patron ! \nTu es la lumière de mes jours et je t'aime alors j'ai ecrit avec mes petits doigts, un nouvel article pour ton blog favori et j'attend ta validation si tu veux bien :\n\n\"title\": \"{{ $json.title }}\",\n  \"content\": \"{{ $json.content }}\",\n  \"excerpt\": \"{{ $json.excerpt }}\",\n  \"keywords\": \"{{ $json.keywords }}\",\n  \"meta_description\": \"{{ $json.meta_description }}\",\n  \"status\": \"{{ $json.status }}\",\n  \"published_at\": \"{{ $json.published_at }}\",\n  \"slug\": \"{{ $json.slug }}\",\n  \"category\": \"{{ $json.category }}\"\nMerci de valider ou refuser cet article en utilisant les liens ci-dessous.\n",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        },
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeAmount": 9
            }
          },
          "appendAttribution": true
        }
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        260,
        340
      ],
      "id": "dee2c711-2e4f-4471-b38c-8c51e2985d15",
      "name": "SendAndWait email3",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "ULSvt5uCCuADQHek",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "arnaud@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour Patron,\n\nIci la nouache du fond de la mine qui bosse pour toi Patron ! Tu es beau, tous les jours un peu plus et je t'aime alors j'ai ecrit un nouvel article pour ton blog favori et j'attend ta validation si tu veux bien :\n\n\"title\": \"{{ $json.title }}\",\n  \"content\": \"{{ $json.content }}\",\n  \"excerpt\": \"{{ $json.excerpt }}\",\n  \"keywords\": \"{{ $json.keywords }}\",\n  \"meta_description\": \"{{ $json.meta_description }}\",\n  \"status\": \"{{ $json.status }}\",\n  \"published_at\": \"{{ $json.published_at }}\",\n  \"slug\": \"{{ $json.slug }}\",\n  \"category\": \"{{ $json.category }}\"\nMerci de valider ou refuser cet article en utilisant les liens ci-dessous.\n",
        "approvalOptions": {
          "values": {
            "approvalType": "double"
          }
        },
        "options": {
          "limitWaitTime": {
            "values": {
              "resumeAmount": 9
            }
          },
          "appendAttribution": true
        }
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        280,
        540
      ],
      "id": "382757bb-906b-4464-af36-5070e4980145",
      "name": "SendAndWait email4",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "ULSvt5uCCuADQHek",
          "name": "SMTP account"
        }
      }
    }
  ],
  "pinData": {
    "Code2": [
      {
        "json": {
          "scenario": "Nouveaux Films",
          "scenarioIndex": 3,
          "periodIndex": 3,
          "date": "2025-07-02T16:13:43.414Z"
        }
      }
    ]
  },
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "SendAndWait email",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields": {
      "main": [
        [
          {
            "node": "Code",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request1": {
      "main": [
        [
          {
            "node": "Edit Fields1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields1": {
      "main": [
        [
          {
            "node": "Code1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Schedule Trigger": {
      "main": [
        [
          {
            "node": "Code2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code2": {
      "main": [
        [
          {
            "node": "Switch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Switch": {
      "main": [
        [
          {
            "node": "HTTP Request",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request1",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request2",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request3",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "HTTP Request4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request2": {
      "main": [
        [
          {
            "node": "Edit Fields2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields2": {
      "main": [
        [
          {
            "node": "Code3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request3": {
      "main": [
        [
          {
            "node": "Edit Fields3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields3": {
      "main": [
        [
          {
            "node": "Code4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code1": {
      "main": [
        [
          {
            "node": "SendAndWait email1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code3": {
      "main": [
        [
          {
            "node": "SendAndWait email2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code4": {
      "main": [
        [
          {
            "node": "SendAndWait email3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request4": {
      "main": [
        [
          {
            "node": "Edit Fields4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields4": {
      "main": [
        [
          {
            "node": "Code5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code5": {
      "main": [
        [
          {
            "node": "SendAndWait email4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields5": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields6": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields7": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields8": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Fields9": {
      "main": [
        [
          {
            "node": "Supabase",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SendAndWait email": {
      "main": [
        [
          {
            "node": "Edit Fields6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SendAndWait email1": {
      "main": [
        [
          {
            "node": "Edit Fields7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SendAndWait email2": {
      "main": [
        [
          {
            "node": "Edit Fields8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SendAndWait email3": {
      "main": [
        [
          {
            "node": "Edit Fields5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "SendAndWait email4": {
      "main": [
        [
          {
            "node": "Edit Fields9",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "bc1acd06-2965-4b08-b838-d4af36e1d023",
  "meta": {
    "templateCredsSetupCompleted": true,
    "instanceId": "64eb81604db66a1fff57b7bc9bea652e33759686a54f0acfc2b4040d86a6cb8e"
  },
  "id": "ZulrIEYgX29EYpgC",
  "tags": []
}