Introduction
Creating captivating children’s stories paired with vibrant illustrations has traditionally required significant time, artistic skill, and resources. However, advances in artificial intelligence are transforming this creative process, making it accessible to anyone with an idea. By leveraging AI-powered tools, authors and creators can now effortlessly generate both engaging narratives and matching illustrations in minutes.
In this article, we explore a custom-built workflow using n8n automation combined with replicate.com’s ideogram-ai/ideogram-v2a-turbo model. This system allows users to input a simple one-liner prompt—such as “2 tomatoes become friends in garden”—and automatically produces a short children’s story along with a colorful illustration that brings the tale to life. This seamless integration of AI storytelling and image generation opens new possibilities for educators, parents, and aspiring authors to create personalized children’s books quickly and creatively.
What are we going to build
⚠️Before continuing you make sure you have Google Drive and Docs linked in your n8n instance.
Step 1 - Input Form
Let's start by adding our trigger node, which is on form submission, with the following settings
When the workflow starts, users should see a form like the following
Step 2 - Generate Story
Next, add a new node using OpenAI message a model and use GPT-4.1-Nano as the model with the following prompts
Step 3 - Save the Story in Google Docs
Add a new node to create a folder in your Google Drive
The folder title will be the story title generated by the OpenAI model.
Now, let's add a new document to the Folder to write an AI-generated story.
Now let's loop (batch of 1) over each paragraph of the generated story and write it to the doc
Step 4 - Generate the Prompt for Image
From the Create Folder node, add a new branch to generate an Image generation prompt using the OpenAI model, providing the story and asking the model to write a prompt to generate a children's illustration for that story. Add a new OpenAI message to a model node using GPT-4.1-NANO
model
Step 5 - Generate the Image with Replicate
Now let's make an HTTP call to the replicate.com endpoint and generate an image using ideogram-ai/ideogram-v2a-turbo
The model feeding prompt was generated in the previous step. Here are the details of the HTTP node
- Method: POST
- URL: https://api.replicate.com/v1/models/ideogram-ai/ideogram-v2a-turbo/predictions
- Add a header for
Authorization Bearer [your-replicate-api-key]
- Add a header for
Content-Type application/json
- Add a header for
Prefer wait
Check the Send Body flag and add the following as JSON to it
After this node, add another HTTP node to get the Binary file of the generated image, so we can use it to save in the Google Drive
Step 6 - Save the Image to Google Drive
Using the downloaded binary file to upload it to the Google Drive
Conclusion
By combining the power of AI-driven storytelling and illustration generation within an automated n8n workflow, creating personalized children’s books has become remarkably simple and efficient. This approach eliminates traditional barriers such as artistic skill and lengthy production times, enabling anyone—from educators and parents to aspiring authors—to bring their imaginative ideas to life with just a few clicks. Leveraging replicate.com’s ideogram-ai model ensures that each story is accompanied by vibrant, engaging illustrations that perfectly complement the narrative.
This seamless integration of AI tools not only accelerates the creative process but also opens new avenues for creativity and customization in children’s literature. As AI technology continues to advance, workflows like this will empower more people to craft unique stories that inspire and delight young readers everywhere. Whether you’re looking to create a one-off story or build a library of illustrated tales, this AI-powered workflow offers a scalable, accessible, and fun solution for modern storytelling.