{
  "id": "iFQVBMkzOaaImF1b",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Turn Uploaded Videos into AI-Generated Blog Research with Dumpling AI & ChatGPT",
  "tags": [],
  "nodes": [
    {
      "id": "b4cd7b7e-c7f6-4929-8772-d8d49e209db6",
      "name": "Watch Uploaded Videos",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -780,
        -60
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "1qh0vXJpLpoeXsfe0OFlbClBwDYqApn1A",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1qh0vXJpLpoeXsfe0OFlbClBwDYqApn1A",
          "cachedResultName": "Video"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "dafd1e7a-cf22-4ee9-832f-406db230068c",
      "name": "Download Video",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -560,
        -60
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "a9416012-f251-4156-a8fe-d06847ec1268",
      "name": "Convert Video to Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -340,
        -60
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "3f9cc134-5e8c-4496-a16a-eb701907d657",
      "name": "Transcribe with Dumpling AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -120,
        -60
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/extract-video",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"inputMethod\": \"base64\",\n  \"video\": \"{{$json.data}}\",\n  \"prompt\": \"extract everything spoken in this video word for word. Include timestamps for each sentence, identify different speakers if possible, and return only the full transcription without any explanations or extra formatting.\"\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "64f39f44-577c-4c60-8be2-fc9ea39e802c",
      "name": "Extract Keywords with OpenAI",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        100,
        -60
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "You are given the full transcript of a YouTube video. Analyze the transcript and return exactly five high-impact keywords or keyword phrases that best represent the main topics and ideas discussed in the video. Focus on terms that are relevant for SEO, content tagging, or summarizing the video\u2019s core message. Return only the keywords in a simple comma-separated format, nothing else."
            },
            {
              "content": "=Here is the transcript: {{ $json.results }}"
            }
          ]
        }
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "8557c87e-53c8-4bf6-8b35-e13981a0a5fe",
      "name": "Run Competitor Research via Dumpling AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        476,
        -60
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/agents/generate-completion",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"messages\": [\n    {\n      \"role\": \"user\",\n      \"content\":\" {{ $json.message.content }}\"\n    }\n  ],\n  \"agentId\": \"79e8a289-8e4a-46f5-8cc2-abeceb8ae9e4\",\n  \"parseJson\": true\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "5a2d59bc-73d5-437e-bc2f-cef6783d3533",
      "name": "Format Results for Google Sheets",
      "type": "n8n-nodes-base.code",
      "position": [
        700,
        -60
      ],
      "parameters": {
        "jsCode": "return items.map(item => {\n  const perplexity = item.json.parsedJson?.topicsFromPerplexity || [];\n  const google = item.json.parsedJson?.blogPostsFromGoogle || [];\n\n  const formattedPerplexity = perplexity.map(p => {\n    return `Title: ${p.title}\\nSummary: ${p.summary}\\nNotes: ${p.notes}`;\n  }).join('\\n\\n');\n\n  const formattedGoogle = google.map(g => {\n    return `Title: ${g.title}\\nURL: ${g.url}\\nSummary: ${g.summary}`;\n  }).join('\\n\\n');\n\n  return {\n    json: {\n      perplexityOutput: formattedPerplexity,\n      googleSearchOutput: formattedGoogle\n    }\n  };\n});\n\n"
      },
      "typeVersion": 2
    },
    {
      "id": "c7610f48-f86a-4be7-8087-04438ed2f023",
      "name": "Append to Google Sheets",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        916,
        -60
      ],
      "parameters": {
        "columns": {
          "value": {
            "Keywords": "={{ $('Extract Keywords with OpenAI').item.json.message.content }}",
            "blogPostsFromGoogle": "={{ $json.googleSearchOutput }}",
            "topicsFromPerplexity": "={{ $json.perplexityOutput }}"
          },
          "schema": [
            {
              "id": "Keywords",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Keywords",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "topicsFromPerplexity",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "topicsFromPerplexity",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "blogPostsFromGoogle",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "blogPostsFromGoogle",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10J1qtgITl76XcuNqUdv5lWcPRJt5sfuhHnYE6L2jsjo/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/10J1qtgITl76XcuNqUdv5lWcPRJt5sfuhHnYE6L2jsjo/edit?usp=drivesdk",
          "cachedResultName": "Agent"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "9eba3491-e0b6-49d6-a63f-63eaaf1125b3",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -780,
        -360
      ],
      "parameters": {
        "width": 800,
        "height": 560,
        "content": "## \ud83c\udfac AI Video to Blog Research Automation\n\nThis workflow triggers when a video is uploaded to a specific Google Drive folder.\n\nIt performs the following steps:\n\n1. Downloads the video and converts it to base64  \n2. Sends it to **Dumpling AI** for transcription  \n3. Extracts 5 keywords using **OpenAI GPT-4o**  \n4. Passes the keywords to a **Dumpling AI Agent** for research via **Perplexity** and **Google Search**  \n5. Formats and saves the results to **Google Sheets**\n\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "d652cd56-47ab-4493-b51d-fa8b95b5f195",
  "connections": {
    "Download Video": {
      "main": [
        [
          {
            "node": "Convert Video to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Watch Uploaded Videos": {
      "main": [
        [
          {
            "node": "Download Video",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Video to Base64": {
      "main": [
        [
          {
            "node": "Transcribe with Dumpling AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Transcribe with Dumpling AI": {
      "main": [
        [
          {
            "node": "Extract Keywords with OpenAI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Keywords with OpenAI": {
      "main": [
        [
          {
            "node": "Run Competitor Research via Dumpling AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Format Results for Google Sheets": {
      "main": [
        [
          {
            "node": "Append to Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Run Competitor Research via Dumpling AI": {
      "main": [
        [
          {
            "node": "Format Results for Google Sheets",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}