n8n Workflows
Docker Compose n8n
The project Docker Compose stack includes n8n at:
http://localhost:5678
Copy .env.example to .env, then set at least:
MAESTER_API_KEY=your_maester_api_key
N8N_ENCRYPTION_KEY=generate_a_long_stable_random_value
PEXELS_API_KEY=your_pexels_api_key
The compose file injects these values into n8n:
MAESTER_BASE_URL=http://maester-enterprise:7860
MAESTER_API_KEY=your_maester_api_key
OPENAI_API_KEY=your_openai_api_key
GEMINI_API_KEY=your_gemini_api_key
OPENROUTER_API_KEY=your_openrouter_api_key
AI_PROVIDER=openai
LLM_PROVIDER=openai
PEXELS_API_KEY=your_pexels_api_key
LLM_MODEL=gpt-4o-mini
KTTS_MODEL=kokoro-v0_19.onnx
KTTS_VOICE=af_bella.pt
Import any workflow JSON from this folder into n8n after the stack is running.
AI Provider Smoke Test
Import:
ai_provider_smoke_test.json
Set AI_PROVIDER or LLM_PROVIDER in .env to one of:
openai
gemini
openrouter
The workflow uses these provider-specific variables:
OPENAI_API_KEY=
OPENAI_BASE_URL=https://api.openai.com/v1
OPENAI_MODEL=gpt-4o-mini
GEMINI_API_KEY=
GEMINI_BASE_URL=https://generativelanguage.googleapis.com/v1beta
GEMINI_MODEL=gemini-1.5-flash
OPENROUTER_API_KEY=
OPENROUTER_BASE_URL=https://openrouter.ai/api/v1
OPENROUTER_MODEL=openai/gpt-4o-mini
OPENROUTER_SITE_URL=http://localhost:5678
OPENROUTER_APP_NAME=Maester Enterprise
OpenRouter uses the OpenAI-compatible chat completions format. Gemini uses the generateContent endpoint and returns a Gemini-shaped response.
Webhook TikTok Storytelling With Pexels
Import:
webhook_tiktok_storytelling_pexels.json
This workflow exposes an n8n webhook at:
POST /webhook/maester/create-tiktok-story
Example payload:
{
"topic": "a founder saves 10 hours a week with automation",
"series_title": "Automation Proof",
"audience": "small business owners",
"scene_count": 5,
"scene_duration": 5,
"output_name": "automation_proof_episode_01.mp4"
}
The webhook creates a TikTok render payload, searches Pexels for portrait clips, submits the job to /services/render/render, and returns Maester's job_id, status_url, and download_url. Poll MAESTER_BASE_URL + status_url until the job state is complete, then download from MAESTER_BASE_URL + download_url.
TikTok Storytelling Mini Series With Pexels
Import tiktok_storytelling_pexels.json into n8n.
For the full autonomous version from the project specification, import:
autonomous_tiktok_storytelling_miniseries.json
Required n8n environment variables:
MAESTER_BASE_URL=https://your-maester-space.hf.space
MAESTER_API_KEY=your_maester_api_key
PEXELS_API_KEY=your_pexels_api_key
OPENAI_API_KEY=your_openai_api_key
LLM_MODEL=gpt-4o-mini
KTTS_MODEL=kokoro-v0_19.onnx
KTTS_VOICE=af_bella.pt
What the workflow does:
- Builds a five-scene TikTok storytelling episode.
- Searches Pexels videos for each scene query.
- Picks portrait MP4 assets when available.
- Creates a Maester render payload with scene captions, text overlays, blur background, and per-scene effects.
- Submits the render job to
/services/render/render.
The workflow expects all services to be enabled in Maester:
MAESTER_MOUNT_SERVICES=true
MAESTER_ENABLE_RENDER_ENGINE=true
The final node returns the render job response. Add a Wait node and an HTTP Request node against the returned status_url if you want automatic polling.
Pexels attribution metadata is included in each scene under metadata.pexels so you can preserve attribution data in downstream reports.
Autonomous Mini-Series Workflow
autonomous_tiktok_storytelling_miniseries.json implements this production pipeline:
- Configures the topic:
The Girl Who Disappeared Every Midnight. - Calls OpenAI Chat Completions and requests strict JSON story output.
- Validates the returned story schema.
- Creates a Maester campaign record through
/automation/campaigns. - Runs Maester quality and compliance checks.
- Loops through scenes inside an n8n Code node.
- Searches Pexels portrait videos with retry queries.
- Generates KTTS narration for every scene through
/services/ktts/v1/audio/speech. - Uploads scene narration files to
/services/render/upload. - Generates and uploads a full episode narration track for the final render engine voiceover.
- Builds a 1080x1920 TikTok render payload with captions, blur background, scene effects, animated subtitle settings, and Pexels attribution metadata.
- Submits the final render to
/services/render/render.
The render engine accepts one global voiceover track, so the workflow generates per-scene narration artifacts for traceability and also creates one combined narration track for final video rendering.
Islamic Motivation TikTok Automation Pipeline
Import:
islamic_motivation_tiktok_pipeline.json
This workflow implements the Islamic motivation pipeline:
- Runs once per day from an n8n Schedule Trigger.
- Calls GPT-4o for a respectful Islamic motivational topic and narration.
- Calls GPT-4o again for exactly five cinematic Pexels-optimized scenes.
- Searches Pexels portrait videos scene by scene, with
naturefallback. - Downloads each clip and sends it to Maester FFmpeg automation.
- Trims and resizes each clip to 1080x1920 / 9:16.
- Concats clips in deterministic scene order.
- Searches Archive.org for an Islamic nasheed and continues without music if none is found.
- Burns TikTok-style ASS captions into the video.
- Merges nasheed audio at low volume.
- Normalizes the final MP4 for TikTok compatibility.
- Uploads the final file to Maester render inspection and validates duration, size, audio, and video stream metadata.
- Uploads to TikTok if
TIKTOK_UPLOAD_ENABLED=true; otherwise returns a dry-run render result. - Sends Google Sheets and Telegram status updates.
Required environment variables:
MAESTER_BASE_URL=https://your-maester-space.hf.space
MAESTER_API_KEY=your_maester_api_key
OPENAI_API_KEY=your_openai_api_key
PEXELS_API_KEY=your_pexels_api_key
Optional publishing/logging variables:
TELEGRAM_BOT_TOKEN=123456:telegram_bot_token
TELEGRAM_CHAT_ID=123456789
GOOGLE_SHEETS_WEBHOOK_URL=https://script.google.com/macros/s/your-script-id/exec
TIKTOK_UPLOAD_ENABLED=false
TIKTOK_ACCESS_TOKEN=your_tiktok_content_posting_access_token
Required Maester services:
MAESTER_MOUNT_SERVICES=true
MAESTER_ENABLE_FFMPEG_AUTOMATION=true
MAESTER_ENABLE_RENDER_ENGINE=true
The workflow uses these Maester endpoints:
/automation/campaigns/automation/compliance/check/services/ffmpeg/n8n/execute/trim/services/ffmpeg/n8n/execute/resize_916/services/ffmpeg/n8n/execute/concat/services/ffmpeg/n8n/execute/add_subtitles/services/ffmpeg/n8n/execute/merge_music/services/ffmpeg/n8n/execute/normalize/services/render/upload/services/render/inspect
TikTok upload is intentionally dry-run by default. Enable it only after your TikTok Content Posting API app is approved and tested.