Quick overview
This workflow receives a blog request via webhook, researches the topic with Tavily, generates a long-form HTML article using Google Gemini, creates two images via the kie.ai API, stores assets in Google Drive, updates a Google Sheets tracker, and notifies a Slack user with links.
How it works
- Receives a POST webhook request containing a Google Sheets row payload with an “AI Blog Title” and related metadata.
- Searches the web for supporting sources using Tavily and passes the research plus the title to Google Gemini to generate the full article as HTML.
- Converts the generated content to HTML, creates a temporary HTML file in Google Drive, downloads it to set the correct text/html MIME type, re-uploads it as the final Drive file, and deletes the temporary file.
- Sends the finished article to OpenAI to generate a short LinkedIn post, then updates the matching row in Google Sheets with a Done flag, the article folder/link value, and the LinkedIn post text.
- Creates a cover image and an in-article infographic by submitting two text-to-image jobs to the kie.ai API, polling until each job succeeds, downloading each resulting image, and uploading both images to Google Drive.
- Writes the Google Drive links for both images back to the same Google Sheets row and then fetches the updated row to send a Slack message with quick links to the sheet and the generated assets.
Setup
- Create credentials for Tavily, Google Gemini (PaLM), OpenAI, Google Drive, Google Sheets, and Slack, then select them in the corresponding nodes.
- Replace the placeholder “Bearer {YOUR API KEY}” headers and callback URL values in the kie.ai HTTP requests with your actual API key and a valid callback URL.
- Update the Google Sheets document ID and sheet/tab name (and ensure columns like AI Blog Title, row_number, Done, ARTICLE, LN Post, Image 1, and Image 2 exist and match the workflow mappings).
- Set the target Google Drive folder IDs for saving article HTML files and images, and adjust naming conventions if needed.
- Set the Slack recipient (user or channel) and edit the message template links to match your Drive folder and Google Sheets dashboard URLs.