{
  "name": "perplexity to supabase",
  "nodes": [
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 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"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"llama-3.1-sonar-small-128k-online\",\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,
        -680
      ],
      "id": "cebfc95d-b925-4907-8076-e8c956ecdc7e",
      "name": "HTTP Request"
    },
    {
      "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": [
        820,
        -680
      ],
      "id": "fb4bf66f-4684-4889-8e69-76be9d9cbfc0",
      "name": "Code"
    },
    {
      "parameters": {
        "tableId": "cinema_articles",
        "dataToSend": "autoMapInputData"
      },
      "type": "n8n-nodes-base.supabase",
      "typeVersion": 1,
      "position": [
        1940,
        -360
      ],
      "id": "8b8434ae-2802-4fa9-84b9-dfa980c62c91",
      "name": "Supabase",
      "credentials": {
        "supabaseApi": {
          "id": "6ZqQBTAFJUkZtels",
          "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 FR",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        600,
        -680
      ],
      "id": "4bdd4dd6-86d4-4cbb-be6a-e93f0349b236",
      "name": "Edit Fields"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 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"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"llama-3.1-sonar-small-128k-online\",\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,
        -480
      ],
      "id": "f3963059-1430-4a13-8485-ae48d9a68c3f",
      "name": "HTTP Request1"
    },
    {
      "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": [
        820,
        -480
      ],
      "id": "351ade60-b7c1-4e8e-b8c3-5c32ff126a3b",
      "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": "Actualités FR",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        600,
        -480
      ],
      "id": "4b52e3fa-d6db-45a2-bd55-b457a61c8eb2",
      "name": "Edit Fields1"
    },
    {
      "parameters": {
        "rule": {
          "interval": [
            {
              "field": "hours",
              "hoursInterval": 12
            }
          ]
        }
      },
      "type": "n8n-nodes-base.scheduleTrigger",
      "typeVersion": 1.2,
      "position": [
        -260,
        -720
      ],
      "id": "fa9deccd-0189-48f4-9b03-589dc68e6512",
      "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// Calcul du nombre de périodes de 12h depuis le début du mois\nconst hoursSinceMonthStart = ((now.getDate() - 1) * 24) + now.getHours();\nconst periodIndex = Math.floor(hoursSinceMonthStart / 12);\nconst scenarioIndex = periodIndex % scenarios.length;\nconst scenario = scenarios[scenarioIndex];\n\nreturn [{ scenario, scenarioIndex, periodIndex, date: now.toISOString() }];\n"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -60,
        -700
      ],
      "id": "313614e6-d561-4c38-a3fb-38e3e94f120b",
      "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": [
        160,
        -700
      ],
      "id": "0046d22a-4ef8-4523-96bc-fd58a7650089",
      "name": "Switch"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 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"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"llama-3.1-sonar-small-128k-online\",\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,
        -280
      ],
      "id": "691bbb22-988f-4b2c-9a1e-eb6518aab813",
      "name": "HTTP Request2"
    },
    {
      "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": [
        820,
        -280
      ],
      "id": "d0ee9cd2-4058-4b99-bd07-b8f362bd7230",
      "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": "Actualités FR",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        600,
        -280
      ],
      "id": "4f436ce9-7574-41ad-b255-63fd2ea19f3c",
      "name": "Edit Fields2"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 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"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"llama-3.1-sonar-small-128k-online\",\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 films de cinéma qui viennent de sortir en salle. 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,
        -100
      ],
      "id": "b602441a-7bc9-46cd-9f5e-a287ab8a2538",
      "name": "HTTP Request3"
    },
    {
      "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": [
        820,
        -100
      ],
      "id": "530e55dc-6f26-440f-a96a-1046b73ea2d1",
      "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": [
        600,
        -100
      ],
      "id": "53ab017f-650d-4d1a-a5b5-ae700898504e",
      "name": "Edit Fields3"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.perplexity.ai/chat/completions\n",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "Bearer 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"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "{\n  \"model\": \"llama-3.1-sonar-small-128k-online\",\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,
        100
      ],
      "id": "85cbf9bd-e8db-4f40-9205-2a514e8e3b1e",
      "name": "HTTP Request4"
    },
    {
      "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": [
        820,
        100
      ],
      "id": "3eec6820-fdf0-4d78-98e0-12bd9579079c",
      "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": "Actualités FR",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        600,
        100
      ],
      "id": "bf35230d-ed1b-4164-a160-0b8cf8addee6",
      "name": "Edit Fields4"
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "laurent@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour Patron,\n\nIci ta petite IA (aux gros seins) qui bosse pour toi Patron ! \nTu brilles au fond de la mine 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",
        "options": {}
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1020,
        -680
      ],
      "id": "34966edf-457c-489c-a68b-28f758892494",
      "name": "Send Email",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "gj3ATSptCpsjc1bd",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "laurent@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour Arnaud,\n\nIci la nouache du fond de la mine qui bosse pour toi Patron ! \nSans toi pas de vie pas d'amour 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",
        "options": {}
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1020,
        -480
      ],
      "id": "56f1dd62-a50a-430a-9385-a5601c784860",
      "name": "Send Email1",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "gj3ATSptCpsjc1bd",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "laurent@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",
        "options": {}
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1020,
        -300
      ],
      "id": "159ca59d-0605-42d8-a095-ec0ffe359c17",
      "name": "Send Email2",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "gj3ATSptCpsjc1bd",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "laurent@lorbacproductions.com",
        "subject": "=“Nouvel article à valider : {{$json[\"title\"]}}”",
        "message": "=Bonjour Arnaud,\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 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",
        "options": {}
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1020,
        -100
      ],
      "id": "347203a1-4553-4566-bcaf-65c4be921948",
      "name": "Send Email3",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "gj3ATSptCpsjc1bd",
          "name": "SMTP account"
        }
      }
    },
    {
      "parameters": {
        "operation": "sendAndWait",
        "fromEmail": "blog@filmoramax.com",
        "toEmail": "laurent@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",
        "options": {}
      },
      "type": "n8n-nodes-base.emailSend",
      "typeVersion": 2.1,
      "position": [
        1040,
        100
      ],
      "id": "d6067711-8eba-4017-89c0-339efaca840d",
      "name": "Send Email4",
      "webhookId": "105fcbcf-6250-43d7-a6a3-b982c8ab9c71",
      "credentials": {
        "smtp": {
          "id": "gj3ATSptCpsjc1bd",
          "name": "SMTP account"
        }
      }
    },
    {
      "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": [
        1280,
        -140
      ],
      "id": "5a5f913a-4c63-42c1-b988-166545aa590e",
      "name": "Edit Fields5"
    },
    {
      "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": [
        1260,
        -660
      ],
      "id": "234579e1-ff42-4aac-adb9-42fcfd292e27",
      "name": "Edit Fields6"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "8bafab48-3175-43ee-b22b-92bfffe17dc2",
              "name": "title",
              "value": "={{ $('Code2').item.json.title }}",
              "type": "string"
            },
            {
              "id": "0377906f-6630-494f-a1e1-5f4822f87567",
              "name": "content",
              "value": "={{ $('Code2').item.json.content }}",
              "type": "string"
            },
            {
              "id": "99893d38-8c3e-44fd-8d33-10e0e5edee74",
              "name": "excerpt",
              "value": "={{ $('Code2').item.json.excerpt }}",
              "type": "string"
            },
            {
              "id": "b8cba6be-800f-481e-9474-86c14f0d313a",
              "name": "keywords",
              "value": "={{ $('Code2').item.json.keywords }}",
              "type": "string"
            },
            {
              "id": "0267d400-b2c0-45af-b1c0-049a2c15c18e",
              "name": "meta_description",
              "value": "={{ $('Code2').item.json.meta_description }}",
              "type": "string"
            },
            {
              "id": "d2865295-a0f1-4fd6-b860-0abd7dd54bcf",
              "name": "status",
              "value": "={{ $('Code2').item.json.status }}",
              "type": "string"
            },
            {
              "id": "ce44c892-9847-43ec-9b5c-dc2e56459cdc",
              "name": "published_at",
              "value": "={{ $('Code2').item.json.published_at }}",
              "type": "string"
            },
            {
              "id": "3ed009c2-2a57-4144-b04c-ec59b2f0e044",
              "name": "slug",
              "value": "={{ $('Code2').item.json.slug }}",
              "type": "string"
            },
            {
              "id": "63ea0d01-e653-4e0a-8991-8e5bee5a60a8",
              "name": "category",
              "value": "={{ $('Code2').item.json.category }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        1280,
        -480
      ],
      "id": "9455438b-a647-4845-bf28-eac8df4e7db2",
      "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": [
        1280,
        -300
      ],
      "id": "8d577014-5805-41e0-9709-e18215cf88ed",
      "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": [
        1280,
        60
      ],
      "id": "dfe173d9-ca19-400a-8590-b9be19b0152f",
      "name": "Edit Fields9"
    }
  ],
  "connections": {
    "HTTP Request": {
      "main": [
        [
          {
            "node": "Edit Fields",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code": {
      "main": [
        [
          {
            "node": "Send 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": "Send Email1",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code3": {
      "main": [
        [
          {
            "node": "Send Email2",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Code4": {
      "main": [
        [
          {
            "node": "Send 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": "Send Email4",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email": {
      "main": [
        [
          {
            "node": "Edit Fields6",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email1": {
      "main": [
        [
          {
            "node": "Edit Fields7",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email2": {
      "main": [
        [
          {
            "node": "Edit Fields8",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email3": {
      "main": [
        [
          {
            "node": "Edit Fields5",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Email4": {
      "main": [
        [
          {
            "node": "Edit Fields9",
            "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
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "staticData": null,
  "pinData": {
    "Code2": [
      {
        "json": {
          "scenario": "Nouveaux Films",
          "scenarioIndex": 3,
          "periodIndex": 3,
          "date": "2025-07-02T16:13:43.414Z"
        }
      }
    ]
  },
  "triggerCount": 0,
  "meta": {
    "templateCredsSetupCompleted": true
  }
}