N
n8n Store
Workflow Market
Analyze YouTube Videos and Generate Summaries with Gemini AI

Analyze YouTube Videos and Generate Summaries with Gemini AI

by adrian-bent0 views

Description

Categories

🤖 AI & Machine Learning

Nodes Used

n8n-nodes-base.coden8n-nodes-base.formn8n-nodes-base.formn8n-nodes-base.stickyNoten8n-nodes-base.stickyNoten8n-nodes-base.formTriggern8n-nodes-base.httpRequest
PriceGratis
Views0
Last Updated11/28/2025
workflow.json
{
  "id": "7w2fAlYbwQEQL0hI",
  "meta": {
    "instanceId": "b9a4810a9a51f2cd27d6d88b2b57f7ecf9f947c4f003311c8382943a4b6c6dc4",
    "templateCredsSetupCompleted": true
  },
  "name": "Analyze YouTube Videos and Generate Summaries with Gemini AI",
  "tags": [],
  "nodes": [
    {
      "id": "86080cc2-d2fb-4901-8beb-76c6c736edba",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        -208
      ],
      "parameters": {
        "color": 3,
        "width": 320,
        "height": 220,
        "content": "## Note \nThis workflow takes as input a YouTube link (required) and a description of what you want to analyze from the video. If the description field is left empty, the default prompt will generate a detailed summary and description of the video's contents. However, you can ask for something more specific using this field/input."
      },
      "typeVersion": 1
    },
    {
      "id": "42d3b4b8-67e6-4267-96a9-d44dc31af1ec",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -704,
        -96
      ],
      "parameters": {
        "width": 1100,
        "height": 280,
        "content": "## Analyze YouTube Videos and Generate Summaries with Gemini AI\n"
      },
      "typeVersion": 1
    },
    {
      "id": "7fc7e689-dab2-4341-a1c6-43053eebe8e1",
      "name": "Get Input",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        -656,
        0
      ],
      "webhookId": "00f1dd2d-2e75-4f8e-b707-388308be0cfb",
      "parameters": {
        "options": {},
        "formTitle": "Analyze YouTube Videos and Generate Summaries with Gemini AI",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Video URL",
              "placeholder": "www.youtube",
              "requiredField": true
            },
            {
              "fieldLabel": "What do you want?",
              "placeholder": " Summarize in 3 sentences"
            }
          ]
        },
        "formDescription": "I'll analyze the contents of your YouTube video!\n"
      },
      "typeVersion": 2.2
    },
    {
      "id": "e8ad8180-5cae-499f-8c12-ddeb03c3bf09",
      "name": "Check if description is empty",
      "type": "n8n-nodes-base.code",
      "notes": "If description is empty asign it the defoult prompt, else use the description given as the prompt to send to Google Gemini",
      "position": [
        -448,
        0
      ],
      "parameters": {
        "jsCode": "// Loop over input items and add a new field called 'myNewField' to the JSON of each one\nfor (const item of $input.all()) {\n  item.json.myNewField = 1;\n\n  if ($input.first().json['What u want?'].trim() == \"\") {\n    $input.first().json['What u want?'] = \"Please be as descriptive as possible about the contents being spoken of in this video after giving a detailed summary.\";\n}\n\n}\n\nreturn $input.all();\n// End of Code"
      },
      "notesInFlow": true,
      "typeVersion": 2
    },
    {
      "id": "8984a78e-7ab1-446a-8cbe-3d09c3a170f2",
      "name": "Get analysis from Google Gemini",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -224,
        0
      ],
      "parameters": {
        "url": "https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"contents\": [\n    {\n      \"parts\": [\n        {\n          \"text\": \"{{ $json['What u want?'] }}\"\n        },\n        {\n          \"file_data\": {\n            \"file_uri\": \"{{ $json.Video }}\"\n          }\n        }\n      ]\n    }\n  ]\n}",
        "sendBody": true,
        "sendHeaders": true,
        "specifyBody": "json",
        "headerParameters": {
          "parameters": [
            {
              "name": "x-goog-api-key"
            }
          ]
        }
      },
      "notesInFlow": false,
      "typeVersion": 4.2
    },
    {
      "id": "10d568a8-1fd7-444e-ba61-be4aeaf3a188",
      "name": "Analysis result",
      "type": "n8n-nodes-base.form",
      "position": [
        0,
        0
      ],
      "webhookId": "6432222b-3381-41cb-a42a-2f0d73537b98",
      "parameters": {
        "options": {
          "formTitle": "Analysis",
          "buttonLabel": "Another Analysis?",
          "formDescription": "={{ $json.candidates[0].content.parts[0].text }}"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "c8acb7a2-9650-4f91-8a74-87317decf812",
      "name": "Redirect for another analysis",
      "type": "n8n-nodes-base.form",
      "position": [
        224,
        0
      ],
      "webhookId": "b4ee5f3b-9d75-430b-8f02-93b1cecdd660",
      "parameters": {
        "operation": "completion",
        "redirectUrl": "=https://n8n.srv885623.hstgr.cloud/form/00f1dd2d-2e75-4f8e-b707-388308be0cfb",
        "respondWith": "redirect"
      },
      "typeVersion": 1
    }
  ],
  "active": true,
  "pinData": {},
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7d972248-7421-4ae0-a0fc-aed7d07a0f13",
  "connections": {
    "Get Input": {
      "main": [
        [
          {
            "node": "Check if description is empty",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Analysis result": {
      "main": [
        [
          {
            "node": "Redirect for another analysis",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Check if description is empty": {
      "main": [
        [
          {
            "node": "Get analysis from Google Gemini",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get analysis from Google Gemini": {
      "main": [
        [
          {
            "node": "Analysis result",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}

相关工作流