This workflow follows the Chainllm → Gmail recipe pattern — see all workflows that pair these two integrations.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"name": "ayush3.1",
"nodes": [
{
"parameters": {},
"type": "n8n-nodes-base.manualTrigger",
"typeVersion": 1,
"position": [
-544,
-208
],
"id": "9c14ea20-019f-4d75-924c-41e975118eee",
"name": "When clicking \u2018Execute workflow\u2019"
},
{
"parameters": {
"url": "https://serpapi.com/search.json",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "engine",
"value": "google"
},
{
"name": "q",
"value": "=US federal holidays near {{$json.release_date}}"
},
{
"name": "api_key",
"value": "7960458d7231858baf19427ecbe5d00ce419bcfe05744a3c74352c39148809e7"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
-48,
-304
],
"id": "621324dc-45f7-4221-8692-033dcb84690c",
"name": "Search Holidays"
},
{
"parameters": {
"url": "https://serpapi.com/search.json",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "engine",
"value": "google"
},
{
"name": "q",
"value": "=major {{$json.genre}} book releases around {{$json.release_date}}"
},
{
"name": "api_key",
"value": "7960458d7231858baf19427ecbe5d00ce419bcfe05744a3c74352c39148809e7"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
-48,
-96
],
"id": "d250e410-381d-48f3-b2ad-acec0320abcf",
"name": "Search Competition"
},
{
"parameters": {
"sendTo": "ayushmishra0813@gmail.com",
"subject": "=Book Intelligence Report | {{ $('Fields').first().json.title }}\n\n",
"message": "=<h2>\ud83d\udcda Book Intelligence Report</h2>\n\n<p><strong>Title:</strong> {{ $('Fields').first().json.title }}</p>\n<p><strong>Author:</strong> {{ $('Fields').first().json.author }}</p>\n<p><strong>Genre:</strong> {{ $('Fields').first().json.genre }}</p>\n<p><strong>Release Date:</strong> {{ $('Fields').first().json.release_date }}</p>\n\n<hr>\n\n<h3>\ud83d\udcca Release Timing Assessment</h3>\n\n<p><strong>Overall Release Timing Score:</strong> {{ $json.output.overall_release_timing_score }}/100</p>\n\n<p><strong>Opportunity Level:</strong> {{ $json.output.opportunity_level }}</p>\n\n<p><strong>Risk Level:</strong> {{ $json.output.risk_level }}</p>\n\n<p><strong>Nearest Holiday:</strong> {{ $json.output.nearest_holiday }}</p>\n\n<p><strong>Holiday Score:</strong> {{ $json.output.holiday_score }}/20</p>\n\n<p><strong>Competition Level:</strong> {{ $json.output.competition_level }}</p>\n\n<p><strong>Competition Score:</strong> {{ $json.output.competition_score }}/20</p>\n\n<p><strong>Sports Impact Score:</strong> {{ $json.output.sports_score }}/20</p>\n\n<hr>\n\n<h3>\ud83d\udcc5 Nearby Holidays</h3>\n\n<ul>\n<li>\n<strong>{{ $json.output.nearby_holidays[0].holiday_name }}</strong>\n({{ $json.output.nearby_holidays[0].priority }})\n<br>\n{{ $json.output.nearby_holidays[0].reason }}\n</li>\n\n<li>\n<strong>{{ $json.output.nearby_holidays[1].holiday_name }}</strong>\n({{ $json.output.nearby_holidays[1].priority }})\n<br>\n{{ $json.output.nearby_holidays[1].reason }}\n</li>\n\n<li>\n<strong>{{ $json.output.nearby_holidays[2].holiday_name }}</strong>\n({{ $json.output.nearby_holidays[2].priority }})\n<br>\n{{ $json.output.nearby_holidays[2].reason }}\n</li>\n</ul>\n\n<hr>\n\n<h3>\ud83d\udcd6 Example Competing Titles</h3>\n\n<ul>\n<li><strong>{{ $json.output.example_competitors[0].title }}</strong> \u2014 {{ $json.output.example_competitors[0].reason }}</li>\n<li><strong>{{ $json.output.example_competitors[1].title }}</strong> \u2014 {{ $json.output.example_competitors[1].reason }}</li>\n<li><strong>{{ $json.output.example_competitors[2].title }}</strong> \u2014 {{ $json.output.example_competitors[2].reason }}</li>\n</ul>\n\n<hr>\n\n<h3>\ud83c\udfc6 Major Sports Events</h3>\n\n<ul>\n<li>\n<strong>{{ $json.output.major_sports_events[0].event_name }}</strong>\n({{ $json.output.major_sports_events[0].priority }})\n<br>\n{{ $json.output.major_sports_events[0].impact }}\n</li>\n\n<li>\n<strong>{{ $json.output.major_sports_events[1].event_name }}</strong>\n({{ $json.output.major_sports_events[1].priority }})\n<br>\n{{ $json.output.major_sports_events[1].impact }}\n</li>\n\n<li>\n<strong>{{ $json.output.major_sports_events[2].event_name }}</strong>\n({{ $json.output.major_sports_events[2].priority }})\n<br>\n{{ $json.output.major_sports_events[2].impact }}\n</li>\n\n<li>\n<strong>{{ $json.output.major_sports_events[3].event_name }}</strong>\n({{ $json.output.major_sports_events[3].priority }})\n<br>\n{{ $json.output.major_sports_events[3].impact }}\n</li>\n</ul>\n\n<hr>\n\n<h3>\ud83d\udcc8 Sales Forecast Assessment</h3>\n\n<p><strong>Author Popularity Score:</strong> {{ $json.output.author_popularity_score }}/20</p>\n\n<p><strong>Popularity Level:</strong> {{ $json.output.popularity_level }}</p>\n\n<p><strong>Market Demand Score:</strong> {{ $json.output.market_demand_score }}/20</p>\n\n<p><strong>Sell-Through Potential:</strong> {{ $json.output.sell_through_potential }}</p>\n\n<p><strong>Sales Potential:</strong> {{ $json.output.sales_potential }}</p>\n\n<p><strong>Forecast Confidence:</strong> {{ $json.output.forecast_confidence }}</p>\n\n<hr>\n\n<h3>\ud83d\udcda Comparable Titles</h3>\n\n<ul>\n<li>{{ $json.output.comparable_titles[0] }}</li>\n<li>{{ $json.output.comparable_titles[1] }}</li>\n<li>{{ $json.output.comparable_titles[2] }}</li>\n</ul>\n\n<hr>\n\n<h3>\ud83d\udcb0 Estimated First-Year Sales</h3>\n\n<ul>\n<li><strong>Low Estimate:</strong> {{ $json.output.estimated_first_year_sales.low }}</li>\n\n<li><strong>Expected Estimate:</strong> {{ $json.output.estimated_first_year_sales.expected }}</li>\n\n<li><strong>High Estimate:</strong> {{ $json.output.estimated_first_year_sales.high }}</li>\n</ul>\n\n<hr>\n\n<h3>\u2705 Final Recommendation</h3>\n\n<p>{{ $json.output.final_recommendation }}</p>\n\n<h3>\ud83d\udccb Executive Summary</h3>\n\n<p>{{ $json.output.executive_summary }}</p>\n\n<h3>\ud83d\udcdd Forecast Analysis</h3>\n\n<p>{{ $json.output.reasoning }}</p>\n\n<hr>\n\n<p><em>Generated automatically by the Book Intelligence Analyzer using release timing, competition, sports-event visibility, author popularity, comparable-title performance, and market-demand forecasting.</em></p>",
"options": {
"appendAttribution": false
}
},
"type": "n8n-nodes-base.gmail",
"typeVersion": 2.2,
"position": [
1264,
-560
],
"id": "60d5f6fa-c223-4e78-983c-eff6cbc2caec",
"name": "Send a message",
"credentials": {
"gmailOAuth2": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"assignments": {
"assignments": [
{
"id": "c4aab37b-75f0-4375-b756-939aa8db952f",
"name": "title",
"value": "Villa Coco",
"type": "string"
},
{
"id": "23046251-5513-4255-9f5b-894f4be0c75e",
"name": "genre",
"value": "Fiction",
"type": "string"
},
{
"id": "59619ed0-777e-4713-aa16-e8eab3c8570e",
"name": "target_market",
"value": "USA",
"type": "string"
},
{
"id": "eba27231-a518-48c2-b85a-e6c9f6bc5307",
"name": "release_date",
"value": "2026-06-09",
"type": "string"
},
{
"id": "749c80cf-4d1d-4547-a07a-9476fe2ce050",
"name": "author",
"value": "Andrew Sean Greer",
"type": "string"
},
{
"id": "77cd6c83-440d-4138-9283-4733ec88eb95",
"name": "publisher",
"value": "Doubleday",
"type": "string"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.set",
"typeVersion": 3.4,
"position": [
-336,
-208
],
"id": "01a15043-082a-43c3-84f8-45121202adff",
"name": "Fields"
},
{
"parameters": {
"url": "https://serpapi.com/search.json",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "engine",
"value": "google"
},
{
"name": "q",
"value": "=major US sports events around {{ $('Fields').item.json.release_date }}"
},
{
"name": "api_key",
"value": "7960458d7231858baf19427ecbe5d00ce419bcfe05744a3c74352c39148809e7"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
-48,
96
],
"id": "7a5850e1-3b76-433b-85e2-fa93a5f17109",
"name": "Search Sports Events"
},
{
"parameters": {
"promptType": "define",
"text": "=You are a senior publishing market analyst specializing in U.S. book launches.\n\nBOOK DETAILS\n\nTitle:\n{{ $('Fields').first().json.title }}\n\nGenre:\n{{ $('Fields').first().json.genre }}\n\nRelease Date:\n{{ $('Fields').first().json.release_date }}\n\nTASK\n\n1. Identify the nearest major U.S. holiday.\n2. Assign a holiday score (0-20).\n\n3. Return EXACTLY 3 nearby holidays ranked by relevance.\n\nFor each holiday provide:\n- holiday_name\n- priority (High, Medium, Low)\n- reason\n\n4. Analyze release competition.\n\n5. Return EXACTLY 3 competing books.\n\nFor each competitor provide:\n- title\n- reason (max 15 words)\n\n6. Assign competition score (0-20).\n7. Determine competition level.\n\n8. Analyze sports events occurring within 14 days of release.\n\n9. Return EXACTLY 5 sports events.\n\nFor each sports event provide:\n- event_name\n- priority (High, Medium, Low)\n- impact (max 20 words)\n\n10. Assign sports score (0-20).\n\n11. Calculate overall release timing score (0-100).\n\n12. Determine:\n- opportunity_level\n- risk_level\n\n13. Provide:\n- final_recommendation (max 60 words)\n- executive_summary (max 40 words)\n\nIMPORTANT\n\nPriority definitions:\n\nHIGH:\nLikely to significantly influence consumer attention or book sales.\n\nMEDIUM:\nModerate influence.\n\nLOW:\nLimited influence.\n\nThe following fields are mandatory:\n\n- nearest_holiday\n- holiday_score\n- nearby_holidays\n- competition_level\n- competition_score\n- example_competitors\n- sports_score\n- major_sports_events\n- overall_release_timing_score\n- opportunity_level\n- risk_level\n- final_recommendation\n- executive_summary\n\nReturn ONLY valid JSON.\nNo markdown.\nNo explanations.",
"hasOutputParser": true,
"batching": {}
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.9,
"position": [
640,
-304
],
"id": "20159ffa-429b-444f-9125-7f85a9fa4800",
"name": "Basic LLM Chain"
},
{
"parameters": {
"model": "gpt-5.4",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
"typeVersion": 1,
"position": [
624,
-128
],
"id": "2354da0b-d642-4c21-86e1-1cf4009b681d",
"name": "Azure OpenAI Chat Model",
"credentials": {
"azureOpenAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"numberInputs": 3,
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
352,
-208
],
"id": "0aafbfff-fef3-47d7-a8ca-680ac2cb1372",
"name": "Merge"
},
{
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"nearest_holiday\": \"\",\n \"holiday_score\": 0,\n\n \"nearby_holidays\": [\n {\n \"holiday_name\": \"\",\n \"priority\": \"\",\n \"reason\": \"\"\n },\n {\n \"holiday_name\": \"\",\n \"priority\": \"\",\n \"reason\": \"\"\n },\n {\n \"holiday_name\": \"\",\n \"priority\": \"\",\n \"reason\": \"\"\n }\n ],\n\n \"competition_level\": \"\",\n \"competition_score\": 0,\n\n \"example_competitors\": [\n {\n \"title\": \"\",\n \"reason\": \"\"\n },\n {\n \"title\": \"\",\n \"reason\": \"\"\n },\n {\n \"title\": \"\",\n \"reason\": \"\"\n },\n {\n \"title\": \"\",\n \"reason\": \"\"\n }\n ],\n\n \"sports_score\": 0,\n\n \"major_sports_events\": [\n {\n \"event_name\": \"\",\n \"priority\": \"\",\n \"impact\": \"\"\n },\n {\n \"event_name\": \"\",\n \"priority\": \"\",\n \"impact\": \"\"\n },\n {\n \"event_name\": \"\",\n \"priority\": \"\",\n \"impact\": \"\"\n },\n {\n \"event_name\": \"\",\n \"priority\": \"\",\n \"impact\": \"\"\n }\n ],\n\n \"overall_release_timing_score\": 0,\n \"opportunity_level\": \"\",\n \"risk_level\": \"\",\n\n \"final_recommendation\": \"\",\n \"executive_summary\": \"\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.3,
"position": [
784,
-128
],
"id": "5191865a-1338-427e-bb71-61938907639e",
"name": "Structured Output Parser"
},
{
"parameters": {
"url": "https://serpapi.com/search.json",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "engine",
"value": "google"
},
{
"name": "q",
"value": "={{ $('Fields').first().json.author }} author books sales popularity"
},
{
"name": "num",
"value": "10"
},
{
"name": "api_key",
"value": "7960458d7231858baf19427ecbe5d00ce419bcfe05744a3c74352c39148809e7"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
-112,
-512
],
"id": "3b3823bd-02ab-4394-aa18-d27a4095a0e3",
"name": "Search Author Popularity"
},
{
"parameters": {
"url": "https://serpapi.com/search.json",
"sendQuery": true,
"queryParameters": {
"parameters": [
{
"name": "engine",
"value": "google"
},
{
"name": "q",
"value": "={{ $('Fields').first().json.genre }} bestselling books 2025 2026"
},
{
"name": "api_key",
"value": "7960458d7231858baf19427ecbe5d00ce419bcfe05744a3c74352c39148809e7"
}
]
},
"options": {}
},
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 4.4,
"position": [
-128,
-704
],
"id": "2138b04e-aae1-42fc-b32e-adc339438339",
"name": "Search Comparable Books"
},
{
"parameters": {
"promptType": "define",
"text": "=BOOK DETAILS\n\nTitle:\n{{ $('Fields').first().json.title }}\n\nAuthor:\n{{ $('Fields').first().json.author }}\n\nGenre:\n{{ $('Fields').first().json.genre }}\n\nRelease Date:\n{{ $('Fields').first().json.release_date }}\n\nAUTHOR SEARCH RESULTS\n\n{{ JSON.stringify($json.organic_results) }}\n\nCOMPARABLE BOOK SEARCH RESULTS\n\n{{ JSON.stringify($json.organic_results_1 || $json.organic_results) }}\n\nTASK\n\n1. Evaluate author popularity.\n2. Identify 3 comparable books.\n3. Estimate market demand.\n4. Estimate sales potential.\n\nForecast Analysis Requirements:\n\n- Keep the reasoning concise.\n- Limit the reasoning to a maximum of 120 words.\n- Focus only on the most important drivers of the forecast.\n- Avoid repeating information already reflected in the scores or sales estimates.\n\nIMPORTANT\n\nestimated_first_year_sales MUST ALWAYS contain:\n\n{\n \"low\": number,\n \"expected\": number,\n \"high\": number\n}\n\nDo not return ebook, audiobook, hardcover, international, total_units, or any other structure.\n\nUse total first-year units sold across all formats.\n\nReturn EXACTLY 3 comparable titles.\n\nFormat each as:\n\"Book Title by Author Name\"\n\nExample:\n\"The Midnight Library by Matt Haig\"\n\nReturn:\n\n- author_popularity_score (0-20)\n- popularity_level\n- market_demand_score (0-20)\n- sell_through_potential\n- comparable_titles\n- sales_potential\n- forecast_confidence\n- estimated_first_year_sales\n- reasoning\n\nReturn JSON only.",
"hasOutputParser": true,
"messages": {
"messageValues": [
{
"message": "You are a professional publishing market analyst and sales forecasting expert. Analyze author popularity, comparable titles, market demand, and likely commercial performance. Provide realistic and evidence-based estimates. Return only valid JSON matching the required schema."
}
]
},
"batching": {}
},
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"typeVersion": 1.9,
"position": [
464,
-736
],
"id": "171211d9-c556-4de1-9eef-90d4f0699dc3",
"name": "Comparable Books Analysis"
},
{
"parameters": {
"model": "gpt-5.4",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatAzureOpenAi",
"typeVersion": 1,
"position": [
496,
-576
],
"id": "b040db0e-0d57-4b12-817e-34641e003c81",
"name": "Azure OpenAI Chat Model2",
"credentials": {
"azureOpenAiApi": {
"name": "<your credential>"
}
}
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
224,
-672
],
"id": "0c2146b9-03f6-4bcc-98bf-2d9155f20140",
"name": "Merge1"
},
{
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"author_popularity_score\": 0,\n \"popularity_level\": \"\",\n\n \"market_demand_score\": 0,\n \"sell_through_potential\": \"\",\n\n \"comparable_titles\": [\n \"\",\n \"\",\n \"\"\n ],\n\n \"sales_potential\": \"\",\n \"forecast_confidence\": \"\",\n\n \"estimated_first_year_sales\": {\n \"low\": 0,\n \"expected\": 0,\n \"high\": 0\n },\n\n \"reasoning\": \"\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"typeVersion": 1.3,
"position": [
640,
-592
],
"id": "98c13835-a360-47ce-9172-95ec4d94df06",
"name": "Structured Output Parser1",
"retryOnFail": true,
"waitBetweenTries": 5000
},
{
"parameters": {
"mode": "combine",
"combineBy": "combineByPosition",
"options": {}
},
"type": "n8n-nodes-base.merge",
"typeVersion": 3.2,
"position": [
1040,
-560
],
"id": "4a578b73-6710-4f0a-8664-673ae778db57",
"name": "Merge2"
}
],
"connections": {
"When clicking \u2018Execute workflow\u2019": {
"main": [
[
{
"node": "Fields",
"type": "main",
"index": 0
}
]
]
},
"Search Holidays": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 0
}
]
]
},
"Search Competition": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 1
}
]
]
},
"Fields": {
"main": [
[
{
"node": "Search Holidays",
"type": "main",
"index": 0
},
{
"node": "Search Competition",
"type": "main",
"index": 0
},
{
"node": "Search Sports Events",
"type": "main",
"index": 0
},
{
"node": "Search Author Popularity",
"type": "main",
"index": 0
},
{
"node": "Search Comparable Books",
"type": "main",
"index": 0
}
]
]
},
"Search Sports Events": {
"main": [
[
{
"node": "Merge",
"type": "main",
"index": 2
}
]
]
},
"Azure OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Merge": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 1
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Basic LLM Chain",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Search Author Popularity": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 1
}
]
]
},
"Search Comparable Books": {
"main": [
[
{
"node": "Merge1",
"type": "main",
"index": 0
}
]
]
},
"Azure OpenAI Chat Model2": {
"ai_languageModel": [
[
{
"node": "Comparable Books Analysis",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Merge1": {
"main": [
[
{
"node": "Comparable Books Analysis",
"type": "main",
"index": 0
}
]
]
},
"Comparable Books Analysis": {
"main": [
[
{
"node": "Merge2",
"type": "main",
"index": 0
}
]
]
},
"Structured Output Parser1": {
"ai_outputParser": [
[
{
"node": "Comparable Books Analysis",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Send a message": {
"main": [
[]
]
},
"Merge2": {
"main": [
[
{
"node": "Send a message",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"executionOrder": "v1",
"binaryMode": "separate"
},
"versionId": "dfa4adf9-b845-480c-ab14-4716d55995b2",
"meta": {
"templateCredsSetupCompleted": true
},
"id": "TKr8m05ADHQVIoiU",
"tags": []
}
Credentials you'll need
Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.
azureOpenAiApigmailOAuth2
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
ayush3.1. Uses httpRequest, gmail, chainLlm, lmChatAzureOpenAi. Event-driven trigger; 17 nodes.
Source: https://github.com/ayush-ai-consultant/book-release-timing-analyzer/blob/main/book-release-timing-analyzer.json — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Typeform IA - YT. Uses typeformTrigger, agent, lmChatOpenAi, toolWorkflow. Event-driven trigger; 75 nodes.
My workflow 53. Uses formTrigger, httpRequest, lmChatOpenAi, form. Event-driven trigger; 74 nodes.
Episode 23: UGC with nanobanana. Uses lmChatOpenAi, lmChatOllama, lmChatDeepSeek, lmChatOpenRouter. Event-driven trigger; 74 nodes.
My workflow 14. Uses lmChatOpenAi, outputParserStructured, rssFeedRead, httpRequest. Event-driven trigger; 63 nodes.
This workflow contains community nodes that are only compatible with the self-hosted version of n8n.