Huashu Design
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
An n8n workflow that turns a history topic sent to a Telegram bot into an illustrated PDF book. OpenAI checks the topic and writes the chapters, Kie.ai draws a picture for each, and APITemplate.io makes the PDF for Google Drive.
Illustrated history PDF book from a Telegram message is an n8n workflow in the Marketing & SEO category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page or copy its JSON, then import it into an n8n canvas. Nothing runs until you activate it in n8n.
Telegram message
It starts when someone sends your bot a text message with:
An illustrated PDF book in your Drive, and a sheet row with its link, from one Telegram message
What you need before you start.
Chat trigger
Takes each message sent to your bot, and replies when a topic is turned away or a file is sent.
NeedsA Telegram bot token from BotFather
Language models
Runs gpt-4.1-mini to check the topic and gpt-5.1 with web search to write the chapters.
NeedsOpenAI API key
Image generation
Draws one wide picture for each chapter with Nano Banana Pro and reports the task’s state.
NeedsKie.ai API key, typed into two headers, and credit
Image hosting
Takes each picture through an unsigned upload and returns the public address the PDF shows.
NeedsA cloud name and an Unsigned upload preset
PDF rendering
Renders the chapter pages from HTML into an A4 PDF and returns its download address.
NeedsAPITemplate.io API key, typed into the node’s header
Job log
Holds a row for the book and one for each picture, with their statuses and links.
NeedsA Google account to sign in with, and a sheet with eight headers
PDF storage
Saves the finished PDF in the root of My Drive.
NeedsA Google account to sign in with
Checked by Mindket on 13 Nov 2026
This n8n workflow turns a topic sent to a Telegram bot into an illustrated PDF book about it. A small OpenAI model first checks that the topic is history, a life story or an educational concept. A larger one, gpt-5.1 with web search, then writes between five and twenty chapters in date order, each with a paragraph and an image prompt. Kie.ai draws a picture for every chapter with Nano Banana Pro, Cloudinary hosts it, and APITemplate.io lays the chapters out as A4 pages, one chapter a page. The PDF lands in Google Drive. A sheet tracks the book and each picture. It has 37 nodes.
Teachers, tutors, history channels and makers of digital products who want a picture book on a topic without laying it out by hand. One message gives a finished booklet, so it suits handouts, lead magnets and study guides. Skip it when the facts must be sourced. The chapters cite nothing. The classifier also turns away topics outside history and education. Read each PDF before you share it.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Education | Teachers | Send a unit’s topic the night before a lesson | A teacher prints the booklet on the French Revolution as a class handout. |
| Tutoring | Private tutors | Make a short reader for each student’s exam topic | A tutor sends a student a guide to the Cold War, a page for each turning point. |
| Digital products | Creators who sell PDFs | Test a topic with a sample booklet before writing a longer one | A creator offers a booklet on ancient Rome as a free download. |
| History on YouTube | Channel owners | Draft a dated outline and stills for an episode | A channel owner uses the chapter dates as the running order. |
You need some n8n and six accounts, for Telegram, OpenAI, Kie.ai, Cloudinary, APITemplate.io and Google, and its author puts setup at about 24 minutes once they are ready.
Any n8n on a public https address will run it, since Telegram delivers each message to a webhook. Everything it makes ends in your Drive and your sheet.
Get it saves a zip with workflow.json and Mindket’s setup notes in your downloads folder. Make the sheet and the Cloudinary preset first.
| Need | Detail |
|---|---|
| n8n | On n8n Cloud or on a server of your own, reachable over https |
| Telegram | A bot and its token, from BotFather |
| OpenAI | An API key with access to gpt-5.1 and gpt-4.1-mini |
| Kie.ai | An API key with credit, for Nano Banana Pro |
| Cloudinary | A cloud name and an unsigned upload preset |
| APITemplate.io | An API key |
| An account for a Google Sheets OAuth2 and a Google Drive OAuth2 credential | |
| A sheet | A first tab named Sheet1 with eight headers in row 1 |
| Column | What it holds |
|---|---|
ID | A UUID for the book or for one picture |
Parent ID | On a picture’s row, its book’s ID |
Concept | On the book’s row, the topic as the classifier rewrote it |
Type | Briefing Job for the book, Asset Creation for a picture |
Status | Queued, Generating... or Completed |
Prompt | On a picture’s row, its image prompt |
Public Link | On a picture’s row, its Cloudinary address |
PDF Link | On the book’s row, the PDF’s Drive link |
workflow.json./d/ and /edit.Telegram Trigger, Send a text message and Send a text message1.OpenAI Chat Model and OpenAI Chat Model1.YOUR_SHEET_ID in each with the ID.nano-banana-pro and nano-banana-pro-result, replace <YOUR_KIE_API_KEY> after Bearer with your Kie.ai key. The brackets go too.Upload Photo, put your cloud name in place of <YOUR_CLOUD_NAME>, brackets included, and your preset and a folder in place of YOUR_PRESET_NAME and YOUR_FOLDER_NAME.HTML to PDF, replace <YOUR_APITEMPLATE_API_KEY> in the X-API-KEY header with your key, brackets included.Upload PDF.HTML to PDF calls APITemplate.io’s US region, rest-us, so change the address if your account sits in another one. Set Restrict to User IDs in Telegram Trigger before anyone else learns the bot’s name.
Send the bot a topic in a few words, such as the moon landing. Other subjects get a short refusal. A valid one runs by itself, and the sheet shows the book’s row and then a row for each picture as it is drawn. A long book takes ten minutes or more, since every picture waits at least 30 seconds. Open the PDF Link once the book’s row reads Completed, because the bot sends nothing when the book is done.
| To change | Where |
|---|---|
| Which topics pass | The system message in AI Agent1 |
| The chapters | The system message in AI Agent: how many, how long and in what voice |
| The pictures | aspect_ratio, resolution and output_format in the body of nano-banana-pro |
| The page design | The HTML and CSS in HTML, including the fonts and the footer |
| Paper and margins | settings in the body of HTML to PDF |
| Where the PDF goes | The drive and folder in Upload PDF, the root of My Drive in the file |
You send the bot one line.
the moon landing
AI Agent1 rewrites it as a title such as The Apollo 11 Moon Landing, and Create Job adds the book’s row. AI Agent then returns chapters like this one, trimmed:
{
"chapter_id": 4,
"title": "One Small Step",
"date": "July 1969",
"content": "Neil Armstrong climbed down the ladder of the lunar module and stepped onto the Sea of Tranquility...",
"image_prompt": "An astronaut in a white suit steps off a ladder onto grey dust under a black sky, a sign beside the lander reading July 1969."
}Each chapter becomes one page with its title, a date badge, the picture, the paragraph and a footer with its ID. At the end, the book’s row reads like this:
| Column | Value |
|---|---|
| Concept | The Apollo 11 Moon Landing |
| Type | Briefing Job |
| Status | Completed |
| PDF Link | A Drive link to the PDF, named after the topic and the ID |
If you are new. n8n draws a workflow as boxes joined by lines, and each box, a node, does one job. A credential is a key n8n keeps for you and hands to the node you pick it in. Here four notes on the canvas mark the stages: checking the topic, writing the chapters, drawing the pictures and making the PDF. Send a small topic first and watch the sheet fill. Each node shows what it received and what it sent, which is where a refused key or a failed picture turns up.
For experts. Two OpenAI agents with structured output parsers write the text, and Kie.ai and APITemplate.io do the rest through plain HTTP requests from n8n.
| Node | Model or call | What to know |
|---|---|---|
AI Agent1 | gpt-4.1-mini | Returns is_valid, refined_topic and reply_to_user, and an If reads is_valid |
AI Agent | gpt-5.1 with OpenAI’s built-in web search | Its parser wants chapters, each with title, date, content and image_prompt |
nano-banana-pro | Kie.ai’s jobs/createTask, model nano-banana-pro | A 16:9 PNG at 1K, with no reference image |
Switch | The Kie.ai task’s state | Waiting, queuing and generating loop back to Wait, success moves on and fail goes nowhere |
HTML to PDF | APITemplate.io’s v2/create-pdf-from-html | A4 with backgrounds printed. Its body was repaired, see Good to know |
Merge joins the queued rows with the chapters on id. Edit Fields then hands the loop each chapter with its picture’s address.
The finished book stays in your Drive and your sheet. Nobody is told on Telegram.
Update row in sheet2 with PDF Link if the person who asked should get the bookTelegram Triggergpt-4.1-mini on 14 January 2027, with gpt-6-luna as the replacement, and gpt-5.1 on 1 April 2027, with gpt-6-solHTML to PDF. As exported, it deleted every letter n from the page and left its quotes unescaped, so the call could not succeed. The kit puts them backSwitch sends fail nowhere, so the loop stops, no PDF is made and the rows stay at Generating...AI Agent1 with no text, and the run fails without a replyAn n8n workflow that turns a history topic sent to a Telegram bot into an illustrated PDF book. A small OpenAI model
checks that the topic is history or an educational concept. A larger one researches it on the web and writes between 5
and 20 chapters, each with a date and an image prompt. Kie.ai draws one picture per chapter with Nano Banana Pro, and
APITemplate.io lays the chapters out as A4 pages. The PDF goes to your Google Drive, and a Google Sheet tracks the book
and every picture.
workflow.json: the workflow as n8n exports it, 37 nodes. Four are sticky notes that only name the stages. It holdsREADME.md: these notes.YOUR_SHEET_ID and find the tab by the nameSheet1.Bearer <token>. They now read Bearer <YOUR_KIE_API_KEY>. The APITemplate.io header now<YOUR_APITEMPLATE_API_KEY>.HTML to PDF: the export had dropped two backslashes from its body. It read .replace(/"/g, '\"') and.replace(/n/g, ''), which left every double quote in the HTML unescaped and deleted every letter n from the page..replace(/"/g, '\\"') and .replace(/\n/g, ''), as the step needs to send valid JSON.<YOUR_CLOUD_NAME>, YOUR_PRESET_NAME and YOUR_FOLDER_NAME, were already in the file.gpt-5.1 and gpt-4.1-mini.workflow.json.Sheet1, with the eight headers below in row 1. Copy its ID: the long/d/ and /edit.Telegram Trigger, Send a text message andSend a text message1.OpenAI Chat Model and OpenAI Chat Model1.Create Job, Append row in sheet2, Update row in sheet,Update row in sheet1 and Update row in sheet2, and replace YOUR_SHEET_ID in each with the ID.nano-banana-pro and nano-banana-pro-result, replace <YOUR_KIE_API_KEY> after Bearer with your Kie.ai key.Upload Photo, replace <YOUR_CLOUD_NAME> in the address withYOUR_PRESET_NAME andYOUR_FOLDER_NAME.HTML to PDF, replace <YOUR_APITEMPLATE_API_KEY> in the X-API-KEY header with your key, brackets included.rest-us to the region your account uses if it differs.Upload PDF. The file goes to the root of My Drive.the moon landing.Row 1 of Sheet1 holds these eight headers, spelled as here. A book takes one row and each of its pictures one more:
| Column | The book's row | A picture's row |
|---|---|---|
| ID | A new UUID | A new UUID |
| Parent ID | Empty | The book's ID |
| Concept | The topic as the classifier rewrote it | Empty |
| Type | Briefing Job | Asset Creation |
| Status | Generating..., then Completed | Queued, Generating..., then Completed |
| Prompt | Empty | The image prompt |
| Public Link | Empty | The picture's Cloudinary address |
| PDF Link | The PDF's Drive link | Empty |
Telegram Trigger takes every message sent to the bot. File Check answers a document with Files not supported.AI Agent1, on gpt-4.1-mini, decides whether the text is a history or education topic. If it is not, the botCrypto1, and Create Job adds the book's row with the rewritten topic.AI Agent, on gpt-5.1 with OpenAI's web search, writes 5 to 20 chapters in date order. Each has a title, a date,Split Out and Crypto give each chapter its own UUID, and Append row in sheet2 queues a row for it.Loop Over Items takes one chapter at a time. nano-banana-pro asks Kie.ai for a 16:9 PNG at 1K. Wait pauses 30nano-banana-pro-result asks for the task's state and Switch routes it: still working waits again, donedownload-image fetches the picture, Upload Photo puts it on Cloudinary, and Update row in sheet1 marks the rowCompleted with its address.Aggregate and HTML build one page per chapter: the title, a date badge, the picture,HTML to PDF sends the page to APITemplate.io as an A4 PDF, Download PDF fetches it and Upload PDF saves it toUpdate row in sheet2 marks the book Completed with the Drive link.AI Agent1.AI Agent.aspect_ratio, resolution and output_format in the body of nano-banana-pro.HTML, including the fonts and the footer's text.settings in the body of HTML to PDF.Upload PDF's drive and folder.Update row in sheet2 with PDF Link if they should get it.Telegram Trigger to your own ID.gpt-4.1-mini on 14 January 2027, with gpt-6-luna as the replacement, andgpt-5.1 on 1 April 2027, with gpt-6-sol. Change OpenAI Chat Model1 and OpenAI Chat Model before thoseSwitch sends a fail state nowhere, so the loop stops there. No PDF is made,Generating... and nobody is told.AI Agent1 with no text,AI Agent says an outside reference image sets the art style, but nano-banana-proimage_input takes up to eight reference images ifREADME.md 8 KB workflow.json 48 KB
alchaincyf · Skill
Turns a one-line request in your AI agent into a finished design: a launch animation, a clickable app prototype, an editable slide deck, an infographic or a se…
op7418 · Skill
Skill that makes single-file HTML slide decks, slide illustrations and platform covers in two visual styles, with a presenter mode for rehearsal. For speakers…
alirezarezvani · Skill
Adds 411 ready-made skills for Claude Code and other coding agents, grouped by role from engineering and product to marketing, finance and compliance. Installs…
nerijs · Kit
A pixel art style add-on for Stable Diffusion XL that turns text prompts into pixel-style images, with an optional LCM LoRA for faster runs. For game makers, d…
LiconStudio · Kit
Keeps characters, clothing, objects and backgrounds consistent in generated video by feeding the model up to five reference images. A LoRA for LTX-2.5 in Comfy…
nhathoangfoto · Kit
A LoRA for FLUX.2 Klein 9B that puts a character into the pose shown by a mannequin reference while keeping the character's face and style. For artists and des…