Schedule YouTube Shorts to Pinterest with Apify, Gemini, and an OpenAI model

Go to Workflow
0 views
Built by Ghufran Barcha Ghufran Barcha
Created on July 28, 2026

Description

Quick overview
This workflow receives YouTube Shorts webhook events, downloads the video via Apify, uses Google Gemini and an OpenAI-compatible chat model to generate Pinterest SEO metadata and choose a board, then schedules a Pinterest video pin through Zernio (Late) for publishing.

How it works
Receives a webhook request for YouTube PubSubHubBub verification and responds with the provided hub challenge.
Receives a POST webhook event for a new YouTube video and extracts the title, video ID, channel ID, and video URL from the feed payload.
Uses Apify to fetch and process the YouTube Short and returns a downloadable MP4 URL.
Sends the video to the Google Generative Language (Gemini) API to generate an analysis used for Pinterest-focused metadata.
Uses a LangChain LLM chain (with structured output validation) to produce a Pinterest-ready title, description, hashtags, and a board selection from a fixed list.
Maps the selected board name to a Pinterest board ID and schedules the video post to Pinterest via the Zernio (Late) API.

Setup
Create the YouTube webhook/PubSubHubbub subscription and configure it to call this workflow’s webhook URL at the manga-monarch-webhook path for both verification and POST notifications.
Add Apify API credentials and ensure the configured actor (UUhJDfKJT2SsXdclR) is available in your Apify account.
Add Google Palm/Gemini API credentials for the Google Generative Language request and the Gemini chat model.
Add an OpenAI-compatible API credential for the chat model used by the LangChain step.
Add Zernio (Late) API credentials and replace the hardcoded Pinterest accountId and board ID mapping values with your own Pinterest account and board IDs.

Nodes Used (5)

Basic LLM Chain
@n8n/n8n-nodes-langchain.chainLlm
Google Gemini Chat Model
@n8n/n8n-nodes-langchain.lmChatGoogleGemini
HTTP Request
n8n-nodes-base.httpRequest
OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
Structured Output Parser
@n8n/n8n-nodes-langchain.outputParserStructured