What I am trying to make
I’m trying to setup a YouTube automation workflow, but I am having trouble when it comes to being able to upload the thumbnail. The final node (HTTP Request node) keeps outputting “source.on is not a function.” It doesn’t make sense, because the input clearly contains all the necessary binary data. I have tried numerous troubleshooting steps to no avail. Can someone please help me? I am still very new to this and don’t know what to do next. Thank you.
Information on my n8n setup
- n8n version: 1.98.2 (Cloud)
- Operating system: Windows 11
Here is my copied workflow below for reference:
{
“nodes”: [
{
“parameters”: {
“pollTimes”: {
“item”: [
{
“mode”: “everyHour”
}
]
},
“triggerOn”: “specificFolder”,
“folderToWatch”: {
“__rl”: true,
“value”: “14Tc_ixJURlswIyasiYcKjeHDCOVElWDR”,
“mode”: “list”,
“cachedResultName”: “YouTube Video Upload”,
“cachedResultUrl”: “https://drive.google.com/drive/folders/14Tc_ixJURlswIyasiYcKjeHDCOVElWDR”
},
“event”: “folderCreated”
},
“type”: “n8n-nodes-base.googleDriveTrigger”,
“typeVersion”: 1,
“position”: [
-460,
220
],
“id”: “c87f3f40-1fd8-4cf3-ae88-8a332ea2c3ce”,
“name”: “Google Drive Trigger”,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “9RwOKj3eYSXYXwhV”,
“name”: “Google Drive account”
}
}
},
{
“parameters”: {
“resource”: “video”,
“operation”: “upload”,
“title”: “={{ $json.name ? $json.name.replace(/\.(mp4|mov)$/i, ‘’) : ‘Untitled Video’ }}\n”,
“regionCode”: “US”,
“categoryId”: “20”,
“binaryProperty”: “=data”,
“options”: {
“description”: “={{ $(‘Edit Fields’).item.json.description }}”,
“notifySubscribers”: true,
“privacyStatus”: “private”
}
},
“type”: “n8n-nodes-base.youTube”,
“typeVersion”: 1,
“position”: [
700,
40
],
“id”: “63269dae-7ff9-4786-a832-d2da2ebc0075”,
“name”: “YouTube”,
“credentials”: {
“youTubeOAuth2Api”: {
“id”: “AgC1UoS6O9iDs4SS”,
“name”: “YouTube account”
}
}
},
{
“parameters”: {
“resource”: “fileFolder”,
“searchMethod”: “query”,
“queryString”: “=‘{{$json["id"]}}’ in parents”,
“filter”: {},
“options”: {}
},
“type”: “n8n-nodes-base.googleDrive”,
“typeVersion”: 3,
“position”: [
-300,
220
],
“id”: “6640017f-0ec6-4c31-82e2-bbb5e98b3aed”,
“name”: “Google Drive1”,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “9RwOKj3eYSXYXwhV”,
“name”: “Google Drive account”
}
}
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “7666cd52-72a9-4e80-8645-2ea36e722a8b”,
“leftValue”: “={{$json["name"]}}”,
“rightValue”: “.mov”,
“operator”: {
“type”: “string”,
“operation”: “endsWith”
}
},
{
“id”: “95de87c9-7976-4d09-b6f7-cdc0c33a11c1”,
“leftValue”: “={{$json["name"]}}”,
“rightValue”: “.mp4”,
“operator”: {
“type”: “string”,
“operation”: “endsWith”
}
}
],
“combinator”: “or”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
-100,
40
],
“id”: “c02e6db2-cf9c-4f28-b1eb-990846965401”,
“name”: “If”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “4ba25370-2439-4dda-a1f9-87fb10fdcf8c”,
“leftValue”: “={{$json["name"]}}”,
“rightValue”: “.jpg”,
“operator”: {
“type”: “string”,
“operation”: “endsWith”
}
},
{
“id”: “cf4d2bdc-77e3-43af-b986-7492923fa5f0”,
“leftValue”: “={{$json["name"]}}”,
“rightValue”: “.png”,
“operator”: {
“type”: “string”,
“operation”: “endsWith”
}
}
],
“combinator”: “or”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
-100,
400
],
“id”: “2503ef6b-b573-4865-89a3-ab7b577a84d5”,
“name”: “If1”
},
{
“parameters”: {
“conditions”: {
“options”: {
“caseSensitive”: true,
“leftValue”: “”,
“typeValidation”: “strict”,
“version”: 2
},
“conditions”: [
{
“id”: “7666cd52-72a9-4e80-8645-2ea36e722a8b”,
“leftValue”: “={{$json["name"]}}”,
“rightValue”: “.txt”,
“operator”: {
“type”: “string”,
“operation”: “endsWith”
}
}
],
“combinator”: “and”
},
“options”: {}
},
“type”: “n8n-nodes-base.if”,
“typeVersion”: 2.2,
“position”: [
-100,
220
],
“id”: “5cdbe97c-bf2c-4036-b403-39ae181ad30a”,
“name”: “If2”
},
{
“parameters”: {
“operation”: “download”,
“fileId”: {
“__rl”: true,
“value”: “={{ $json.id }}”,
“mode”: “id”
},
“options”: {}
},
“type”: “n8n-nodes-base.googleDrive”,
“typeVersion”: 3,
“position”: [
120,
40
],
“id”: “17c55fdc-9954-4ea4-bd6c-7664f458eb8c”,
“name”: “Google Drive Download Video”,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “9RwOKj3eYSXYXwhV”,
“name”: “Google Drive account”
}
}
},
{
“parameters”: {
“operation”: “download”,
“fileId”: {
“__rl”: true,
“value”: “={{ $json.id }}”,
“mode”: “id”
},
“options”: {}
},
“type”: “n8n-nodes-base.googleDrive”,
“typeVersion”: 3,
“position”: [
120,
400
],
“id”: “1e6d896a-8683-4aa4-b319-f85ba419659f”,
“name”: “Google Drive Download Thumbnail”,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “9RwOKj3eYSXYXwhV”,
“name”: “Google Drive account”
}
}
},
{
“parameters”: {
“operation”: “download”,
“fileId”: {
“__rl”: true,
“value”: “={{ $json.id }}”,
“mode”: “id”
},
“options”: {}
},
“type”: “n8n-nodes-base.googleDrive”,
“typeVersion”: 3,
“position”: [
120,
220
],
“id”: “e810c348-8a3a-4f6b-b1d7-83d507b35b1e”,
“name”: “Google Drive Download Description”,
“credentials”: {
“googleDriveOAuth2Api”: {
“id”: “9RwOKj3eYSXYXwhV”,
“name”: “Google Drive account”
}
}
},
{
“parameters”: {
“mode”: “combine”,
“combineBy”: “combineByPosition”,
“options”: {}
},
“type”: “n8n-nodes-base.merge”,
“typeVersion”: 3.2,
“position”: [
580,
40
],
“id”: “a37720f6-210f-46f9-a09e-8d1ac6358e5f”,
“name”: “Merge”
},
{
“parameters”: {
“operation”: “text”,
“destinationKey”: “description text”,
“options”: {}
},
“type”: “n8n-nodes-base.extractFromFile”,
“typeVersion”: 1,
“position”: [
300,
220
],
“id”: “ae49e2f6-8e8b-4da2-84a1-8542b3f1ec0c”,
“name”: “Extract from File”
},
{
“parameters”: {
“assignments”: {
“assignments”: [
{
“id”: “dca75179-5da0-4d13-a27a-1ada9dc53ca6”,
“name”: “description”,
“value”: “={{ $json["description text"] }}”,
“type”: “string”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.set”,
“typeVersion”: 3.4,
“position”: [
440,
220
],
“id”: “02779942-d1c1-4dd6-a8df-1e48e128b6d9”,
“name”: “Edit Fields”
},
{
“parameters”: {
“method”: “POST”,
“url”: “=https://www.googleapis.com/upload/youtube/v3/thumbnails/set?videoId={{ $json.uploadId }}”,
“authentication”: “predefinedCredentialType”,
“nodeCredentialType”: “youTubeOAuth2Api”,
“sendBody”: true,
“contentType”: “multipart-form-data”,
“bodyParameters”: {
“parameters”: [
{
“name”: “thumbnail”,
“value”: “={{ $binary.data }}”
}
]
},
“options”: {}
},
“type”: “n8n-nodes-base.httpRequest”,
“typeVersion”: 4.2,
“position”: [
980,
220
],
“id”: “b001c3f8-e3c9-4ab6-873c-a332bf35d31e”,
“name”: “HTTP Request”,
“credentials”: {
“youTubeOAuth2Api”: {
“id”: “AgC1UoS6O9iDs4SS”,
“name”: “YouTube account”
}
}
},
{
“parameters”: {
“mode”: “combine”,
“combineBy”: “combineByPosition”,
“options”: {}
},
“type”: “n8n-nodes-base.merge”,
“typeVersion”: 3.2,
“position”: [
840,
220
],
“id”: “a929071e-57a0-4e3d-abeb-9fd25cbf9c61”,
“name”: “Merge1”
}
],
“connections”: {
“Google Drive Trigger”: {
“main”: [
[
{
“node”: “Google Drive1”,
“type”: “main”,
“index”: 0
}
]
]
},
“YouTube”: {
“main”: [
[
{
“node”: “Merge1”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Drive1”: {
“main”: [
[
{
“node”: “If”,
“type”: “main”,
“index”: 0
},
{
“node”: “If1”,
“type”: “main”,
“index”: 0
},
{
“node”: “If2”,
“type”: “main”,
“index”: 0
}
]
]
},
“If”: {
“main”: [
[
{
“node”: “Google Drive Download Video”,
“type”: “main”,
“index”: 0
}
]
]
},
“If1”: {
“main”: [
[
{
“node”: “Google Drive Download Thumbnail”,
“type”: “main”,
“index”: 0
}
]
]
},
“If2”: {
“main”: [
[
{
“node”: “Google Drive Download Description”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Drive Download Video”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 0
}
]
]
},
“Google Drive Download Thumbnail”: {
“main”: [
[
{
“node”: “Merge1”,
“type”: “main”,
“index”: 1
}
]
]
},
“Google Drive Download Description”: {
“main”: [
[
{
“node”: “Extract from File”,
“type”: “main”,
“index”: 0
}
]
]
},
“Merge”: {
“main”: [
[
{
“node”: “YouTube”,
“type”: “main”,
“index”: 0
}
]
]
},
“Extract from File”: {
“main”: [
[
{
“node”: “Edit Fields”,
“type”: “main”,
“index”: 0
}
]
]
},
“Edit Fields”: {
“main”: [
[
{
“node”: “Merge”,
“type”: “main”,
“index”: 1
}
]
]
},
“Merge1”: {
“main”: [
[
{
“node”: “HTTP Request”,
“type”: “main”,
“index”: 0
}
]
]
}
},
“pinData”: {},
“meta”: {
“instanceId”: “dde367969c51679a6e0afc1a87e6a664f772adb4bedcd234cc545801f8129ea1”
}
}