{
  "id": "AKfISaE8hA8EZPhV",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Auto-Generate Facebook Posts from Video Insights with Dumpling AI + GPT-4o",
  "tags": [],
  "nodes": [
    {
      "id": "db55c7d2-85d7-4933-a8c6-8946a3772c2d",
      "name": "Trigger on New Video Upload",
      "type": "n8n-nodes-base.googleDriveTrigger",
      "position": [
        -1020,
        0
      ],
      "parameters": {
        "event": "fileCreated",
        "options": {},
        "pollTimes": {
          "item": [
            {
              "mode": "everyMinute"
            }
          ]
        },
        "triggerOn": "specificFolder",
        "folderToWatch": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://drive.google.com/drive/folders/1NU00YbKNiHJptNuQZH6kgVUhLvDzE0ka",
          "cachedResultName": "n8n-video"
        }
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "4b9e7acf-794e-4938-9e11-532db5c15e34",
      "name": "Download Video File",
      "type": "n8n-nodes-base.googleDrive",
      "position": [
        -800,
        0
      ],
      "parameters": {
        "fileId": {
          "__rl": true,
          "mode": "id",
          "value": "={{ $json.id }}"
        },
        "options": {},
        "operation": "download"
      },
      "credentials": {
        "googleDriveOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 3
    },
    {
      "id": "088c9db2-8a26-4555-9f45-0212170670ac",
      "name": "Convert Video to Base64",
      "type": "n8n-nodes-base.extractFromFile",
      "position": [
        -580,
        0
      ],
      "parameters": {
        "options": {},
        "operation": "binaryToPropery"
      },
      "typeVersion": 1
    },
    {
      "id": "ad4f47e1-ec0a-4194-adce-3bc4be074353",
      "name": "Extract Key Insights with Dumpling AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        -360,
        0
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/extract-video",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"inputMethod\": \"base64\",\n  \"video\": \"{{ $json.data }}\",\n  \"prompt\": \"You are an AI assistant that extracts key insights from a video transcript related to automation or technical tutorials. From the content, identify and return the following details clearly: 1. Topic of the video, 2. Main tools or platforms mentioned (e.g. N8N, 11Labs), 3. Purpose of the tutorial, 4. Key steps shared or demonstrated, 5. Important modules or actions discussed, 6. Any use case or real-world application mentioned, 7. Specific tips, issues, or recommendations shared by the creator. Focus only on the core lesson, and ignore filler intro or closing remarks unless they contain critical information. Respond only with the extracted data, do not repeat the transcript. Return your result in clean and structured JSON.\",\n  \"jsonMode\": true\n}\n",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "0c7cfd0f-0d99-410a-ac00-0d18926f1dba",
      "name": "Generate Facebook Post & Image Prompt",
      "type": "@n8n/n8n-nodes-langchain.openAi",
      "position": [
        -140,
        0
      ],
      "parameters": {
        "modelId": {
          "__rl": true,
          "mode": "list",
          "value": "chatgpt-4o-latest",
          "cachedResultName": "CHATGPT-4O-LATEST"
        },
        "options": {},
        "messages": {
          "values": [
            {
              "role": "system",
              "content": "=You are a professional content writer and visual assistant. Based on the extracted key points from a technical tutorial video, your task is to do two things:\n\nWrite a short, engaging Facebook post using the extracted content. The post should sound natural and friendly, as if someone is casually sharing something valuable they learned. Focus on the main topic, tools mentioned, what was demonstrated, and why it matters. Avoid technical jargon, hashtags, or links unless included in the content. Keep it between 100 and 150 words.\n\nCreate a simple image prompt idea that could be used to generate a visual for the post. The image should support the post\u2019s topic (e.g., showing a voice assistant, an automation flow, or AI tools in action). The prompt should be descriptive but concise, suitable for text-to-image generation.\n\nReturn your result in this JSON format:\n\n{\n  \"facebook_post\": \"string\",\n  \"image_prompt\": \"string\"\n}\nOnly output the JSON, no explanation or extra text.\n\n\n\n\n\n\n\n\n\n"
            },
            {
              "content": "=Here is the extracted content:{{ $('Extract Key Insights with Dumpling AI').item.json.results }}"
            }
          ]
        },
        "jsonOutput": true
      },
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1.8
    },
    {
      "id": "c0e3ca61-c58f-410c-8d78-a20f368ba6a5",
      "name": "Generate AI Image with Dumpling AI",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        220,
        0
      ],
      "parameters": {
        "url": "https://app.dumplingai.com/api/v1/generate-ai-image",
        "method": "POST",
        "options": {},
        "jsonBody": "={\n  \"model\": \"recraft-v3\",\n  \"input\": {\n    \"prompt\": \"{{ $json.message.content.image_prompt}}\", \n    \"style\": \"any\"\n  }\n}",
        "sendBody": true,
        "specifyBody": "json",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth"
      },
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "9f6d375b-e2e7-4e2f-bab8-77fe1f803514",
      "name": "Save Post and Image URL to Google Sheet",
      "type": "n8n-nodes-base.googleSheets",
      "position": [
        440,
        0
      ],
      "parameters": {
        "columns": {
          "value": {
            "Post": "={{ $('Generate Facebook Post & Image Prompt').item.json.message.content.facebook_post }}",
            "Image URL": "={{ $json.images[0].url }}"
          },
          "schema": [
            {
              "id": "Post",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Post",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            },
            {
              "id": "Image URL",
              "type": "string",
              "display": true,
              "required": false,
              "displayName": "Image URL",
              "defaultMatch": false,
              "canBeUsedToMatch": true
            }
          ],
          "mappingMode": "defineBelow",
          "matchingColumns": [],
          "attemptToConvertTypes": false,
          "convertFieldsToString": false
        },
        "options": {},
        "operation": "append",
        "sheetName": {
          "__rl": true,
          "mode": "list",
          "value": "gid=0",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkLQ4ZZ3qSv8HybYuKyW2BgViUij68ux4_SnoBphmWE/edit#gid=0",
          "cachedResultName": "Sheet1"
        },
        "documentId": {
          "__rl": true,
          "mode": "list",
          "value": "",
          "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1NkLQ4ZZ3qSv8HybYuKyW2BgViUij68ux4_SnoBphmWE/edit?usp=drivesdk",
          "cachedResultName": "facebook post"
        }
      },
      "credentials": {
        "googleSheetsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 4.6
    },
    {
      "id": "7c08f7b1-5540-4a50-bfcb-c93d6ebf89fc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -1000,
        -320
      ],
      "parameters": {
        "width": 680,
        "height": 380,
        "content": "### \ud83d\udccc Workflow Summary\n\nThis workflow listens to a specific Google Drive folder. When a new video is uploaded:\n\n1. It downloads the video file and converts it to base64.\n2. The base64 video is sent to Dumpling AI's `/extract-video` endpoint with a prompt to extract key tutorial insights.\n3. The extracted content is passed to OpenAI (GPT-4o) to generate a short Facebook post and a descriptive image prompt.\n4. The prompt is then used to generate an AI image using Dumpling AI's image endpoint.\n5. Finally, the Facebook post and image URL are logged in a Google Sheet for easy publishing or review.\n\nUse this workflow to automate content repurposing from your technical videos.\n"
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "7925d4c9-da76-43aa-a3ff-6a8fda9103d5",
  "connections": {
    "Download Video File": {
      "main": [
        [
          {
            "node": "Convert Video to Base64",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Convert Video to Base64": {
      "main": [
        [
          {
            "node": "Extract Key Insights with Dumpling AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Trigger on New Video Upload": {
      "main": [
        [
          {
            "node": "Download Video File",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate AI Image with Dumpling AI": {
      "main": [
        [
          {
            "node": "Save Post and Image URL to Google Sheet",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract Key Insights with Dumpling AI": {
      "main": [
        [
          {
            "node": "Generate Facebook Post & Image Prompt",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Generate Facebook Post & Image Prompt": {
      "main": [
        [
          {
            "node": "Generate AI Image with Dumpling AI",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}