Skip to content

Add episode 36

David3f097b465a69
diff --git a/README.md b/README.md
index 39ef3a7..68c73d9 100644
--- a/README.md
+++ b/README.md
@@ -30,6 +30,8 @@ In this repo, you can find the n8n templates we created for the episodes of [AI
- [Episode 24: generate images with Qwen Image, Flux.1 [dev] and Flux.1 Schnell with modal.com and Cloudflare Workers AI](episode_24)
- [Episode 25: Fal.ai n8n subworkflows for Qwen Image Edit Plus and Wan 2.2 animate](episode_25)
- [Episode 31: Veo 3.1 is now in n8n - how to use it for FREE](episode_31)
+- [Episode 35: Instagram influencer machine](episode_35)
+- [Episode 36: Viral bodycam footage creator with Suno 2](episode_36)
## servers
diff --git a/episode_36/README.md b/episode_36/README.md
new file mode 100644
index 0000000..3a2ef34
--- /dev/null
+++ b/episode_36/README.md
@@ -0,0 +1,21 @@
+# Episode 36: Viral bodycam footage creator with Suno 2
+
+Viral bodycam videos have been around for a while, but Sora 2 took them to a whole new level. Want to get in on the action? Create your own AI bodycam shorts — shaky cam and all — with this easy n8n workflow.
+
+## [📚 Join our Skool community for support, premium content and more!](https://www.skool.com/ai-agents-az/about)
+
+### Get the premium versions of the workflows and the exclusive content - with the hosted GPU media server
+
+## Free n8n JSON workflow
+
+- [n8n workflow: Viral bodycam footage creator with Suno 2](n8n_viral_bodycam_footage_creator.json)
+
+## Additional resources
+
+- [Guide to connect your Instagram Business account to n8n](guide-instagram.md)
+- [Join n8n](https://n8n.partnerlinks.io/fenoo5ekqs1g)
+- [Kie.ai API keys](https://kie.ai/api-key)
+
+## Watch the video
+
+[![Create AI bodycam shorts with Sora 2 in n8n](https://img.youtube.com/vi/1C2vx35KtSQ/0.jpg)](https://www.youtube.com/watch?v=1C2vx35KtSQ)
diff --git a/episode_36/guide-instagram.md b/episode_36/guide-instagram.md
new file mode 100644
index 0000000..7077e91
--- /dev/null
+++ b/episode_36/guide-instagram.md
@@ -0,0 +1,175 @@
+# Setting up Instagram for automations with n8n
+
+## [📚 Join our Skool community for support, premium content and more!](https://www.skool.com/ai-agents-az/about?gw8)
+
+### Be part of a growing community and help us create more content like this
+
+## Convert the Instagram account to a professional account
+
+> [!IMPORTANT]
+> Converting the Instagram account to a professional (business or creator) account will make the account public
+
+In the Instagram application, follow these steps to convert your account to a professional account.
+
+<table>
+ <tr>
+ <td>
+ 1. Open the settings, and select `Account type and tools`
+ <img src="https://github.com/user-attachments/assets/adffda31-f8ce-4a49-a971-40e5cd5f5395" alt="" />
+ </td>
+ <td>
+ 2. Click on `Switch to professinal account`
+ <img src="https://github.com/user-attachments/assets/5ea13aeb-b6ac-40b4-906f-2fc563625c52" alt="" />
+ </td>
+ <td>
+ 3. Click on `Next`
+ <img src="https://github.com/user-attachments/assets/10942cc8-6045-4ca1-a14a-241a2d94591c" />
+ </td>
+ </tr>
+ <tr>
+ <td>
+ 4. Select the type of account your want to create
+ <img src="https://github.com/user-attachments/assets/c9e19bf8-b48d-49e7-b560-e8edf423233d" alt="" />
+ </td>
+ <td>
+ 5. Select the right category, that describe your account
+ <img src="https://github.com/user-attachments/assets/eb4680b2-1d38-476c-8fb0-c428d1e12d04" alt="" />
+ </td>
+ <td>
+ 6. Confirm the choice
+ <img src="https://github.com/user-attachments/assets/22ee13cf-f751-4cea-9fc0-be466c885b02" alt="" />
+ </td>
+ </tr>
+</table>
+
+## Create credentials to use with n8n
+
+### 1. Create a Facebook page
+
+Navigate to [https://www.facebook.com/pages/create](https://www.facebook.com/pages/create) to create a new Facebook page.
+Fill out the required parameters (name, category) and create the page.
+
+<img width="1554" alt="Screenshot 2025-05-05 at 10 02 00 AM" src="https://github.com/user-attachments/assets/f0e321a2-7b85-4b23-b85b-f8e63281b6b9" />
+
+Now, you need to be acting on behalf of the page - if it's not active for some reason, select it from the menu.
+
+<img width="372" alt="image" src="https://github.com/user-attachments/assets/7aaaccc8-4b0a-4f72-a8c9-f2ecc453584a" />
+
+### 2. Connect Instagram account to the Facebook page
+
+Click on your page's name on the left side.
+
+<img width="379" alt="image" src="https://github.com/user-attachments/assets/fd1ed1d8-8890-4636-a4ae-0496db252283" />
+
+Select `Settings` from the menu.
+
+<img width="368" alt="image" src="https://github.com/user-attachments/assets/641904ec-764e-4d56-bede-618da33db7fe" />
+
+Scroll down to `Permissions` and select `Linked accounts`.
+
+<img width="369" alt="image" src="https://github.com/user-attachments/assets/a024ad7e-8358-4329-a864-c7b621810405" />
+
+Select `Instagram`.
+
+<img width="740" alt="image" src="https://github.com/user-attachments/assets/141164a0-c88e-46a0-a335-466f81297bc6" />
+
+Click on `Connect account` and sign in with your Instagram account.
+
+<img width="708" alt="image" src="https://github.com/user-attachments/assets/5324b945-621b-4f2b-b513-9b51e5b5c071" />
+
+Click on `Connect`.
+
+<img width="573" alt="image" src="https://github.com/user-attachments/assets/85cad094-a815-441a-a0e5-84081fd0ee2d" />
+
+Click on `Confirm`.
+
+<img width="570" alt="image" src="https://github.com/user-attachments/assets/df5bb377-22a8-41de-b99d-0f80052cb372" />
+
+Click on `Continue`.
+
+<img width="561" alt="image" src="https://github.com/user-attachments/assets/81fd3143-f00b-4e33-9521-12c0c9ce623d" />
+
+You are done.
+
+<img width="713" alt="image" src="https://github.com/user-attachments/assets/ce4c0bbe-beed-4c6c-8731-23216efbccb5" />
+
+### 3. Create a Facebook application
+
+Head to [https://developers.facebook.com/apps](https://developers.facebook.com/apps) and click on `Create app`
+
+<img width="1027" alt="image" src="https://github.com/user-attachments/assets/ca5c79b9-974a-4c55-8f88-6def8c1b98d1" />
+
+Select the `Other` use case and hit `Next`.
+
+<img width="1033" alt="image" src="https://github.com/user-attachments/assets/31f296bd-3b47-432b-9037-7974e821a311" />
+
+Select `Business` app type.
+
+<img width="818" alt="image" src="https://github.com/user-attachments/assets/2ab06dd1-33ba-4d87-8365-3637c8327877" />
+
+Review, and click on `Create app`
+
+<img width="815" alt="image" src="https://github.com/user-attachments/assets/c8cc8e1d-c006-428a-9bfa-8cc78a2932c9" />
+
+Add the Instagram product to your app.
+
+<img width="1008" alt="image" src="https://github.com/user-attachments/assets/4186f90b-b619-4c1c-9ea8-bfc5294eaeb4" />
+
+You don't need to configure it, just leave it as it is.
+
+### 4. Create an access token
+
+From the tools menu, select the `Graph API Explorer`
+
+<img width="877" alt="image" src="https://github.com/user-attachments/assets/006a40a7-894a-4bd0-9483-0d495b77206f" />
+
+You'll see this interface below.
+
+<img width="541" alt="image" src="https://github.com/user-attachments/assets/414ece47-2f1d-4d08-9998-ada85ffb065f" />
+
+1. Make sure the Meta app is the one you just created
+2. In the permissions panel, add the following permissions
+
+- `pages_show_list`
+- `business_management`
+- `instagram_basic`
+- `instagram_content_publish`
+- `pages_read_engagement`
+
+3. Click on `Generate Access Token`
+
+4. You'll be prompted to select the Facebook page you give access to, the business account and the Instagram account. Select all of them. During the process, take a not of the **Instagram account id** you are connecting, you'll need that later.
+
+<table>
+ <tr>
+ <td>
+ <img width="564" alt="Screenshot 2025-05-09 at 11 07 22 AM" src="https://github.com/user-attachments/assets/6b77415e-1ca2-47f0-b046-974fd391c90a" />
+ </td>
+ <td>
+ <img width="562" alt="Screenshot 2025-05-09 at 11 07 27 AM" src="https://github.com/user-attachments/assets/353b9973-426b-4034-b5fc-e77840ca0d18" />
+ </td>
+ <td>
+ <img width="562" alt="Screenshot 2025-05-09 at 11 08 35 AM" src="https://github.com/user-attachments/assets/58132694-1376-4c40-9d20-61cb8fdb9df5" />
+ </td>
+ <td>
+ <img width="562" alt="Screenshot 2025-05-09 at 11 08 58 AM" src="https://github.com/user-attachments/assets/c2676755-f12f-49d6-9a92-49ea688fc832" />
+ </td>
+ </tr>
+</table>
+
+5. Copy the access token, and head to the [Facebook token debugger tool](https://developers.facebook.com/tools/debug/accesstoken) and paste in the access token, and click `debug`. Scroll to the very bottom of the page, and click on `Extend Access Token`. Copy the long-lived access token.
+
+6. Go back to the `Graph API Explorer` and paste the access token to the access token field and add `me/accounts` to the graph path and click `Submit`. In the results, you'll find field `access_token` that contains the long-lived page access token that will never expire. Copy that.
+
+<img width="693" alt="image" src="https://github.com/user-attachments/assets/0e1bd821-5c27-4c9a-b14e-eeed9c17850f" />
+
+7. (optional) you can verify the expiration of the token, if you paste it to the [Facebook token debugger tool](https://developers.facebook.com/tools/debug/accesstoken).
+
+8. (optional) you can also get the Instagram Business Account's id, if you click on the id of the page in the Graph API explorer, and add `?fields=instagram_business_account` after the id, then click `Submit`
+
+<img width="766" alt="image" src="https://github.com/user-attachments/assets/ac0cb186-8496-4c22-a249-d555dad1f870" />
+
+**If you did everything above, you'll have two things**
+
+1. A page token, that won't expire to manage your Instagram account. You will use the page token to setup the Facebook Graph node in n8n.
+2. The Instagram account id which you'll need to set in the `Configure` node in the n8n workflow
diff --git a/episode_36/n8n_viral_bodycam_footage_creator.json b/episode_36/n8n_viral_bodycam_footage_creator.json
new file mode 100644
index 0000000..ca013db
--- /dev/null
+++ b/episode_36/n8n_viral_bodycam_footage_creator.json
@@ -0,0 +1,1329 @@
+{
+ "name": "Viral bodycam shorts creator",
+ "nodes": [
+ {
+ "parameters": {
+ "model": {
+ "__rl": true,
+ "mode": "list",
+ "value": "gpt-4.1-mini"
+ },
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
+ "typeVersion": 1.2,
+ "position": [
+ -688,
+ 720
+ ],
+ "id": "6ad09135-7bdd-4e54-89bd-81c3f0a21fb3",
+ "name": "OpenAI Chat Model",
+ "credentials": {
+ "openAiApi": {
+ "id": "tGvJRP2th9CbI2oq",
+ "name": "OpenAi account 2"
+ }
+ }
+ },
+ {
+ "parameters": {
+ "jsonSchemaExample": "{\n\t\"video_prompt\": \"\",\n \"video_title\": \"\",\n \"video_description\": \"\"\n}"
+ },
+ "type": "@n8n/n8n-nodes-langchain.outputParserStructured",
+ "typeVersion": 1.3,
+ "position": [
+ -1024,
+ 272
+ ],
+ "id": "0d97b14a-96dc-46fb-ad95-49225ccfec40",
+ "name": "Structured Output Parser"
+ },
+ {
+ "parameters": {
+ "errorMessage": "=Error while generating the video: {{ $json.message || data.failMsg }}"
+ },
+ "type": "n8n-nodes-base.stopAndError",
+ "typeVersion": 1,
+ "position": [
+ 816,
+ 0
+ ],
+ "id": "2df02a65-533e-4fb0-a18e-ec9dc7ee1f68",
+ "name": "Stop and Error"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "defd1dcb-4c75-47bc-83c4-bb29f6d1b1fd",
+ "name": "task_id",
+ "value": "={{ $json.data.taskId }}",
+ "type": "string"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [
+ 224,
+ 160
+ ],
+ "id": "54e5d491-6258-43b2-8fbc-4b8ca10c4c28",
+ "name": "Set task id"
+ },
+ {
+ "parameters": {},
+ "type": "n8n-nodes-base.wait",
+ "typeVersion": 1.1,
+ "position": [
+ 816,
+ 336
+ ],
+ "id": "2b504a0e-057f-4f44-b55d-b942b4289925",
+ "name": "Wait",
+ "webhookId": "be790b26-e203-4695-859f-01bca4cbef18"
+ },
+ {
+ "parameters": {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "c335417b-f320-4f9b-a5c8-48d7b6e8f0e6",
+ "leftValue": "={{ $json.code }}",
+ "rightValue": 200,
+ "operator": {
+ "type": "number",
+ "operation": "equals"
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.if",
+ "typeVersion": 2.2,
+ "position": [
+ 0,
+ 64
+ ],
+ "id": "9b7ed9e6-a96d-4e89-a5da-2b984efc17cf",
+ "name": "Successful start?"
+ },
+ {
+ "parameters": {
+ "promptType": "define",
+ "text": "=<Instructions>\n Create a prompt for an AI video creator for a viral short video. Use the templates below to create an extremely funny bodycam footage. Use imaginary or real characters, hilarious vihicles.\n Make sure not to use copyrighted materials, like spider-man or sponge bob.\n\n {{ $json.Instructions }}\n</Instructions>\n\n<Templates>\n <Template>\n Body cam footage of a police officer catching {Character} stealing {Item} in a supermarket. {Character} runs away with the police officer trying to chase on foot\n </Template>\n <Template>\n Realistic body cam footage of a police officer pulling over {Character} in his {Vihicle}. It was a serious offense, so the cop is extremely angry and tries to open the door of the car before {character} speeds away quickly.\n </Template>\n <Template>\n Body cam footage of a police officer pulling over a car with {Character} as a driver. After being questioned, {Character} drives away with the police officer trying to chase on foot.\n </Template>\n <Template>\n Bodycam footage of {Character} {Vihicle} fleeing from a traffic stop\"\n </Template>\n</Templates>\n\n{{ $json.change_requests ? `\nThe post was already generated, please apply the change requests\n\n<VideoTitle>\n${$json.video_title}\n</VideoTitle>\n\n<VideoPrompt>\n${$json.video_prompt}\n</VideoPrompt>\n\n<ChangeRequests>\n${$json.change_requests}\n</ChangeRequests>\n` : '' }}",
+ "hasOutputParser": true,
+ "batching": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.chainLlm",
+ "typeVersion": 1.7,
+ "position": [
+ -1216,
+ 80
+ ],
+ "id": "fdb47bc9-9bc2-4438-ba79-4bd99ba381c0",
+ "name": "Create video prompt"
+ },
+ {
+ "parameters": {
+ "url": "https://api.kie.ai/api/v1/jobs/recordInfo",
+ "authentication": "genericCredentialType",
+ "genericAuthType": "httpBearerAuth",
+ "sendQuery": true,
+ "queryParameters": {
+ "parameters": [
+ {
+ "name": "taskId",
+ "value": "={{ $('Set task id').item.json.task_id }}"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.3,
+ "position": [
+ 400,
+ 160
+ ],
+ "id": "ff1d37e5-2e60-4102-862d-d81d7a3b32e1",
+ "name": "Get status of the video",
+ "credentials": {
+ "httpBearerAuth": {
+ "id": "I9h2snlZscr2WStA",
+ "name": "Kie"
+ }
+ }
+ },
+ {
+ "parameters": {
+ "rules": {
+ "values": [
+ {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "4b32c886-1289-402c-9288-e565b03b4d05",
+ "leftValue": "={{ $json.data.state }}",
+ "rightValue": "fail",
+ "operator": {
+ "type": "string",
+ "operation": "equals",
+ "name": "filter.operator.equals"
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "renameOutput": true,
+ "outputKey": "fail"
+ },
+ {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "b6b8b96b-ed7c-4df8-9d11-bc0d6cbceb6b",
+ "leftValue": "={{ $json.data.state }}",
+ "rightValue": "success",
+ "operator": {
+ "type": "string",
+ "operation": "equals",
+ "name": "filter.operator.equals"
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "renameOutput": true,
+ "outputKey": "success"
+ },
+ {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "leftValue": "={{ ['waiting', 'queuing', 'generating'].includes($json.data.state) }}",
+ "rightValue": "waiting",
+ "operator": {
+ "type": "boolean",
+ "operation": "true",
+ "singleValue": true
+ },
+ "id": "e08c646f-f98d-458a-8d27-ff73e48b2c00"
+ }
+ ],
+ "combinator": "and"
+ },
+ "renameOutput": true,
+ "outputKey": "waiting"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.switch",
+ "typeVersion": 3.3,
+ "position": [
+ 608,
+ 144
+ ],
+ "id": "2f4493f2-c4f2-41f4-a79e-ba8692afa8b3",
+ "name": "Route based on the status"
+ },
+ {
+ "parameters": {
+ "httpRequestMethod": "POST",
+ "graphApiVersion": "v22.0",
+ "node": "=<< insert your instagram business id >>",
+ "edge": "media",
+ "options": {
+ "queryParameters": {
+ "parameter": [
+ {
+ "name": "video_url",
+ "value": "={{ $('Setup video url').last().json.video_url }}"
+ },
+ {
+ "name": "caption",
+ "value": "={{ $('Create video prompt').last().json.output.video_title }}\n\n{{ $('Create video prompt').last().json.output.video_description }}"
+ },
+ {
+ "name": "media_type",
+ "value": "VIDEO"
+ }
+ ]
+ }
+ }
+ },
+ "type": "n8n-nodes-base.facebookGraphApi",
+ "typeVersion": 1,
+ "position": [
+ 1616,
+ 384
+ ],
+ "id": "3018ebf1-ca73-4fc1-a00c-087678e96e58",
+ "name": "Upload video to Instagram",
+ "credentials": {
+ "facebookGraphApi": {
+ "id": "6QYA8nXTfX9mWQr4",
+ "name": "Facebook Graph account"
+ }
+ },
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "httpRequestMethod": "POST",
+ "graphApiVersion": "v22.0",
+ "node": "=<< insert your instagram business id >>",
+ "edge": "media_publish",
+ "options": {
+ "queryParameters": {
+ "parameter": [
+ {
+ "name": "creation_id",
+ "value": "={{ $json.id }}"
+ }
+ ]
+ }
+ }
+ },
+ "type": "n8n-nodes-base.facebookGraphApi",
+ "typeVersion": 1,
+ "position": [
+ 1856,
+ 384
+ ],
+ "id": "fc50a923-e73f-45a9-a93f-ae15c8fa502b",
+ "name": "Post video post to Instagram",
+ "credentials": {
+ "facebookGraphApi": {
+ "id": "6QYA8nXTfX9mWQr4",
+ "name": "Facebook Graph account"
+ }
+ },
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "content": "# Upload to YouTube\n\n⚠️ set the credentials in the `Start Youtube upload` and the `Upload video to YouTube` nodes",
+ "height": 360,
+ "width": 688,
+ "color": 4
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ 1584,
+ -224
+ ],
+ "id": "303e7809-199b-4293-ab01-0542e6b67d82",
+ "name": "Sticky Note13"
+ },
+ {
+ "parameters": {
+ "method": "POST",
+ "url": "https://www.googleapis.com/upload/youtube/v3/videos?part=snippet,status&uploadType=resumable",
+ "authentication": "predefinedCredentialType",
+ "nodeCredentialType": "youTubeOAuth2Api",
+ "sendHeaders": true,
+ "headerParameters": {
+ "parameters": [
+ {
+ "name": "Content-Type",
+ "value": "application/json"
+ },
+ {
+ "name": "X-Upload-Content-Type",
+ "value": "video/mp4"
+ }
+ ]
+ },
+ "sendBody": true,
+ "contentType": "raw",
+ "rawContentType": "RAW/JSON",
+ "body": "={{ \n JSON.stringify(\n {\n \"snippet\": {\n title: $('Create video prompt').last().json.output.video_title,\n description: $('Create video prompt').last().json.output.video_description,\n tags: \"\",\n categoryId: \"24\",\n defaultLanguage: \"en\",\n defaultAudioLanguage: \"en\"\n },\n status: {\n privacyStatus: \"public\",\n license: \"youtube\",\n embeddable: true,\n publicStatsViewable: true,\n madeForKids: false\n }\n }\n ) \n}}",
+ "options": {
+ "response": {
+ "response": {
+ "fullResponse": true
+ }
+ }
+ }
+ },
+ "id": "18dd7909-db38-487b-a3f0-a2a57fbc658c",
+ "name": "Start Youtube upload",
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.1,
+ "position": [
+ 1632,
+ -96
+ ],
+ "credentials": {
+ "youTubeOAuth2Api": {
+ "id": "EvIEz3KvgFMPW9Ap",
+ "name": "YouTube account"
+ }
+ },
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "method": "PUT",
+ "url": "={{ $('Download the video1').item.json.headers.location }}",
+ "authentication": "predefinedCredentialType",
+ "nodeCredentialType": "youTubeOAuth2Api",
+ "sendHeaders": true,
+ "headerParameters": {
+ "parameters": [
+ {
+ "name": "Content-Type",
+ "value": "video/mp4"
+ }
+ ]
+ },
+ "sendBody": true,
+ "contentType": "binaryData",
+ "inputDataFieldName": "data",
+ "options": {}
+ },
+ "id": "f93b777d-8968-4c56-a2e0-9ebc52cfe50f",
+ "name": "Upload video to YouTube",
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.1,
+ "position": [
+ 2080,
+ -96
+ ],
+ "credentials": {
+ "youTubeOAuth2Api": {
+ "id": "EvIEz3KvgFMPW9Ap",
+ "name": "YouTube account"
+ }
+ },
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "url": "={{ $('Setup video url').last().json.video_url }}",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.2,
+ "position": [
+ 1856,
+ -96
+ ],
+ "id": "7b97e11b-0169-4fa3-927a-ee84734b1b1b",
+ "name": "Download the video1",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "content": "# OR use Postiz, Blotato etc. to share on social media platforms",
+ "width": 1184
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ 1584,
+ 688
+ ],
+ "id": "e4de6cdb-48c5-4238-a090-78bb48c39038",
+ "name": "Sticky Note"
+ },
+ {
+ "parameters": {
+ "content": "# Post to instagram\n# [Guide to setup Facebook (Instagram)](https://github.com/gyoridavid/ai_agents_az/blob/main/episode_8/guide-instagram.md)",
+ "height": 372,
+ "width": 864,
+ "color": 4
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ 1584,
+ 224
+ ],
+ "id": "67b92b22-6e64-4c92-b007-8e5779eb01ee",
+ "name": "Sticky Note3"
+ },
+ {
+ "parameters": {
+ "formTitle": "Sora 2 video maker",
+ "formDescription": "Create a viral body-cam footage video with Sora 2\n\nYou can add your instructions below, but make sure to avoid using copyrighted material",
+ "formFields": {
+ "values": [
+ {
+ "fieldLabel": "Aspect ratio",
+ "fieldType": "dropdown",
+ "fieldOptions": {
+ "values": [
+ {
+ "option": "Landscape"
+ },
+ {
+ "option": "Portrait"
+ }
+ ]
+ },
+ "requiredField": true
+ },
+ {
+ "fieldLabel": "Instructions",
+ "fieldType": "textarea",
+ "placeholder": "optional"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.formTrigger",
+ "typeVersion": 2.3,
+ "position": [
+ -1552,
+ 80
+ ],
+ "id": "3856b5d1-8294-4857-95d0-ad1451514141",
+ "name": "On form submission",
+ "webhookId": "c3be18f3-14a0-4581-8bf8-3c38fe03b3aa"
+ },
+ {
+ "parameters": {
+ "model": "qwen3:32b",
+ "options": {
+ "numCtx": 16048
+ }
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
+ "typeVersion": 1,
+ "position": [
+ -1168,
+ 720
+ ],
+ "id": "90a72554-941c-4a2d-a612-9b40c045b67c",
+ "name": "Ollama Chat Model",
+ "credentials": {
+ "ollamaApi": {
+ "id": "cWXUsJ0LsqnzOEx0",
+ "name": "Ollama account"
+ }
+ },
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
+ "typeVersion": 1,
+ "position": [
+ -832,
+ 720
+ ],
+ "id": "0d63278b-fc7c-46c4-966a-8ae38e741631",
+ "name": "DeepSeek Chat Model",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "model": "tngtech/deepseek-r1t-chimera:free",
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
+ "typeVersion": 1,
+ "position": [
+ -704,
+ 1072
+ ],
+ "id": "d93317fc-c5ec-423e-b5cc-5fe6f271b665",
+ "name": "OpenRouter Chat Model",
+ "credentials": {
+ "openRouterApi": {
+ "id": "pKxg2Rhtt3cG3h19",
+ "name": "OpenRouter account"
+ }
+ },
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
+ "typeVersion": 1,
+ "position": [
+ -1168,
+ 1072
+ ],
+ "id": "26f619fa-34b6-4a49-92dd-c3957147cdad",
+ "name": "Google Gemini Chat Model",
+ "credentials": {
+ "googlePalmApi": {
+ "id": "omtFgoCWQwibKrMM",
+ "name": "Google Gemini(PaLM) Api account 2"
+ }
+ },
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
+ "typeVersion": 1,
+ "position": [
+ -1168,
+ 880
+ ],
+ "id": "eae36daf-53b7-4fb6-8332-bd76a00dca80",
+ "name": "Azure OpenAI Chat Model",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
+ "typeVersion": 1,
+ "position": [
+ -992,
+ 880
+ ],
+ "id": "5fce93d2-d273-4c83-90a2-a1a268d5fe6f",
+ "name": "xAI Grok Chat Model",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "model": {
+ "__rl": true,
+ "mode": "list",
+ "value": "claude-sonnet-4-20250514",
+ "cachedResultName": "Claude 4 Sonnet"
+ },
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatAnthropic",
+ "typeVersion": 1.3,
+ "position": [
+ -832,
+ 880
+ ],
+ "id": "48278246-6b42-4a42-9c46-a2e85c69fbf9",
+ "name": "Anthropic Chat Model",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
+ "typeVersion": 1,
+ "position": [
+ -704,
+ 880
+ ],
+ "id": "658340c9-488d-49bd-9540-0daa19d7c5c4",
+ "name": "xAI Grok Chat Model1",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
+ "typeVersion": 1,
+ "position": [
+ -832,
+ 1072
+ ],
+ "id": "42d30ada-b49b-4819-adf1-8d0db3bbb007",
+ "name": "Groq Chat Model",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatAwsBedrock",
+ "typeVersion": 1,
+ "position": [
+ -992,
+ 720
+ ],
+ "id": "fc0c79e5-5418-4a13-81c6-e9b480108caf",
+ "name": "AWS Bedrock Chat Model",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "options": {}
+ },
+ "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
+ "typeVersion": 1,
+ "position": [
+ -992,
+ 1072
+ ],
+ "id": "4c25ef9c-52b5-4115-a1a6-6556b5aef52c",
+ "name": "Mistral Cloud Chat Model",
+ "disabled": true
+ },
+ {
+ "parameters": {
+ "content": "# Pick your choice of LLM ⚠️\n⚠️ Make sure to deactive/delete the rest of the LLMs after selecting one",
+ "height": 700,
+ "width": 700,
+ "color": 3
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ -1248,
+ 592
+ ],
+ "id": "bf5dd603-3e22-45b3-a976-60360682f2ff",
+ "name": "Sticky Note7"
+ },
+ {
+ "parameters": {
+ "content": "# 📚 [Join our Skool community for video automations, support, premium content and more!](https://www.skool.com/ai-agents-az/about?w9)\n\n## Be part of a growing community and help us create more content like this\n\n## And get access to our premium workflows and our hosted GPU media server with voice cloning and video tools",
+ "height": 372,
+ "width": 908,
+ "color": 6
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ -1264,
+ -544
+ ],
+ "id": "d94a98ef-f124-48cd-bcc8-f927120a48b8",
+ "name": "Sticky Note17"
+ },
+ {
+ "parameters": {
+ "content": "# How to set up this automation?\n\n## 0. Make sure you are using n8n 1.118.1+\n## 1. Setup your kie.ai API key in the `Start generating the video` and `Get status of the video` nodes\n## 2. Select the LLM you want to use and connect it to the AI nodes. Disable the rest of the LLM providers\n## 3. Setup the Facebook Graph nodes, add your token (see the guide on how to create it and connect your Instagram account)\n## 4. Setup your YouTube credentials\n## 5. Done! 🎉\n\n# Resources:\n\n## [Watch the video](https://www.youtube.com/watch?v=PjXYr6M4fjY)\n## [Guide to connect Facebook](https://github.com/gyoridavid/ai_agents_az/blob/main/episode_8/guide-instagram.md)\n## [GitHub](https://github.com/gyoridavid/ai_agents_az/tree/main/episode_36)",
+ "height": 580,
+ "width": 1748,
+ "color": 6
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ -272,
+ -736
+ ],
+ "id": "84c770e1-3dd3-4534-aed7-ebd0edf66d6f",
+ "name": "Sticky Note14"
+ },
+ {
+ "parameters": {
+ "formFields": {
+ "values": [
+ {
+ "fieldLabel": "Do you approve?",
+ "fieldType": "radio",
+ "fieldOptions": {
+ "values": [
+ {
+ "option": "Yes"
+ },
+ {
+ "option": "No"
+ }
+ ]
+ },
+ "requiredField": true
+ },
+ {
+ "fieldLabel": "If you selected no, what changes do you want to apply?",
+ "fieldType": "textarea",
+ "placeholder": "Be as thorough as possible"
+ }
+ ]
+ },
+ "options": {
+ "formDescription": "=Here's the title:\n{{ $json.output.video_title }}\n\nHere's the description:\n{{ $json.output.video_description }}\n\nThis is the video prompt:\n{{ $json.output.video_prompt }}"
+ }
+ },
+ "type": "n8n-nodes-base.form",
+ "typeVersion": 2.3,
+ "position": [
+ -928,
+ 80
+ ],
+ "id": "33f3094e-fcd4-4df5-8917-c09411365aef",
+ "name": "Video plan approval",
+ "webhookId": "b4fd283b-aab4-4766-b444-12ecba728534"
+ },
+ {
+ "parameters": {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "4c919b7b-8ddc-4c10-afa4-68cd7edf2176",
+ "leftValue": "={{ $json['Do you approve?'] }}",
+ "rightValue": "Yes",
+ "operator": {
+ "type": "string",
+ "operation": "equals",
+ "name": "filter.operator.equals"
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.if",
+ "typeVersion": 2.2,
+ "position": [
+ -736,
+ 80
+ ],
+ "id": "3099f550-35e6-490f-8a7d-ae7ececba958",
+ "name": "Approve video plan?"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "a6d99474-863d-4926-bbf6-6f8d96502ca4",
+ "name": "change_requests",
+ "value": "={{ $json['If you selected no, what changes do you want to apply?'] }}",
+ "type": "string"
+ },
+ {
+ "id": "2b67b23c-bb56-4e31-adbf-3c5596098822",
+ "name": "video_prompt",
+ "value": "={{ $('Create video prompt').last().json.output.video_prompt }}",
+ "type": "string"
+ },
+ {
+ "id": "7cafc015-bb66-4ce4-9406-2d9485008430",
+ "name": "video_title",
+ "value": "={{ $('Create video prompt').last().json.output.video_title }}",
+ "type": "string"
+ },
+ {
+ "id": "13785ce7-7770-46bd-9a07-13a20c7f985d",
+ "name": "video_description",
+ "value": "={{ $('Create video prompt').last().json.output.video_description }}",
+ "type": "string"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [
+ -496,
+ 336
+ ],
+ "id": "35383b96-bdc4-4040-816a-443103d8ee5a",
+ "name": "Set video plan variables"
+ },
+ {
+ "parameters": {
+ "formFields": {
+ "values": [
+ {
+ "fieldLabel": "Do you approve?",
+ "fieldType": "radio",
+ "fieldOptions": {
+ "values": [
+ {
+ "option": "Yes"
+ },
+ {
+ "option": "No"
+ }
+ ]
+ },
+ "requiredField": true
+ },
+ {
+ "fieldLabel": "If you selected no, what changes do you want to apply?",
+ "fieldType": "textarea",
+ "placeholder": "Be as thorough as possible"
+ }
+ ]
+ },
+ "options": {
+ "formDescription": "=Video title: {{ $('Create video prompt').last().json.output.video_title }}\n\nVideo description: {{ $('Create video prompt').last().json.output.video_description }}\n\n\nHere's the generated video:\n<video width=\"100%\" controls>\n <source src=\"{{ $json.video_url }}\" type=\"video/mp4\">\n Your browser does not support the video tag.\n</video>\n\n\nVideo prompt:\n{{ $('Create video prompt').last().json.output.video_prompt }}"
+ }
+ },
+ "type": "n8n-nodes-base.form",
+ "typeVersion": 2.3,
+ "position": [
+ 992,
+ 160
+ ],
+ "id": "5e4ae939-2f5a-4561-9dc0-63c3cb9010db",
+ "name": "Video approval",
+ "webhookId": "b4fd283b-aab4-4766-b444-12ecba728534"
+ },
+ {
+ "parameters": {
+ "conditions": {
+ "options": {
+ "caseSensitive": true,
+ "leftValue": "",
+ "typeValidation": "strict",
+ "version": 2
+ },
+ "conditions": [
+ {
+ "id": "4c919b7b-8ddc-4c10-afa4-68cd7edf2176",
+ "leftValue": "={{ $json['Do you approve?'] }}",
+ "rightValue": "Yes",
+ "operator": {
+ "type": "string",
+ "operation": "equals",
+ "name": "filter.operator.equals"
+ }
+ }
+ ],
+ "combinator": "and"
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.if",
+ "typeVersion": 2.2,
+ "position": [
+ 1136,
+ 160
+ ],
+ "id": "b3145a6d-a74a-40c0-9f98-27cf6eb7602d",
+ "name": "Approve video?"
+ },
+ {
+ "parameters": {
+ "assignments": {
+ "assignments": [
+ {
+ "id": "0ef1a380-6eec-4fa2-bdd0-b90209606b44",
+ "name": "change_requests",
+ "value": "={{ $json['If you selected no, what changes do you want to apply?'] }}",
+ "type": "string"
+ },
+ {
+ "id": "6ab73f03-24e1-40be-8a98-3148546f18d6",
+ "name": "video_prompt",
+ "value": "={{ $('Create video prompt').last().json.output.video_prompt }}",
+ "type": "string"
+ },
+ {
+ "id": "c992075b-eb82-4868-b4a7-24f250cc66ac",
+ "name": "video_title",
+ "value": "={{ $('Create video prompt').last().json.output.video_title }}",
+ "type": "string"
+ },
+ {
+ "id": "00a1eb18-1d86-4c01-8ba6-5eaacdd47154",
+ "name": "video_description",
+ "value": "={{ $('Create video prompt').last().json.output.video_description }}",
+ "type": "string"
+ }
+ ]
+ },
+ "options": {}
+ },
+ "type": "n8n-nodes-base.set",
+ "typeVersion": 3.4,
+ "position": [
+ 1344,
+ 336
+ ],
+ "id": "11c06f33-f731-4a4a-8560-38dad87f2910",
+ "name": "Video variables"
+ },
+ {
+ "parameters": {
+ "mode": "runOnceForEachItem",
+ "jsCode": "const result = JSON.parse($json.data.resultJson);\n$input.item.json.video_url = result.resultUrls[0];\n$input.item.json.video_watermark_url = result.resultWaterMarkUrls[0];\n\nreturn $input.item;"
+ },
+ "type": "n8n-nodes-base.code",
+ "typeVersion": 2,
+ "position": [
+ 816,
+ 160
+ ],
+ "id": "4cad7431-36b5-45cc-8464-7b47f7170aa1",
+ "name": "Setup video url"
+ },
+ {
+ "parameters": {
+ "content": "# Create plan for the video",
+ "height": 608,
+ "width": 912
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ -1264,
+ -96
+ ],
+ "id": "288588d8-37aa-4d4d-92b0-5d067486ed2e",
+ "name": "Sticky Note1"
+ },
+ {
+ "parameters": {
+ "content": "# Generate the video",
+ "height": 608,
+ "width": 1760
+ },
+ "type": "n8n-nodes-base.stickyNote",
+ "typeVersion": 1,
+ "position": [
+ -272,
+ -96
+ ],
+ "id": "ef945da0-ea6a-4987-8474-087dbbf148cd",
+ "name": "Sticky Note2"
+ },
+ {
+ "parameters": {
+ "method": "POST",
+ "url": "https://api.kie.ai/api/v1/jobs/createTask",
+ "authentication": "genericCredentialType",
+ "genericAuthType": "httpBearerAuth",
+ "sendBody": true,
+ "specifyBody": "json",
+ "jsonBody": "={{\n\n JSON.stringify({\n \"model\": \"sora-2-text-to-video\",\n \"callBackUrl\": \"https://your-domain.com/api/callback\",\n \"input\": {\n \"prompt\": $('Create video prompt').last().json.output.video_prompt,\n \"aspect_ratio\": $('On form submission').first().json['Aspect ratio'].toLowerCase(),\n \"n_frames\": \"10\",\n \"remove_watermark\": true\n }\n}, null, 2)\n\n}}",
+ "options": {}
+ },
+ "type": "n8n-nodes-base.httpRequest",
+ "typeVersion": 4.3,
+ "position": [
+ -208,
+ 64
+ ],
+ "id": "0a681b13-4796-4d1b-8c24-1855d0199942",
+ "name": "Start generating the video",
+ "credentials": {
+ "httpBearerAuth": {
+ "id": "I9h2snlZscr2WStA",
+ "name": "Kie"
+ }
+ }
+ }
+ ],
+ "pinData": {},
+ "connections": {
+ "OpenAI Chat Model": {
+ "ai_languageModel": [
+ [
+ {
+ "node": "Create video prompt",
+ "type": "ai_languageModel",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Structured Output Parser": {
+ "ai_outputParser": [
+ [
+ {
+ "node": "Create video prompt",
+ "type": "ai_outputParser",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Set task id": {
+ "main": [
+ [
+ {
+ "node": "Get status of the video",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Wait": {
+ "main": [
+ [
+ {
+ "node": "Get status of the video",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Successful start?": {
+ "main": [
+ [
+ {
+ "node": "Set task id",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "Stop and Error",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Create video prompt": {
+ "main": [
+ [
+ {
+ "node": "Video plan approval",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Get status of the video": {
+ "main": [
+ [
+ {
+ "node": "Route based on the status",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Route based on the status": {
+ "main": [
+ [
+ {
+ "node": "Stop and Error",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "Setup video url",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "Wait",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Upload video to Instagram": {
+ "main": [
+ [
+ {
+ "node": "Post video post to Instagram",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Start Youtube upload": {
+ "main": [
+ [
+ {
+ "node": "Download the video1",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Download the video1": {
+ "main": [
+ [
+ {
+ "node": "Upload video to YouTube",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "On form submission": {
+ "main": [
+ [
+ {
+ "node": "Create video prompt",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Video plan approval": {
+ "main": [
+ [
+ {
+ "node": "Approve video plan?",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Approve video plan?": {
+ "main": [
+ [
+ {
+ "node": "Start generating the video",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "Set video plan variables",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Set video plan variables": {
+ "main": [
+ [
+ {
+ "node": "Create video prompt",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Video approval": {
+ "main": [
+ [
+ {
+ "node": "Approve video?",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Approve video?": {
+ "main": [
+ [
+ {
+ "node": "Upload video to Instagram",
+ "type": "main",
+ "index": 0
+ },
+ {
+ "node": "Start Youtube upload",
+ "type": "main",
+ "index": 0
+ }
+ ],
+ [
+ {
+ "node": "Video variables",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Video variables": {
+ "main": [
+ [
+ {
+ "node": "Create video prompt",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Setup video url": {
+ "main": [
+ [
+ {
+ "node": "Video approval",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Start generating the video": {
+ "main": [
+ [
+ {
+ "node": "Successful start?",
+ "type": "main",
+ "index": 0
+ }
+ ]
+ ]
+ },
+ "Google Gemini Chat Model": {
+ "ai_languageModel": [
+ []
+ ]
+ }
+ },
+ "active": false,
+ "settings": {
+ "executionOrder": "v1"
+ },
+ "versionId": "898058de-24b1-4b7c-9256-7b8cf5996f50",
+ "meta": {
+ "templateCredsSetupCompleted": true,
+ "instanceId": "636db6b6ab21a21c6458e2137f340e33dc3e49f5a1c560c8d1e2372c227cf40e"
+ },
+ "id": "rkLkxPsVzFqIw4z4",
+ "tags": []
+}
\ No newline at end of file