Automate book recommendations using this advanced n8n workflow. It leverages the Ollama LLM to analyze email requests, finds relevant titles via OpenLibrary, and sends personalized recommendation emails.
Download this n8n workflow template and start using it instantly.
Reading Clubs and Educators: Automatically suggest books based on member requests or curriculum topics.
Automated Content Creators: Generate relevant content or suggestions for newsletters quickly.
Developers and Automation Engineers: Anyone seeking practical n8n templates integrating self-hosted LLMs (Ollama) with external APIs.
Librarians and Information Specialists: Streamline the process of responding to common genre requests.
This powerful n8n workflow solves the problem of manually responding to book request inquiries. By integrating a local or self-hosted Large Language Model (LLM) like Ollama with the vast OpenLibrary database, the process is instant and highly personalized. The n8n automation starts when a request email arrives, uses the LLM to intelligently extract the user's intent (e.g., 'fantasy' or 'thriller'), and then fetches a specific, randomly selected book recommendation.
This specific n8n node combination ensures high accuracy in genre parsing, robust error handling for subjects where no books are found, and the final output is a rich, HTML-formatted email. Utilizing this n8n template saves time and provides an engaging, immediate response to user requests, showcasing the power of advanced n8n integrations.
The process begins with the designated n8n trigger, the IMAP-based 'Email Trigger – Book Request' node, which monitors an inbox for new messages.
To set up this n8n workflow, follow these steps:
llama3.2-16000:latest in the example).toEmail and fromEmail fields in the Send Email nodes and replace placeholder addresses (e.g., [email protected], [email protected]) with your actual target and sender emails. Email Trigger – Book Request (n8n trigger):
Function: Initiates the n8n workflow when a new email is detected in the configured IMAP inbox.
Key Configuration: Uses IMAP credentials to poll the specified mailbox.
Analyze Email with Ollama (Langchain Agent n8n node):
Function: Connects to the local Ollama instance to analyze the email body (textPlain) and extract the book genre using a highly specific system prompt.
Key Configuration: Uses the llama3.2-16000:latest model and a custom prompt to ensure the output is a clean, lowercase genre.
Call Book Search API (HTTP Request n8n node):
Function: Queries the OpenLibrary API using the genre extracted by the LLM.
Key Configuration: URL dynamically built using https://openlibrary.org/subjects/{{ $json.subject-name}}.
Check Book Name (Code n8n node):
Function: Executes custom JavaScript to calculate a pseudo-random index (retrievebook) based on the total number of search results (workcount), ensuring a different book is picked each time.
Retrieve Book Details (HTTP Request n8n node):
Function: Fetches the detailed description of the randomly selected book from OpenLibrary.
Key Configuration: URL dynamically constructed using the book's key from the previous API result.
Enhance Data with Code (Code n8n node):
Function: Processes the array of authors and transforms it into a clean, comma-separated string of linked HTML anchor tags, enhancing the presentation in the final email.
Send Recommendation Email (Email Send n8n node):
Function: Sends the final, richly formatted book recommendation to the recipient via SMTP.
* Key Configuration: Uses expressions to insert the generated subject and HTML body from preceding n8n nodes.
Use this powerful n8n workflow to capture new IMAP emails, automatically clean and standardize the content, prevent duplicates using PostgreSQL, and save everything neatly into Notion. Get immediate Telegram notifications upon success.

Use this powerful n8n workflow to automatically parse, analyze, and structure incoming Gmail messages using LLMs (GPT/Mistral). Turn unstructured email data into a Mem0 RAG knowledge base asset. Explore more n8n templates today.

Use this efficient n8n workflow to automate daily sales outreach. It reads new leads from Google Sheets, filters untouched entries, sends personalized emails via Outlook, and ensures leads are marked as contacted to prevent duplicates. An essential n8n template for sales teams.

Use of Mistral AI agents within this advanced n8n workflow to automatically convert actionable emails from Gmail and Outlook into structured tasks in Google Tasks or Microsoft To Do, maximizing productivity.

Automate social media content creation using this powerful n8n workflow. Trigger AI (OpenAI) thread generation via email and instantly post structured content to X (Twitter), Threads, and Bluesky.

The AI Squad Initiative is a pioneering effort to build, automate and scale AI-powered workflows using n8n.io. Our mission is to help individuals and businesses integrate AI agents seamlessly into their daily operations from automating tasks and enhancing productivity to creating innovative, intelligent solutions. We design modular, reusable AI workflow templates that empower creators, developers and teams to supercharge their automation with minimal effort and maximum impact.







































