AutomationFlowsAI & RAG › AI Scary Stories TikTok Video Generator

AI Scary Stories TikTok Video Generator

Original n8n title: Episode 18 Scary Stories Tiktok Final

Episode 18 Scary Stories TikTok final. Uses httpRequest, lmChatOpenAi, lmChatOllama, lmChatDeepSeek. Event-driven trigger; 83 nodes.

Event trigger★★★★★ complexityAI-powered83 nodesHTTP RequestOpenAI ChatOllama ChatLm Chat Deep SeekOpenRouter ChatGoogle Gemini ChatLm Chat Azure Open AiLm Chat Xai Grok
AI & RAG Trigger: Event Nodes: 83 Complexity: ★★★★★ AI nodes: yes Added:
AI Scary Stories TikTok Video Generator — n8n workflow card showing HTTP Request, OpenAI Chat, Ollama Chat integration

This workflow follows the Form Trigger → HTTP Request recipe pattern — see all workflows that pair these two integrations.

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "name": "Episode 18 Scary Stories TikTok final",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "n8n-nodes-base.splitInBatches",
      "typeVersion": 3,
      "position": [
        -2620,
        1920
      ],
      "id": "17a3416c-8768-4930-8284-9a86aaa31708",
      "name": "Loop Over Items"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://api.together.ai/v1/images/generations",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpBearerAuth",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "black-forest-labs/FLUX.1-schnell-Free"
            },
            {
              "name": "prompt",
              "value": "={{ $json.image_prompt }}"
            },
            {
              "name": "width",
              "value": "={{ 720 }}"
            },
            {
              "name": "height",
              "value": "={{ 1280 }}"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -2240,
        1660
      ],
      "id": "c6b3aa8e-5717-4c01-b8be-5a336406b497",
      "name": "Generate AI image",
      "alwaysOutputData": false,
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        }
      },
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "={{ $json.data[0].url }}"
            },
            {
              "name": "media_type",
              "value": "image"
            }
          ]
        },
        "options": {
          "timeout": 10000
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1940,
        1600
      ],
      "id": "20e3cb91-358e-4845-b81c-d7d9c51a7ae5",
      "name": "Upload image to server",
      "retryOnFail": true
    },
    {
      "parameters": {
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage/{{ $('Start generating TTS (chatterbox)').item.json.file_id }}/status",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1260,
        1720
      ],
      "id": "0a5c293a-be60-4392-a81a-88500dc83f92",
      "name": "Get status of TTS generation",
      "retryOnFail": true
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "ready",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "91402596-3978-4dfc-91b7-9ffe3521b862"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ready"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "0c29765e-4213-434c-9bf3-c5e854dd6ee8",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "processing",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "processing"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4a6cfd86-e690-417e-aa6d-ae497e1177ae",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "not_found",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "failed"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -1080,
        1780
      ],
      "id": "42469903-80f0-4abc-a2c0-4db83d6b2376",
      "name": "TTS status switch"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/video-tools/generate/tts-captioned-video",
        "sendBody": true,
        "contentType": "form-urlencoded",
        "specifyBody": "string",
        "body": "={{ \n\n[\n  `background_id=${$('Upload image to server').last().json.file_id}`,\n  `audio_id=${$json.tts_audio_id}`,\n  `text=${encodeURIComponent($('Loop Over Items').last().json.text)}`,\n  'caption_config_line_count=2',\n  'caption_config_line_max_length=15',\n  'caption_config_font_size=80',\n  'caption_config_font_bold=true',\n  'caption_config_font_color=ffffff',\n  'caption_config_subtitle_position=bottom',\n  'image_effect=pan'\n].filter(Boolean).join('&')\n\n}}",
        "options": {
          "redirect": {
            "redirect": {}
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -680,
        1760
      ],
      "id": "efca6ecb-3e86-476c-8a19-3382dd8c420d",
      "name": "Start generating captioned TTS video"
    },
    {
      "parameters": {
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage/{{ $('Start generating captioned TTS video').item.json.file_id }}/status",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -280,
        1780
      ],
      "id": "3685a5e8-dbc9-4439-b61d-c0ac69c38096",
      "name": "Get video generation status",
      "retryOnFail": true
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "ready",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "91402596-3978-4dfc-91b7-9ffe3521b862"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ready"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "0c29765e-4213-434c-9bf3-c5e854dd6ee8",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "processing",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "processing"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4a6cfd86-e690-417e-aa6d-ae497e1177ae",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "not_found",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "failed"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -100,
        1780
      ],
      "id": "cff75dab-68cd-44bf-993d-9d80973fa135",
      "name": "Video generation switch"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "a7fdacca-749e-4f69-84fd-50075e0e3409",
              "name": "video_id",
              "value": "={{ $('Start generating captioned TTS video').item.json.file_id }}",
              "type": "string"
            },
            {
              "id": "6c99c267-5c41-4697-ba19-b51d9e8c9a4e",
              "name": "tts_id",
              "value": "={{ $('Setup TTS file_id').item.json.tts_audio_id }}",
              "type": "string"
            },
            {
              "id": "21dd08a7-f785-4829-8609-a99950f21572",
              "name": "image_id",
              "value": "={{ $('Upload image to server').item.json.file_id }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        160,
        1780
      ],
      "id": "fc3419e0-edf0-435e-951f-c4b88d3f4214",
      "name": "Setup media fields"
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        -2180,
        2120
      ],
      "id": "99225c4c-5012-4675-b177-2cc1f473354a",
      "name": "Combine loop items"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/video-tools/merge",
        "sendBody": true,
        "contentType": "form-urlencoded",
        "bodyParameters": {
          "parameters": [
            {
              "name": "video_ids",
              "value": "={{ $json.data.map(item => item.video_id).join(',') }}"
            },
            {
              "name": "background_music_id",
              "value": "={{ $('Set background music id').first().json.background_music_id ?? '' }}"
            },
            {
              "name": "background_music_volume",
              "value": "={{ $('Configure me').first().json.background_music_volume }}"
            }
          ]
        },
        "options": {
          "redirect": {
            "redirect": {}
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1980,
        2120
      ],
      "id": "2b6905e2-4455-4da1-ba0b-f2401e8d2543",
      "name": "Start merging the videos"
    },
    {
      "parameters": {
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage/{{ $('Start merging the videos').item.json.file_id }}/status",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1560,
        2160
      ],
      "id": "25055217-2567-44cb-b744-c433af2d6884",
      "name": "Get status of the video merge"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "ready",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "91402596-3978-4dfc-91b7-9ffe3521b862"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ready"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "0c29765e-4213-434c-9bf3-c5e854dd6ee8",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "processing",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "processing"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4a6cfd86-e690-417e-aa6d-ae497e1177ae",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "not_found",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "failed"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        -1380,
        2180
      ],
      "id": "9decfc13-e138-4885-916c-9b9a316a2646",
      "name": "Video merge status switch"
    },
    {
      "parameters": {
        "amount": 10
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1940,
        1780
      ],
      "id": "aa67d849-7d3f-42c8-845a-ad9076b2063d",
      "name": "Wait for the error / rate limit to go away"
    },
    {
      "parameters": {
        "amount": 1
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1440,
        1720
      ],
      "id": "f2ac1bba-9d67-4277-8887-8df8fc24b3a4",
      "name": "Wait until the TTS gets generated"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/audio-tools/tts/chatterbox",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "text",
              "value": "={{ $('Loop Over Items').item.json.text }}"
            },
            {
              "name": "sample_audio_id",
              "value": "={{ $('Set sample voice id').first().json.sample_audio_id ?? '' }}"
            },
            {
              "name": "exaggeration",
              "value": "={{ $('Configure me').first().json.chatterbox_exaggeration }}"
            },
            {
              "name": "cfg_weight",
              "value": "={{ $('Configure me').first().json.chatterbox_cfg_weight }}"
            },
            {
              "name": "temperature",
              "value": "={{ $('Configure me').first().json.chatterbox_temperature }}"
            },
            {
              "name": "chunk_chars",
              "value": "256"
            },
            {
              "name": "chunk_silence_ms",
              "value": "350"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1620,
        1720
      ],
      "id": "a12564d2-a23a-41ad-95ed-0415f721be70",
      "name": "Start generating TTS (chatterbox)"
    },
    {
      "parameters": {
        "amount": 1
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -480,
        1780
      ],
      "id": "c0e279ff-3ade-4e2b-a188-6ee2ea210d0b",
      "name": "Wait until the video gets generated"
    },
    {
      "parameters": {
        "amount": 1
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -1760,
        2160
      ],
      "id": "d3a2104f-5a96-427e-aa62-74a12ccb654f",
      "name": "Wait until the videos gets merged together"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "d41f1ef6-7591-41b7-805d-94b58caba5c4",
              "name": "tts_audio_id",
              "value": "={{ $('Start generating TTS (chatterbox)').item.json.file_id }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -900,
        1760
      ],
      "id": "3ba034bf-4491-4b28-91ab-e87033cd18c5",
      "name": "Setup TTS file_id"
    },
    {
      "parameters": {
        "model": {
          "__rl": true,
          "value": "gpt-4.1",
          "mode": "list",
          "cachedResultName": "gpt-4.1"
        },
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
      "typeVersion": 1.2,
      "position": [
        320,
        240
      ],
      "id": "795a40ab-a8cf-4067-8190-e83aa82dff05",
      "name": "OpenAI Chat Model",
      "credentials": {
        "openAiApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "content": "# Pick your choice of LLM \u26a0\ufe0f\n\u26a0\ufe0f 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": [
        -220,
        100
      ],
      "id": "b010fe49-1edc-4afa-a7ed-0dbda845047d",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "model": "qwen3:32b",
        "options": {
          "numCtx": 16048
        }
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOllama",
      "typeVersion": 1,
      "position": [
        -140,
        240
      ],
      "id": "1fda7c39-546e-486d-bff1-e99e423ef367",
      "name": "Ollama Chat Model",
      "credentials": {
        "ollamaApi": {
          "name": "<your credential>"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatDeepSeek",
      "typeVersion": 1,
      "position": [
        180,
        240
      ],
      "id": "77941471-b8f2-4177-8fe0-a99797400522",
      "name": "DeepSeek Chat Model",
      "disabled": true
    },
    {
      "parameters": {
        "model": "tngtech/deepseek-r1t-chimera:free",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatOpenRouter",
      "typeVersion": 1,
      "position": [
        320,
        580
      ],
      "id": "6bd948a1-6cc3-43ca-b7b9-d44d4971d13b",
      "name": "OpenRouter Chat Model",
      "credentials": {
        "openRouterApi": {
          "name": "<your credential>"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "typeVersion": 1,
      "position": [
        -140,
        580
      ],
      "id": "7b9e29e5-9313-4265-92ae-1a86d4143ec9",
      "name": "Google Gemini Chat Model",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
      "typeVersion": 1,
      "position": [
        -140,
        400
      ],
      "id": "d6909aea-9d61-4b09-8ac2-440a8c5526fd",
      "name": "Azure OpenAI Chat Model",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
      "typeVersion": 1,
      "position": [
        20,
        400
      ],
      "id": "a13b8bbd-f24f-497f-ba91-416919517577",
      "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": [
        180,
        400
      ],
      "id": "12592026-f863-4383-bcd4-e8d14fd756fb",
      "name": "Anthropic Chat Model",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatXAiGrok",
      "typeVersion": 1,
      "position": [
        320,
        400
      ],
      "id": "c51ea62f-9690-43d2-a96d-79f114caa340",
      "name": "xAI Grok Chat Model1",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatGroq",
      "typeVersion": 1,
      "position": [
        180,
        580
      ],
      "id": "0f5a2a6c-5e99-4a34-9244-658f4414ce7b",
      "name": "Groq Chat Model",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAwsBedrock",
      "typeVersion": 1,
      "position": [
        20,
        240
      ],
      "id": "2e459cd6-47c1-4a21-9918-cc1ba804dc1d",
      "name": "AWS Bedrock Chat Model",
      "disabled": true
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatMistralCloud",
      "typeVersion": 1,
      "position": [
        20,
        580
      ],
      "id": "15bf8cdb-5496-4371-bdfb-531c9d1f7789",
      "name": "Mistral Cloud Chat Model",
      "disabled": true
    },
    {
      "parameters": {
        "content": "# 2. Create script from the story",
        "height": 560,
        "width": 360
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -140,
        840
      ],
      "id": "8914cae6-944e-4c7f-b0b8-7300bdbf10e1",
      "name": "Sticky Note5"
    },
    {
      "parameters": {
        "content": "# 6. Merge the videos",
        "height": 360,
        "width": 1180
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2280,
        2000
      ],
      "id": "99518b44-ad42-42f1-afad-f4cb3fcfbffd",
      "name": "Sticky Note6"
    },
    {
      "parameters": {
        "content": "# 3. Generate an image with Flux \u26a0\ufe0f\n\n\u26a0\ufe0f add your credentials to the `Generate AI image` node\n\nthe free image generation is slow, if you want to make it faster, just remove the `free`",
        "height": 520,
        "width": 580
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2280,
        1440
      ],
      "id": "56659373-51de-4e26-8008-92c5d87eb44a",
      "name": "Sticky Note7"
    },
    {
      "parameters": {
        "content": "# 4. Create speech from text",
        "height": 520,
        "width": 900
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1660,
        1440
      ],
      "id": "31f9d57c-c8c8-41ab-b8cc-8056be480802",
      "name": "Sticky Note8"
    },
    {
      "parameters": {
        "content": "# 5. Generate captioned video",
        "height": 520,
        "width": 1040
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -720,
        1440
      ],
      "id": "a166544c-edbc-41d0-9088-44c640519d2e",
      "name": "Sticky Note9"
    },
    {
      "parameters": {
        "text": "=<Instructions>\nUsing the inspirations below, write a completely new scary story. \n\nUse the following structure for the story, and make sure it's coherent and the reading level is 8th grade. Make it sound like a camp counsellor telling the story to people around the campfire. Don't greet/address the audience, just start telling the story. Don't mention the campfire.\n\n1. Act 1: Set the scene with the protagonist and the antagonist. Start building up the sense of unease or the source of fear.\n2. Act 2: Growing tension between the protagonist and the antagonist\n3. Act 3: Conflict goes to a head\n4. Act 4: Aftermath\n\n\nFor each scene, create an image prompt that we'll use with an image generation tool.\n\nCreate the image generation prompt using the ImageTemplate below.\nAdd \"Do not add text or characters to the final image.\" to the end of each image prompt.\n\nUse the following art style for the images:\n\n{{ $('Configure me').first().json.art_style }}\n</Instructions>\n\n<ImageTemplate>\nGenerate an image that matches the following story scene, using the provided art style.\n\nStory scene:\n{ADD_STORY_SCENE_HERE}\n</ImageTemplate>\n\n<Inspirations>\n{{ $json.items.map(item => `<Story>\n${item.title}\n\n${item.selftext}\n</Story>`).join('\\n') }}\n</Inspirations>",
        "schemaType": "manual",
        "inputSchema": "{\n    \"type\": \"object\",\n    \"properties\": {\n        \"scenes\": {\n            \"type\": \"array\",\n            \"description\": \"Scenes for the story\",\n            \"items\": {\n                \"type\": \"object\",\n                \"properties\": {\n                    \"text\": {\n                        \"type\": \"string\",\n                        \"description\": \"the text of the scene, it will be used for TTS\"\n                    },\n                    \"image_prompt\": {\n                        \"type\": \"string\",\n                        \"description\": \"prompt for image generation\"\n                    }\n                },\n                \"required\": [\n                    \"text\",\n                    \"image_prompt\"\n                ]\n            }\n        },\n        \"title\": {\n            \"type\": \"string\",\n            \"description\": \"the title of the tiktok video\"\n        },\n        \"description\": {\n            \"type\": \"string\",\n            \"description\": \"the description of the tiktok video\"\n        },\n        \"tags\": {\n            \"type\": \"array\",\n            \"description\": \"tags for sharing the video on tiktok\",\n            \"items\": {\n                \"type\": \"string\"\n            }\n        }\n    },\n    \"required\": [\n        \"scenes\",\n        \"title\",\n        \"description\",\n        \"tags\"\n    ]\n}",
        "options": {
          "systemPromptTemplate": "You are an expert copywriter. You write exciting short stories."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.informationExtractor",
      "typeVersion": 1.1,
      "position": [
        -80,
        1000
      ],
      "id": "bbe6f995-bf54-4d96-8a81-4e282afc4a6b",
      "name": "Create the script",
      "retryOnFail": true
    },
    {
      "parameters": {
        "fieldToSplitOut": "output.scenes",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        -20,
        1220
      ],
      "id": "6425e91e-9ba3-4ae4-a54d-21bc774e8284",
      "name": "Split Out"
    },
    {
      "parameters": {
        "content": "# How to set up this automation?\n\n## Make sure to use n8n `1.97.1` or higher, lower versions could break the stuctured output node\n\n## 1. Add the AI Agents No-Code Tools server URL to the Configure me node, and optionally your Postiz server URL\n## 2. Select the LLM you want to use, make sure to deactivate the rest\n## 3. Add your free Together.ai API key to the Generate AI image node\n## 4. Setup the Postiz nodes with your credentials\n",
        "height": 360,
        "width": 1680,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1940,
        440
      ],
      "id": "e740737b-5019-4efa-9fe0-dcd524cb9621",
      "name": "Sticky Note14"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7bbb518a-c4f1-49a5-9e72-3e9d939b131b",
              "name": "AI_AGENTS_NO_CODE_TOOLS_URL",
              "value": "http://192.168.68.60:8000/",
              "type": "string"
            },
            {
              "id": "79226bcb-3a26-4d30-b3a3-e578cda677f9",
              "name": "postiz_api_url",
              "value": "https://api.postiz.com/public/v1",
              "type": "string"
            },
            {
              "id": "34f8b468-b669-46ed-be9d-e77e15f36380",
              "name": "background_music_volume",
              "value": 0.1,
              "type": "number"
            },
            {
              "id": "a725aaf1-c91e-4d5b-87f9-d540d309098c",
              "name": "chatterbox_exaggeration",
              "value": 0.5,
              "type": "number"
            },
            {
              "id": "d048e31d-f1cb-48ac-9ff2-13f1028c843e",
              "name": "chatterbox_cfg_weight",
              "value": 0.5,
              "type": "number"
            },
            {
              "id": "96943158-11f6-4731-9d4b-dbae0862d7ab",
              "name": "chatterbox_temperature",
              "value": 0.8,
              "type": "number"
            },
            {
              "id": "fd0df44b-b7d3-45af-8556-bd77ef83b2db",
              "name": "art_style",
              "value": "=Scene: Highly cinematic with a moody, noir atmosphere, inspired by detective and crime thriller films from the 1970s and 1980s. The setting can be anything, from an interior room to a suburban street, depicted in a tense, suspenseful moment. Emphasize the following details:\n\n- **Lighting:**\u00a0Strong directional lighting with deep shadows; use cool blue and teal color grading with subtle hints of warm light from lamps or windows. The lighting should cast dramatic shadows across the scene.\n- **Mood:**\u00a0Mysterious, somber, and slightly surreal ambiance, evoking a sense of unease or suspense.\n- **Subjects:**\u00a0Human figures should appear contemplative, searching, tense, or whatever the scene calls for.\n- **Color Palette:**\u00a0Dominant cold blues and teals contrasted by occasional soft warm light from lamps or daylight through curtains. The overall tone should be desaturated and muted.\n- **Cinematic Framing:**\u00a0Framed like a movie still, with careful composition and leading lines, sometimes viewed through doorways or windows for added depth.\n- **Exterior Scenes:**\u00a0Overcast skies, muted and overexposed daylight.\n\n**Style influences:** Denis Villeneuve, David Fincher, *Zodiac*, *Mindhunter*, *True Detective*, Gregory Crewdson, neo-noir photography.",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2180,
        1080
      ],
      "id": "a2b8265d-e485-47cb-87b0-cce37d3fd1d3",
      "name": "Configure me"
    },
    {
      "parameters": {
        "content": "# Configure me \u26a0\ufe0f\n",
        "height": 560,
        "width": 300,
        "color": 3
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2280,
        840
      ],
      "id": "8b109688-9c0f-4b95-80ef-616b9b46a689",
      "name": "Sticky Note12"
    },
    {
      "parameters": {
        "url": "={{ $json.AI_AGENTS_NO_CODE_TOOLS_URL }}/health",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1700,
        1000
      ],
      "id": "cea55748-015b-488d-993a-1e5f7e49fb77",
      "name": "HTTP Request",
      "onError": "continueErrorOutput"
    },
    {
      "parameters": {
        "errorMessage": "The server is not running or isn't configured"
      },
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        -1700,
        1220
      ],
      "id": "f4589939-9537-4201-967d-46d2854765fa",
      "name": "Server isn't ready"
    },
    {
      "parameters": {
        "content": "# Test connection",
        "height": 560,
        "width": 420,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1940,
        840
      ],
      "id": "f672f4cb-321f-4636-a66e-66733a455556",
      "name": "Sticky Note15"
    },
    {
      "parameters": {
        "content": "# 9. cleanup (removing tmp files)\nif you want to delete the generated video too, add it's id to the array",
        "height": 360,
        "width": 540
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1360,
        2400
      ],
      "id": "9d618443-9c44-421a-9eda-fcadfe604bab",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "27bcaf96-fcaa-41cb-8a51-436870ce2110",
              "name": "file_ids",
              "value": "={{ [...$('Combine loop items').last().json.data.map(item => [item.video_id, item.tts_id, item.image_id]).flat(), $('Configure me').first().json.chatterbox_clone_voice_id, $('Configure me').first().json.background_music_id, $('Upload overlay to the server').item.json.file_id].filter(Boolean) }}",
              "type": "array"
            },
            {
              "id": "ff26af44-84ff-46a0-8532-5eeca8dbb099",
              "name": "",
              "value": "",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1320,
        2520
      ],
      "id": "1d98b47c-e1e8-438f-84a1-e3e519ab47e5",
      "name": "Set file ids to delete"
    },
    {
      "parameters": {
        "method": "DELETE",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage/{{ $json.file_ids }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1000,
        2520
      ],
      "id": "c924ca30-7479-457c-9842-0d5399a2faa0",
      "name": "Delete tmp files",
      "disabled": true
    },
    {
      "parameters": {
        "fieldToSplitOut": "file_ids",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        -1160,
        2520
      ],
      "id": "ab91bbe3-816d-40cb-ace0-efcdfa3c996d",
      "name": "For each file"
    },
    {
      "parameters": {
        "content": "# \ud83d\udcda [Join our Skool community for support, premium content and more!](https://www.skool.com/ai-agents-az/about?w9)\n\n## Get premium variations of this workflow!\n\n## Be part of a growing community and help us create more content like this",
        "height": 300,
        "width": 700,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2680,
        500
      ],
      "id": "0da53a2e-5461-4bf0-af28-df019e9db940",
      "name": "Sticky Note16"
    },
    {
      "parameters": {
        "content": "# 8. Schedule with Postiz",
        "height": 820,
        "width": 880,
        "color": 4
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2280,
        2400
      ],
      "id": "7400bb12-90d8-4ffa-8cdb-a57f691ec5c7",
      "name": "Sticky Note20"
    },
    {
      "parameters": {
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage/{{ $('Start adding overlay to thevideo').last().json.file_id }}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -2240,
        2520
      ],
      "id": "d21cbc05-fc8e-4a9b-b633-326eead7c93c",
      "name": "Download the video for Postiz"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Configure me').first().json.postiz_api_url }}/upload",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "data"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -2040,
        2520
      ],
      "id": "ea9f8e97-5dfd-4796-9a77-f5e3936c9cdb",
      "name": "Upload video to Postiz",
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        },
        "httpCustomAuth": {
          "name": "<your credential>"
        },
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "url": "={{ $('Configure me').first().json.postiz_api_url }}/integrations",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1820,
        2520
      ],
      "id": "1c658fe2-6b27-4423-be6d-880c24fd0068",
      "name": "Get Postiz integrations",
      "credentials": {
        "httpBearerAuth": {
          "name": "<your credential>"
        },
        "httpCustomAuth": {
          "name": "<your credential>"
        },
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "aggregate": "aggregateAllItemData",
        "options": {}
      },
      "type": "n8n-nodes-base.aggregate",
      "typeVersion": 1,
      "position": [
        -1640,
        2520
      ],
      "id": "31434d65-1e61-483a-88a5-06e6da992537",
      "name": "Merge integrations",
      "disabled": true
    },
    {
      "parameters": {
        "content": "# Setup the integration\n\nYou should implement your own logic here.\n\n1. You can hard-code the desired integration id\n2. You can filter the integrations by your own logic\n\nMake sure to modify the `settings` field if you are sharing to other platforms than YouTube",
        "height": 500,
        "width": 380
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2240,
        2700
      ],
      "id": "d8eeed9a-c941-418b-b45e-8e406211d4b2",
      "name": "Sticky Note1"
    },
    {
      "parameters": {
        "formTitle": "Scary story creator for TikTok",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Background music",
              "fieldType": "file",
              "multipleFiles": false,
              "acceptFileTypes": ".mp3"
            },
            {
              "fieldLabel": "Sample voice",
              "fieldType": "file",
              "multipleFiles": false,
              "acceptFileTypes": ".wav, .mp3"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.formTrigger",
      "typeVersion": 2.2,
      "position": [
        -2520,
        1080
      ],
      "id": "c5800aad-08cc-498a-9953-0e14e9f03bb4",
      "name": "On form submission"
    },
    {
      "parameters": {
        "jsCode": "return $('On form submission').first()"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -1240,
        920
      ],
      "id": "6079b135-c5ec-4735-8f03-06077d6291ec",
      "name": "Relay background music"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7aec0c26-8c27-4aa6-bec7-1f65d9fe3aaf",
              "name": "background_music_id",
              "value": "={{ $json.file_id ?? '' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1240,
        1220
      ],
      "id": "39375cce-c971-4181-a95d-cee48eba85a0",
      "name": "Set background music id"
    },
    {
      "parameters": {
        "jsCode": "return $('On form submission').first()"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -800,
        920
      ],
      "id": "bc416d69-0d4e-4323-8196-00b8b2d60b57",
      "name": "Relay sample audio"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7aec0c26-8c27-4aa6-bec7-1f65d9fe3aaf",
              "name": "sample_audio_id",
              "value": "={{ $json.file_id ?? '' }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -800,
        1240
      ],
      "id": "e52b820e-ae27-47c6-ae81-ecffb0101193",
      "name": "Set sample voice id"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "=data"
            },
            {
              "name": "media_type",
              "value": "video"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -820,
        2160
      ],
      "id": "2f6d03e2-0c63-4753-ab99-e68d45331e3b",
      "name": "Upload overlay to the server"
    },
    {
      "parameters": {
        "url": "https://github.com/gyoridavid/ai_agents_az/raw/refs/heads/main/episode_18/bg_1.mp4",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1000,
        2160
      ],
      "id": "68393334-1c9a-4b0c-86ae-c8219bd29f24",
      "name": "Download example overlay"
    },
    {
      "parameters": {
        "amount": 1
      },
      "type": "n8n-nodes-base.wait",
      "typeVersion": 1.1,
      "position": [
        -420,
        2160
      ],
      "id": "c08d5fc0-4d81-48a9-bccd-ac560bab17df",
      "name": "Wait until the videos gets merged together1"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/video-tools/add-colorkey-overlay",
        "sendBody": true,
        "contentType": "form-urlencoded",
        "bodyParameters": {
          "parameters": [
            {
              "name": "video_id",
              "value": "={{ $('Start merging the videos').last().json.file_id }}"
            },
            {
              "name": "overlay_video_id",
              "value": "={{ $('Upload overlay to the server').last().json.file_id }}"
            },
            {
              "name": "color",
              "value": "#000000"
            }
          ]
        },
        "options": {
          "redirect": {
            "redirect": {}
          }
        }
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -640,
        2160
      ],
      "id": "fee8b2bc-e42b-4ba4-a0cf-2bcb6d935092",
      "name": "Start adding overlay to thevideo"
    },
    {
      "parameters": {
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage/{{ $('Start adding overlay to thevideo').last().json.file_id }}/status",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -220,
        2160
      ],
      "id": "42c718dd-a6c5-4b15-943c-2d376b6a92a7",
      "name": "Get status of the overlay"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "ready",
                    "operator": {
                      "type": "string",
                      "operation": "equals"
                    },
                    "id": "91402596-3978-4dfc-91b7-9ffe3521b862"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "ready"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "0c29765e-4213-434c-9bf3-c5e854dd6ee8",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "processing",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "processing"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "4a6cfd86-e690-417e-aa6d-ae497e1177ae",
                    "leftValue": "={{ $json.status }}",
                    "rightValue": "not_found",
                    "operator": {
                      "type": "string",
                      "operation": "equals",
                      "name": "filter.operator.equals"
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "failed"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        20,
        2200
      ],
      "id": "3c25208f-a68d-4549-949a-657426116e21",
      "name": "Overlay status"
    },
    {
      "parameters": {
        "content": "To get free social media scheduling, you need to host your own [Postiz instance](https://docs.postiz.com/installation/coolify). \n\nAs an alternative, you can use the free tier of [ayrshare](https://www.ayrshare.com/).",
        "height": 340
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -2560,
        2400
      ],
      "id": "460af147-6ca5-4384-b538-ef7555ec34ea",
      "name": "Sticky Note3"
    },
    {
      "parameters": {
        "content": "# Upload background music",
        "height": 560,
        "width": 400,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1480,
        840
      ],
      "id": "786ffc69-f976-466d-9e7d-ace8d5740691",
      "name": "Sticky Note17"
    },
    {
      "parameters": {
        "content": "# Upload voice sample",
        "height": 560,
        "width": 400,
        "color": 7
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1040,
        840
      ],
      "id": "f40dbe53-342e-4ee1-9906-7ac34450f52c",
      "name": "Sticky Note18"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "=Background_music"
            },
            {
              "name": "media_type",
              "value": "audio"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1240,
        1060
      ],
      "id": "6ea8126c-fb04-4cd7-807a-9c60de97804e",
      "name": "Upload background music to the server"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Setup defaults').first().json.AI_AGENTS_NO_CODE_TOOLS_URL }}/api/v1/media/storage",
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "=Sample_voice"
            },
            {
              "name": "media_type",
              "value": "audio"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -800,
        1060
      ],
      "id": "0eecbd01-e71e-4e4a-ae2a-fb2accf4da7f",
      "name": "Upload voice sample to the server"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "7d55d6da-a78c-4a28-9343-0ea9035a0aa3",
              "name": "AI_AGENTS_NO_CODE_TOOLS_URL",
              "value": "={{   ((u) => {   let s = u.trim();   if (!/^https?:\\/\\//i.test(s)) s = 'https://' + s;   const parts = s.split('/');   return parts[0] + '//' + parts[2]; })($json.AI_AGENTS_NO_CODE_TOOLS_URL)  }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -1900,
        1080
      ],
      "id": "ced29d51-7e87-45fd-b4ea-0cf072bf9dcb",
      "name": "Setup defaults"
    },
    {
      "parameters": {
        "content": "# 7. Add overlay",
        "height": 360,
        "width": 1320
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -1060,
        2000
      ],
      "id": "6f6646dd-a3b4-4a8b-a995-428761281195",
      "name": "Sticky Note10"
    },
    {
      "parameters": {
        "assignments": {
          "assignments": [
            {
              "id": "1f7adeed-3cd0-47bb-8bf5-5887d2c82cad",
              "name": "postiz_integration_id",
              "value": "={{ $json.data.find(integration => integration.identifier === 'tiktok')?.id }}",
              "type": "string"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.set",
      "typeVersion": 3.4,
      "position": [
        -2200,
        3000
      ],
      "id": "c16ccf96-822e-4f56-ba5c-cbca207be528",
      "name": "Set integration id for TikTok",
      "disabled": true
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{ $('Configure me').first().json.postiz_api_url }}/posts",
        "authentication": "genericCredentialType",
        "genericAuthType": "httpHeaderAuth",
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"type\": \"schedule\",\n  \"date\": \"{{ $now.plus(1, 'days').toISO() }}\",\n  \"tags\": [],\n  \"shortLink\": false,\n  \"posts\": [\n    {\n      \"integration\": {\n        \"id\": \"{{ $json.postiz_integration_id }}\"\n      },\n      \"value\": [\n        {\n          \"content\": \"{{ $('Create the script').item.json.output.description }}\",\n          \"image\": [\n            {\n              \"id\": \"{{ $('Upload video to Postiz').item.json.id }}\",\n              \"path\": \"{{ $('Upload video to Postiz').item.json.path }}\"\n            }\n          ]\n        }\n      ],\n      \"settings\": {\n      \"title\": \"{{ $('Create the script').item.json.output.title }}\",\n      \"type\": \"unlisted\",\n      \"tags\": {{ JSON.stringify($('Create the script').item.json.output.tags.map(tag => ({ value: tag, label: tag }))) }}\n  }\n    }\n  ]\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -1660,
        3000
      ],
      "id": "df53357c-9cd3-4375-87dc-75ccef74e548",
      "name": "Schedule the TikTok video",
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      },
      "disabled": true
    },
    {
      "parameters": {
        "url": "=https://www.reddit.com/r/creepyencounters/top.json?t=year&limit=100",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        -520,
        980
      ],
      "id": "a3081c61-6c6d-46c3-9097-4c5fe72bdcb6",
      "name": "Get stories from reddit"
    },
    {
      "parameters": {
        "jsCode": "function getRandomItems(A, X) {\n  return A\n    .slice()\n    .sort(() => Math.random() - 0.5)\n    .slice(0, X);\n}\n\nconst items = getRandomItems($input.all().map(item => item.json.data), 3);\n\nreturn [{\n  json: {\n    items\n  }\n}]"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        -340,
        1200
      ],
      "id": "42edb01a-c030-46b4-af29-3720bfe6fdd9",
      "name": "Code"
    },
    {
      "parameters": {
        "content": "# 1. Source inspirations from Reddit",
        "height": 560,
        "width": 420
      },
      "type": "n8n-nodes-base.stickyNote",
      "typeVersion": 1,
      "position": [
        -600,
        840
      ],
      "id": "a513fd82-b6ff-45b3-9354-a40af0727176",
      "name": "Sticky Note11"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "6b9c15f3-2db9-4a1e-a688-4fc4e95ded53",
              "leftValue": "={{ $('On form submission').item.json['Sample voice'] }}",
              "rightValue": "",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1000,
        1060
      ],
      "id": "946baa9d-14d2-456e-b51e-4097cad11d91",
      "name": "Upload voice sample?"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "6b9c15f3-2db9-4a1e-a688-4fc4e95ded53",
              "leftValue": "={{ $('On form submission').item.json['Background music'] }}",
              "rightValue": "",
              "operator": {
                "type": "object",
                "operation": "exists",
                "singleValue": true
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        -1440,
        1120
      ],
      "id": "70a74fec-f110-4afe-adf6-6785cb2e28a9",
      "name": "Upload music?"
    },
    {
      "parameters": {
        "fieldToSplitOut": "data.children",
        "options": {}
      },
      "type": "n8n-nodes-base.splitOut",
      "typeVersion": 1,
      "position": [
        -340,
        980
      ],
      "id": "5d006f17-caaa-4f64-b2ef-5b397e50419b",
      "name": "For each post"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "a6926aaf-b4ac-4e90-ac82-c32796fd7e0c",
              "leftValue": "={{ $json.data.selftext.length }}",
              "rightValue": 1500,
              "operator": {
                "type": "number",
                "operation": "gt"
              }
            },
            {
              "id": "c81af31b-c032-4960-870f-ee7b6a6dc029",
              "leftValue": "={{ $json.data.is_video }}",
              "rightValue": "",
              "operator": {
                "type": "boolean",
                "operation": "false",
                "singleValue": true
              }
            },
            {
              "id": "659ef810-1298-4df0-81f4-e049c2c020b1",
              

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

How this works

This workflow automates the creation of engaging TikTok videos from scary stories, transforming text narratives into captioned clips with AI-generated images and text-to-speech audio, saving creators hours of manual editing. It's ideal for podcasters, storytellers, or content producers who want to repurpose episodes for social media without technical expertise. The key step chains AI models like OpenAI and Ollama to generate and refine visuals alongside voiceovers, culminating in a polished video ready for upload via HTTP requests to external services.

Use this workflow when producing episodic content like horror tales that need quick TikTok adaptations, especially for event-driven batches of stories. Avoid it for non-video formats or if you require custom branding beyond basic captions, as it focuses on automated generation rather than fine-tuned designs. Common variations include swapping Ollama for DeepSeek models to tweak voice styles or adding filters for seasonal themes like Halloween specials.

About this workflow

Episode 18 Scary Stories TikTok final. Uses httpRequest, lmChatOpenAi, lmChatOllama, lmChatDeepSeek. Event-driven trigger; 83 nodes.

Source: https://github.com/Ker102/Kaelux-Automate/blob/main/data/workflows/episodes/episode_18_scary_tiktok.json — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

AI & RAG

Influencer 2.0. Uses formTrigger, form, informationExtractor, lmChatOpenAi. Event-driven trigger; 93 nodes.

Form Trigger, Form, Information Extractor +13
AI & RAG

A Telegram bot that converts natural-language work descriptions into detailed cost estimates using AI parsing, vector search, and the open-source DDC CWICR database with 55,000+ construction work item

HTTP Request, Telegram, Telegram Trigger +6
AI & RAG

My workflow 53. Uses formTrigger, httpRequest, lmChatOpenAi, form. Event-driven trigger; 74 nodes.

Form Trigger, HTTP Request, OpenAI Chat +15
AI & RAG

Episode 23: UGC with nanobanana. Uses lmChatOpenAi, lmChatOllama, lmChatDeepSeek, lmChatOpenRouter. Event-driven trigger; 74 nodes.

OpenAI Chat, Ollama Chat, Lm Chat Deep Seek +12
AI & RAG

This workflow is designed for marketers, content creators, agencies, and solo founders who want to publish long‑form posts with visuals on autopilot using n8n and AI agents. ​

Tool Http Request, Agent, HTTP Request +27