CORTEXFLOW · FREE FOREVER

Automation

AI Video Generation & Auto-Publishing Pipeline

↓ Download workflow JSON

Import in n8n: Workflows → ⋯ → Import from file, then add your credentials. Free download with a free account.

How it works

  1. Schedule Trigger — starts the workflow every Monday at 9:00 AM (change the day and time in the node).
  2. Set Topic — defines the video topic and target audience for this run; edit the values to change what gets produced.
  3. OpenAI: Write Script — sends the topic to GPT and gets back a ready-to-render 60-second video script.
  4. HTTP Request: Render Video — POSTs the script to your video-generation API (HeyGen/Synthesia-style) and gets back a video URL.
  5. Gmail: Request Approval — emails you the finished video link plus an approval link; nothing publishes until you approve.
  6. Wait: Human Approval — pauses here. You open the approval link from the email and submit Approve or Reject on the form.
  7. IF: Approved? — routes approved videos toward publishing and rejected ones to a notification.
  8. HTTP Request: Publish to Socials — POSTs the approved video to your social scheduler (X/LinkedIn placeholder).
  9. Slack: Notify Published — posts a “published” message to your channel.
  10. Slack: Notify Held — posts a “held for review” message when the video is rejected.

Set up steps

You’ll need:

  • n8n (self-hosted or cloud) with webhook access
  • An OpenAI account — get an API key at platform.openai.com → API keys
  • A video-generation API account (e.g., HeyGen or Synthesia) — get an API key from your provider’s dashboard → API settings
  • A Gmail account — connect via OAuth in n8n
  • A Slack workspace — connect via OAuth in n8n
  • A social scheduling API (e.g., your X/LinkedIn scheduler) — get an API key from the scheduler’s settings
  1. Download the workflow JSON using the download button on this page.
  2. In n8n, go to Workflows → ⋯ → Import from file and select the JSON.
  3. Create your OpenAI credential — in n8n go to Credentials → New → OpenAI, paste your API key, save. Then open the OpenAI: Write Script node and select your credential.
  4. Point the video API at your provider — open HTTP Request: Render Video, replace https://api.your-video-provider.com/v1/videos with your provider’s real endpoint (e.g., HeyGen’s or Synthesia’s video-creation URL), and select your header-auth credential containing your API key.
  5. Create your Gmail credential — in n8n go to Credentials → New → Gmail OAuth2, complete the OAuth flow, save. Open Gmail: Request Approval, select the credential, and change the recipient to your own email address.
  6. Create your Slack credential — in n8n go to Credentials → New → Slack OAuth2, complete the OAuth flow, save. Open both Slack nodes, select the credential, and set the channel (e.g., #content).
  7. Point the publish step at your scheduler — open HTTP Request: Publish to Socials, replace https://api.your-social-scheduler.com/v1/publish with your scheduler’s real endpoint and select your API credential.
  8. Activate the workflow (toggle, top-right), then wait for the first Monday run or trigger it manually with Execute workflow.

The approval email contains a link built from {{$execution.resumeUrl}}. Clicking it opens an Approve/Reject form — submitting the form resumes the workflow exactly where it paused.

Customize it

  • Change the schedule — open Schedule Trigger and edit the cron expression (0 9 * * 1 = Monday 9 AM).
  • Change the topic — edit the values in Set Topic; you can also feed topics in from a Google Sheet instead.
  • Use a different model — open OpenAI: Write Script and change the model from gpt-4o-mini to any other model.
  • Add more platforms — duplicate HTTP Request: Publish to Socials and point the copy at another scheduler endpoint.
  • Auto-publish without approval — only do this once you trust the pipeline: delete the Wait and IF nodes and connect Gmail: Request Approval directly to HTTP Request: Publish to Socials.

Workflow nodes

This workflow is built from 10 nodes. Here's what each one does:

#NodeTypeWhat it does
1 Schedule Trigger Schedule Trigger Starts the workflow automatically on a schedule.
2 Set Topic Set Holds editable configuration values — fill in your own settings here before activating.
3 OpenAI: Write Script OpenAI Sends a prompt to OpenAI and returns the AI's answer.
4 HTTP Request: Render Video HTTP Request Calls an external API or webhook endpoint.
5 Gmail: Request Approval Gmail Sends or reads email through your Gmail account.
6 Wait: Human Approval Wait Pauses the workflow until a condition or time is met.
7 IF: Approved? IF Splits the flow into branches based on a condition.
8 HTTP Request: Publish to Socials HTTP Request Calls an external API or webhook endpoint.
9 Slack: Notify Published Slack Posts messages or reads data in Slack.
10 Slack: Notify Held Slack Posts messages or reads data in Slack.

Setup instructions

1. Add your credentials

In n8n go to Credentials → New, create each credential below, then open the named node and select it:

NodeCredential to add
OpenAI: Write Script OpenAI API
HTTP Request: Render Video HTTP Header Auth
Gmail: Request Approval Gmail OAuth2
HTTP Request: Publish to Socials HTTP Header Auth
Slack: Notify Published Slack OAuth2
Slack: Notify Held Slack OAuth2

How this workflow starts

  • Schedule Trigger: Runs every cron.

Use cases

A weekly video pipeline with a human gate in the middle. The Schedule Trigger starts it every Monday at 9:00 AM. Set Topic defines the video's topic and target audience for the run. OpenAI: Write Script sends the topic to GPT and gets back a ready-to-render 60-second video script. HTTP Request: Render Video POSTs the script to a video-generation API (HeyGen or Synthesia style) and gets back a video URL. Gmail: Request Approval emails the finished video link plus an approval link — and this is the load-bearing step: nothing publishes until a human approves. Wait: Human Approval pauses the execution; opening the approval link from the email shows an Approve/Reject form built from the execution's resume URL, and submitting it resumes the workflow exactly where it paused. IF: Approved? routes approved videos to HTTP Request: Publish to Socials (posting to the X/LinkedIn scheduler) and Slack: Notify Published; rejections go to Slack: Notify Held. It exists for people whose video ideas die because production always feels like a project.

The solo founder's weekly product tip

A SaaS founder knows a weekly 60-second tip video would build her audience, but filming, editing, and uploading never survive contact with her calendar. Her Monday loop is now: edit Set Topic to this week's tip (or leave a rotating list), let the 9 AM run write the script and render the video, and approve from the Gmail on her phone over coffee. The approval email carries the video link, so she watches the actual render before it goes anywhere — quality control without a production day. Practical tip: feed topics from a Google Sheet instead of the Set Topic node, so a quarter of topics can be planned in one sitting and the pipeline never stalls waiting for an idea.

The course creator's promo clips

A course creator needs eight weeks of launch promos and dreads recording eight videos. With a Synthesia-style avatar as presenter, each week's run turns a module highlight into a polished 60-second clip: the script comes from GPT, the render from the video API, and her only job is the approval click. The Slack: Notify Published message gives her team a visible record of what went out each week, which matters when a launch has five people coordinating. Practical tip: duplicate HTTP Request: Publish to Socials and point the copy at a second scheduler endpoint — one approval then publishes to both X and LinkedIn without extra work.

The local business's weekly offer video

A gym owner wants a short video every week announcing the week's class schedule and offers, but hiring a videographer weekly is absurd for a single location. The topic each Monday is simply this week's offer; the render is template-consistent, which is actually a branding advantage — followers recognize the format. Approval happens on his phone between sessions, and Slack: Notify Held tells his part-time social media helper when a video was rejected so she knows to expect a re-run, not a post. Practical tip: change the cron expression in the Schedule Trigger (currently Monday 9 AM) to whatever day the week's offers are finalized — the pipeline fits the business rhythm, not the other way around.

The agency producing client content with approval built in

A three-person agency promised clients "two videos a month" and the approval process is chaos: cuts sent over WhatsApp, feedback in email threads, nobody sure which version is final. This workflow makes approval structural instead of social. The Gmail: Request Approval email goes to the client directly, the Approve/Reject form is unambiguous, and the workflow physically cannot publish a rejected video — IF: Approved? enforces it. Slack: Notify Held alerts the agency the moment a client rejects, with no chasing required. Practical tip: resist the "auto-publish without approval" customization for client work. Deleting the Wait and IF nodes is only sensible for the agency's own channels, where it trusts its own taste.

The newsletter writer going video

A writer with a 20,000-subscriber newsletter wants to repurpose each issue as a short video but has no on-camera presence and no editor. Each week she pastes the issue's core angle into Set Topic; OpenAI: Write Script compresses it into a 60-second script; the avatar video carries it. The approval step doubles as her editorial check — she watches the render the way she would proofread a draft. Over a quarter, the video catalog becomes a discovery surface that points back at the newsletter. Practical tip: once the pipeline has earned her trust after a month of approvals, consider the auto-publish customization — but keep the Gmail notification, so she still sees every video that went out.

← All templates