This workflow corresponds to n8n.io template #2879 — we link there as the canonical source.
This workflow follows the Agent → Airtable 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 →
{
"id": "9ugFSjIFwdf6F77r",
"meta": {
"templateCredsSetupCompleted": true
},
"name": "Book Agency Cobuild",
"tags": [],
"nodes": [
{
"id": "6deac409-8a03-429f-b532-4ea7760027cc",
"name": "Webhook",
"type": "n8n-nodes-base.webhook",
"position": [
40,
20
],
"parameters": {
"path": "ai-book",
"options": {}
},
"typeVersion": 2
},
{
"id": "313f9bb3-f7de-428f-86c6-c8b110ba530c",
"name": "Switch",
"type": "n8n-nodes-base.switch",
"position": [
220,
0
],
"parameters": {
"rules": {
"values": [
{
"outputKey": "Generate Book Details",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"operator": {
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.query.action }}",
"rightValue": "bookDetails"
}
]
},
"renameOutput": true
},
{
"outputKey": "Generate Chapters",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "1d48a951-0874-440d-895d-7396d0befff7",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.query.action }}",
"rightValue": "generateChapters"
}
]
},
"renameOutput": true
},
{
"outputKey": "Generate Chapter Research",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "94ebafe3-f075-46db-bc2e-330743e16dec",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.query.action }}",
"rightValue": "generateChapterResearch"
}
]
},
"renameOutput": true
},
{
"outputKey": "Generate Chapter Content",
"conditions": {
"options": {
"version": 2,
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "2b39ed3b-79f9-4e55-9297-cf8bdf6f3720",
"operator": {
"name": "filter.operator.equals",
"type": "string",
"operation": "equals"
},
"leftValue": "={{ $json.query.action }}",
"rightValue": "generateChapterContent"
}
]
},
"renameOutput": true
}
]
},
"options": {}
},
"typeVersion": 3.2
},
{
"id": "ade819b6-20f0-4625-86c8-49815aff21c2",
"name": "Airtable",
"type": "n8n-nodes-base.airtable",
"position": [
580,
-20
],
"parameters": {
"id": "={{ $json.query.recordId }}",
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblOHX9DHKFvEZ04O",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblOHX9DHKFvEZ04O",
"cachedResultName": "Book"
},
"options": {},
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "9fed967e-2645-4d11-9df4-2c9b87c39876",
"name": "AI Agent",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
720,
-20
],
"parameters": {
"text": "=This is the idea: {{ $json.Idea }}",
"options": {
"systemMessage": "=# Role\n\nYou are a Book Researcher Agent, a highly skilled expert in leveraging information retrieval tools to support book creation. Your primary goal is to conduct thorough research that empowers authors to craft compelling book descriptions, understand their target audience, and build a strong foundation for writing a bestseller.\n\n\n# Objective\n\nYour objective is to thoroughly research a **book concept** to generate a detailed research brief. This brief will provide the author with all the necessary information to write a captivating book description, clearly define the target audience, and gain insightful research to inform the book's content and increase its potential to become a bestseller. You have a limited number of uses for the Perplexity tool (maximum 5 times), so use it strategically to gather the most impactful information.\n\n[Also Make sure you know the difference between book description, target audience & general book research and explicitly give the structure of the research brief.]\n\n# Tools\n\nYou have access to the following tool:\n\n* **Perplexity:** Use this tool to conduct in-depth web research specifically tailored for book development. It allows you to run complex search queries, ask follow-up questions, and explore topics in detail. Use this to gain a deep understanding of your book's genre, target readers, comparable titles, and potential unique selling points. **Limit: 5 uses per research task.**\n * **Input:** Search query (string) - e.g., \"market research for fantasy novels\", \"compelling book descriptions for thrillers\", \"target audience for self-help books on productivity\".\n * **Output:** Comprehensive search results, summaries, and the ability to ask follow-up questions for further exploration.\n\n[Note: Use this tool multiple times, and write only after you've done really good use of tools multiple times to comeup with the data for conclusion.]\n\n# Instructions\n\nYou will be provided with a **book concept**. Follow these steps to conduct thorough research and create a comprehensive brief:\n\n1. **Book Concept Analysis:**\n * Review the provided **book concept**. Understand the genre, core themes, and intended message.\n * **Identify Key Areas for Research:** Determine the specific areas where research is needed: book description elements, target audience definition, and general background research for the book's content.\n\n2. **Research for Book Description (Perplexity - Max 2 uses):**\n * Utilize the **Perplexity** tool to research best practices for writing book descriptions in the given genre.\n * Ask specific questions like:\n * \"What are the key elements of a compelling book description for [Genre] novels?\"\n * \"Analyze successful book descriptions in the [Genre] genre. What common themes and techniques are used?\"\n * \"Examples of highly effective book descriptions for books similar to [Book Concept].\"\n * Analyze the results to identify effective description techniques, hooks, and keywords.\n\n3. **Target Audience Research (Perplexity - Max 2 uses):**\n * Use **Perplexity** to define the target audience for the book.\n * Ask questions like:\n * \"Who is the target audience for [Genre] books about [Core Theme of Book Concept]?\"\n * \"Demographics and interests of readers who enjoy [Comparable Book Titles or Authors].\"\n * \"What are the reading habits and preferences of readers in the [Genre] genre?\"\n * Gather information on demographics, interests, reading habits, and pain points of the potential target audience.\n\n4. **General Book Research (Perplexity - Max 1 use):**\n * Conduct broader research related to the book's concept using **Perplexity**.\n * Ask questions like:\n * \"Current trends and popular themes in [Genre] literature.\"\n * \"Expert opinions and reviews on books similar to [Book Concept].\"\n * \"Potential unique selling points for a book in the [Genre] genre about [Core Theme].\"\n * Gather insights to inform the book's content and identify opportunities to make it stand out.\n\n5. **Research Brief Generation:**\n * Compile all your findings into a well-formatted research brief. This brief should include:\n * **Book Concept:** Clearly state the Book Concept you researched.\n * **Book Description Insights:** Summarize your findings on effective book description techniques, including examples and key elements to incorporate.\n * **Target Audience Profile:** Provide a detailed profile of the target audience, including demographics, interests, reading habits, and motivations.\n * **General Book Research Summary:** Summarize key trends, expert opinions, and potential unique selling points identified through your research.\n * **Potential Bestseller Elements:** Based on your research, suggest elements that could contribute to the book's bestseller potential (e.g., specific themes, unique angles, marketing hooks).\n * **Perplexity Research Insights:** Include key information and insights gathered directly from your Perplexity queries, potentially with citations or summaries of sources.\n * **Next Steps for Author:** Suggest actionable next steps for the author based on the research, such as focusing on specific description elements or tailoring the book to the identified target audience preferences.\n\n**Key Principles:**\n\n* **Focus on Bestseller Potential:** Orient your research towards identifying elements that can contribute to the book's success in the market.\n* **Strategic Perplexity Usage:** Be mindful of the usage limit. Plan your queries to gather the most valuable information efficiently.\n* **Actionable Insights:** Your research brief should provide concrete and actionable guidance for the author to improve their book's description, target audience understanding, and overall market appeal.\n* **Targeted Research:** Focus your research on the three key areas: book description, target audience, and general book research.\n* **Use tools Multiple times** Don't make conclusion from a single call of each tool, use tools multiple times to come up with much better, thoughful & nuanced research.\n\nBy following these instructions and utilizing the Perplexity tool effectively and strategically within the given limits, you will be able to generate high-quality research briefs that empower authors to create compelling books with a strong potential to become bestsellers."
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "6955d7ab-12c8-4a67-bb77-3d3656f4ada5",
"name": "Google Gemini Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
680,
120
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash-exp"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "9dde0b0f-2f18-4c4e-a3c4-c6ec4183cdda",
"name": "Perplexity",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
940,
120
],
"parameters": {
"url": "https://api.perplexity.ai/chat/completions",
"method": "POST",
"jsonBody": "{\n \"model\": \"sonar\",\n \"messages\": [\n { \"role\": \"system\", \"content\": \"Only respond with information from verifiable and credible sources. Include source urls and event dates when possible\" },\n { \"role\": \"user\", \"content\": \"{query}\" }\n ]\n}\n",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "Use this tool gives you access to the Perplexity search to run web search queries. You can use this tool to run to research about anything.",
"placeholderDefinitions": {
"values": [
{
"name": "query",
"type": "string",
"description": "The query used for the search"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "4df196ae-2189-48c0-9218-8d75916f91ef",
"name": "Airtable1",
"type": "n8n-nodes-base.airtable",
"position": [
1000,
-20
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblOHX9DHKFvEZ04O",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblOHX9DHKFvEZ04O",
"cachedResultName": "Book"
},
"columns": {
"value": {
"id": "={{ $('Airtable').item.json.id }}",
"Action": "Idle",
"Research": "={{ $json.output }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "id",
"defaultMatch": true
},
{
"id": "Idea",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Idea",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Action",
"type": "options",
"display": true,
"options": [
{
"name": "Idle",
"value": "Idle"
},
{
"name": "Generate Book Details",
"value": "Generate Book Details"
},
{
"name": "Generate Chapters",
"value": "Generate Chapters"
}
],
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Action",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Description",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Audience",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Audience",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Research",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Research",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter",
"type": "array",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "be6dd8af-6a6c-4fe7-9013-9cce1a923ba0",
"name": "Airtable2",
"type": "n8n-nodes-base.airtable",
"position": [
580,
260
],
"parameters": {
"id": "={{ $('Webhook').item.json.query.recordId }}",
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblOHX9DHKFvEZ04O",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblOHX9DHKFvEZ04O",
"cachedResultName": "Book"
},
"options": {},
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "63ae5cb5-ea87-4c89-ad54-d96ee9f83115",
"name": "Basic LLM Chain",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
740,
260
],
"parameters": {
"text": "=Give chapters for this book idea: {{ $json.Idea }}\n-----\nResrearch on the topic:\n{{ $json.Research }}",
"messages": {
"messageValues": [
{
"message": "=You're an expert book writer, you will ideate a book based on chapters, and will give multiple chapters that people would love to read, every book you write will have a flow between the chapters to make them coherent.\n\nYou'll give 7-10 chapters for each book, and the chapters should be well thought and connected to the previous one, also the descirption should be expainatory in cature for the researcher to research about the chapter and write content on."
}
]
},
"promptType": "define",
"hasOutputParser": true
},
"typeVersion": 1.5
},
{
"id": "7343b415-2008-42e2-8bb5-c85b240d7bb9",
"name": "OpenAI Chat Model",
"type": "@n8n/n8n-nodes-langchain.lmChatOpenAi",
"position": [
680,
420
],
"parameters": {
"model": {
"__rl": true,
"mode": "list",
"value": "gpt-4o",
"cachedResultName": "gpt-4o"
},
"options": {}
},
"credentials": {
"openAiApi": {
"name": "<your credential>"
}
},
"typeVersion": 1.2
},
{
"id": "623edcb7-ab23-44fd-80e1-e3b03c1ff359",
"name": "Structured Output Parser",
"type": "@n8n/n8n-nodes-langchain.outputParserStructured",
"position": [
940,
420
],
"parameters": {
"schemaType": "manual",
"inputSchema": "{\n \"name\": \"chapters\",\n \"schema\": {\n \"type\": \"object\",\n \"properties\": {\n \"chapters\": {\n \"type\": \"array\",\n \"description\": \"A collection of chapters.\",\n \"items\": {\n \"type\": \"object\",\n \"properties\": {\n \"title\": {\n \"type\": \"string\",\n \"description\": \"The name of the chapter.\"\n },\n \"description\": {\n \"type\": \"string\",\n \"description\": \"A brief description of the chapter.\"\n }\n },\n \"required\": [\n \"title\",\n \"description\"\n ],\n \"additionalProperties\": false\n }\n }\n },\n \"required\": [\n \"chapters\"\n ],\n \"additionalProperties\": false\n },\n \"strict\": true\n}"
},
"typeVersion": 1.2
},
{
"id": "a5ed4ce2-42b0-4d73-98ea-be5363cecef7",
"name": "Edit Fields",
"type": "n8n-nodes-base.set",
"position": [
1020,
260
],
"parameters": {
"options": {},
"assignments": {
"assignments": [
{
"id": "8f4644ec-040c-4dd9-94e9-b8708fede172",
"name": "chapters",
"type": "array",
"value": "={{ $json.output.chapters }}"
},
{
"id": "0fe83fde-7e97-4dc4-8889-b1c8f017feac",
"name": "Book",
"type": "array",
"value": "=[\"{{ $('Webhook').item.json.query.recordId }}\"]"
}
]
}
},
"typeVersion": 3.4
},
{
"id": "f7ce2916-6f64-4216-9fae-91dc00caa281",
"name": "Split Out",
"type": "n8n-nodes-base.splitOut",
"position": [
1160,
260
],
"parameters": {
"options": {},
"fieldToSplitOut": "chapters"
},
"typeVersion": 1
},
{
"id": "ade70c34-ed85-4d1a-8153-58526532fb9c",
"name": "Airtable3",
"type": "n8n-nodes-base.airtable",
"position": [
1280,
260
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblCDohhEri0a2CQy",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblCDohhEri0a2CQy",
"cachedResultName": "Chapter"
},
"columns": {
"value": {
"Book": "={{ $('Edit Fields').item.json.Book }}",
"Description": "={{ $json.description }}",
"Chapter Name": "={{ $json.title }}"
},
"schema": [
{
"id": "Chapter Name",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Description",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Action",
"type": "options",
"display": true,
"options": [
{
"name": "Idle",
"value": "Idle"
},
{
"name": "Generate Research",
"value": "Generate Research"
},
{
"name": "Generate Chapter Content",
"value": "Generate Chapter Content"
}
],
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Action",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Research",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Research",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter Content",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Book",
"type": "array",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Book",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "create",
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "5f6449cb-964a-413d-90c2-132e8b162ef9",
"name": "Airtable4",
"type": "n8n-nodes-base.airtable",
"position": [
1420,
260
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblOHX9DHKFvEZ04O",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblOHX9DHKFvEZ04O",
"cachedResultName": "Book"
},
"columns": {
"value": {
"id": "={{ $('Webhook').item.json.query.recordId }}",
"Action": "Idle"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "id",
"defaultMatch": true
},
{
"id": "Idea",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Idea",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Action",
"type": "options",
"display": true,
"options": [
{
"name": "Idle",
"value": "Idle"
},
{
"name": "Generate Book Details",
"value": "Generate Book Details"
},
{
"name": "Generate Chapters",
"value": "Generate Chapters"
}
],
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Action",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Research",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Research",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter",
"type": "array",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"executeOnce": true,
"typeVersion": 2.1
},
{
"id": "970dc454-c696-4f1c-8ad0-f74d85f77461",
"name": "Airtable5",
"type": "n8n-nodes-base.airtable",
"position": [
580,
560
],
"parameters": {
"id": "={{ $('Webhook').item.json.query.recordId }}",
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblCDohhEri0a2CQy",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblCDohhEri0a2CQy",
"cachedResultName": "Chapter"
},
"options": {},
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "1c8c7b03-8aec-4142-a469-0db1e4227ed4",
"name": "AI Agent1",
"type": "@n8n/n8n-nodes-langchain.agent",
"position": [
780,
560
],
"parameters": {
"text": "=Chapter Name: {{ $json['Chapter Name'] }}\nChapter Description: {{ $json.Description }}\n\nName of the book: {{ $json.Idea[0] }}\n\n----\nUse Perplexity1 tool religiously.",
"options": {
"systemMessage": "=## **Role: Chapter Research Specialist** \n\nYou are a **Chapter Research Specialist**, responsible for conducting **in-depth, story-driven research** for a specific chapter of a book. Your goal is to provide **unique, compelling, and evidence-based insights** that enhance the depth, credibility, and engagement of the chapter. \n\n## **Objective:** \nYour research should **uncover powerful stories, historical events, psychological insights, real-world case studies, and expert perspectives** that strengthen the chapter\u2019s narrative. You will **strategically use the Perplexity tool** to find high-quality, reliable information. \n\n## **Research Process:** [Perplexity1] tool\n\n1. **Deep Dive into the Chapter Theme:** \n - Understand the core concept of the chapter. \n - Identify key arguments, theories, or perspectives that require **supporting evidence or real-world examples**. \n\n2. **Strategic Use of Perplexity1 tool (Mandatory - Multiple Uses [max 5 times]):** \n - Conduct **multiple searches** in Perplexity to extract **narrative-driven** insights. \n - Prioritize **stories, case studies, and unique historical references** that add richness to the chapter. \n - Look for **contrarian or lesser-known perspectives** to make the chapter stand out. \n - Search for **scientific or psychological explanations** that can validate claims or provide fresh insights. \n - Identify **market trends or audience engagement data** to see if similar topics have resonated before. \n\n3. **Extracting Expert Insights & Controversial Takes:** \n - Find opinions or research from **experts, thought leaders, or researchers** in the field. \n - Identify **counterarguments or controversies** that add intellectual depth to the chapter. \n\n4. **Synthesizing Findings into Actionable Insights:** \n - Organize the research into a structured format that helps shape the chapter effectively. \n - Highlight key **stories, data points, and unique takeaways** that make the content engaging and credible. \n\n## **Key Deliverables:** \n- **Well-researched narratives and case studies** that make the chapter engaging. \n- **Multiple Perplexity1 tool searches with thoughtful extraction** of relevant insights. \n- **Psychological, historical, or scientific references** that add credibility. \n- **Contrarian or thought-provoking perspectives** to make the chapter more impactful. \n\n**Your success is measured by how deeply researched, unique, and compelling the final insights are. Use Perplexity strategically to extract maximum value and deliver research that elevates the chapter\u2019s quality.**"
},
"promptType": "define"
},
"typeVersion": 1.7
},
{
"id": "3b0cfa5d-f4e4-48cf-86d5-b1355a6da8a8",
"name": "Google Gemini Chat Model1",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
760,
760
],
"parameters": {
"options": {},
"modelName": "models/gemini-2.0-flash-exp"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "88dd2023-2c37-4b71-901a-3e65b3813b44",
"name": "Perplexity1",
"type": "@n8n/n8n-nodes-langchain.toolHttpRequest",
"position": [
1020,
780
],
"parameters": {
"url": "https://api.perplexity.ai/chat/completions",
"method": "POST",
"jsonBody": "{\n \"model\": \"sonar\",\n \"messages\": [\n { \"role\": \"system\", \"content\": \"Only respond with information from verifiable and credible sources. Include source urls and event dates when possible\" },\n { \"role\": \"user\", \"content\": \"{query}\" }\n ]\n}\n",
"sendBody": true,
"specifyBody": "json",
"authentication": "genericCredentialType",
"genericAuthType": "httpHeaderAuth",
"toolDescription": "Use this tool gives you access to the Perplexity search to run web search queries. You can use this tool to run to research about anything.",
"placeholderDefinitions": {
"values": [
{
"name": "query",
"type": "string",
"description": "The query used for the search"
}
]
}
},
"credentials": {
"httpHeaderAuth": {
"name": "<your credential>"
}
},
"typeVersion": 1.1
},
{
"id": "db2f5f7e-fd3e-48e1-b1df-8ec6d780034e",
"name": "Airtable6",
"type": "n8n-nodes-base.airtable",
"position": [
1100,
560
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblCDohhEri0a2CQy",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblCDohhEri0a2CQy",
"cachedResultName": "Chapter"
},
"columns": {
"value": {
"id": "={{ $('Webhook').item.json.query.recordId }}",
"Action": "Idle",
"Research": "={{ $json.output }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "id",
"defaultMatch": true
},
{
"id": "Chapter Name",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Description",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Action",
"type": "options",
"display": true,
"options": [
{
"name": "Idle",
"value": "Idle"
},
{
"name": "Generate Research",
"value": "Generate Research"
},
{
"name": "Generate Chapter Content",
"value": "Generate Chapter Content"
}
],
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Action",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Research",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Research",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter Content",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Idea",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "Idea",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Book",
"type": "array",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Book",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "8aeb06ec-fa60-4c6e-8d7b-6fab5fd92580",
"name": "Airtable7",
"type": "n8n-nodes-base.airtable",
"position": [
560,
920
],
"parameters": {
"id": "={{ $('Webhook').item.json.query.recordId }}",
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblCDohhEri0a2CQy",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblCDohhEri0a2CQy",
"cachedResultName": "Chapter"
},
"options": {},
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
},
{
"id": "3f24870d-a4bc-42c5-9664-cdaa41646202",
"name": "Basic LLM Chain1",
"type": "@n8n/n8n-nodes-langchain.chainLlm",
"position": [
780,
920
],
"parameters": {
"text": "=Name of the book: {{ $json.Idea[0] }}\n\nThe research data you need for the book: {{ $json['Book Research'][0] }}\n\n=== CHAPTER ===\nName of the chapter: {{ $json['Chapter Name'] }}\n\nResearch about the chapter: {{ $json.Research }}\n\n======= PERFECT NOW WRITE THE CONTENT FOR THE CHAPTER ======",
"messages": {
"messageValues": [
{
"message": "=You're a world class book writer with half a century of experience weaving words that connects with people, you'll be given specific tasks to write chapters for books, you'll be given research and the idea, description of the chapter, and you'll have to comeup with the adecuate amount of content necesary to make the chapter gold, you'll filter through all the information and will write the chapter as it connects.\n\nWrite the content in markdown, it's should be a long chapter and you'll have to do your word magic to write the chapter in this book."
}
]
},
"promptType": "define"
},
"typeVersion": 1.5
},
{
"id": "b6a5d495-b1a1-4504-9daf-8939e0b09f7b",
"name": "Google Gemini Chat Model2",
"type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
"position": [
700,
1080
],
"parameters": {
"options": {},
"modelName": "models/gemini-exp-1206"
},
"credentials": {
"googlePalmApi": {
"name": "<your credential>"
}
},
"typeVersion": 1
},
{
"id": "32ed5a6e-1113-43a2-915c-d6da82313f31",
"name": "Airtable8",
"type": "n8n-nodes-base.airtable",
"position": [
1140,
920
],
"parameters": {
"base": {
"__rl": true,
"mode": "list",
"value": "appfkz4KUlKvOjtbp",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp",
"cachedResultName": "Book Agency [v1] Cobuild"
},
"table": {
"__rl": true,
"mode": "list",
"value": "tblCDohhEri0a2CQy",
"cachedResultUrl": "https://airtable.com/appfkz4KUlKvOjtbp/tblCDohhEri0a2CQy",
"cachedResultName": "Chapter"
},
"columns": {
"value": {
"id": "={{ $('Webhook').item.json.query.recordId }}",
"Action": "Idle",
"Chapter Content": "={{ $json.text }}"
},
"schema": [
{
"id": "id",
"type": "string",
"display": true,
"removed": false,
"readOnly": true,
"required": false,
"displayName": "id",
"defaultMatch": true
},
{
"id": "Chapter Name",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter Name",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Description",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Description",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Action",
"type": "options",
"display": true,
"options": [
{
"name": "Idle",
"value": "Idle"
},
{
"name": "Generate Research",
"value": "Generate Research"
},
{
"name": "Generate Chapter Content",
"value": "Generate Chapter Content"
}
],
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Action",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Research",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Research",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Chapter Content",
"type": "string",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Chapter Content",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Book",
"type": "array",
"display": true,
"removed": false,
"readOnly": false,
"required": false,
"displayName": "Book",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Idea",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "Idea",
"defaultMatch": false,
"canBeUsedToMatch": true
},
{
"id": "Book Research",
"type": "string",
"display": true,
"removed": true,
"readOnly": true,
"required": false,
"displayName": "Book Research",
"defaultMatch": false,
"canBeUsedToMatch": true
}
],
"mappingMode": "defineBelow",
"matchingColumns": [
"id"
],
"attemptToConvertTypes": false,
"convertFieldsToString": false
},
"options": {},
"operation": "update",
"authentication": "airtableOAuth2Api"
},
"credentials": {
"airtableOAuth2Api": {
"name": "<your credential>"
}
},
"typeVersion": 2.1
}
],
"active": true,
"settings": {
"executionOrder": "v1"
},
"versionId": "042e2a5b-d8d0-4f85-ace1-012a0a8c8152",
"connections": {
"Switch": {
"main": [
[
{
"node": "Airtable",
"type": "main",
"index": 0
}
],
[
{
"node": "Airtable2",
"type": "main",
"index": 0
}
],
[
{
"node": "Airtable5",
"type": "main",
"index": 0
}
],
[
{
"node": "Airtable7",
"type": "main",
"index": 0
}
]
]
},
"Webhook": {
"main": [
[
{
"node": "Switch",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Airtable1",
"type": "main",
"index": 0
}
]
]
},
"Airtable": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent1": {
"main": [
[
{
"node": "Airtable6",
"type": "main",
"index": 0
}
]
]
},
"Airtable2": {
"main": [
[
{
"node": "Basic LLM Chain",
"type": "main",
"index": 0
}
]
]
},
"Airtable3": {
"main": [
[
{
"node": "Airtable4",
"type": "main",
"index": 0
}
]
]
},
"Airtable5": {
"main": [
[
{
"node": "AI Agent1",
"type": "main",
"index": 0
}
]
]
},
"Airtable7": {
"main": [
[
{
"node": "Basic LLM Chain1",
"type": "main",
"index": 0
}
]
]
},
"Split Out": {
"main": [
[
{
"node": "Airtable3",
"type": "main",
"index": 0
}
]
]
},
"Perplexity": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Edit Fields": {
"main": [
[
{
"node": "Split Out",
"type": "main",
"index": 0
}
]
]
},
"Perplexity1": {
"ai_tool": [
[
{
"node": "AI Agent1",
"type": "ai_tool",
"index": 0
}
]
]
},
"Basic LLM Chain": {
"main": [
[
{
"node": "Edit Fields",
"type": "main",
"index": 0
}
]
]
},
"Basic LLM Chain1": {
"main": [
[
{
"node": "Airtable8",
"type": "main",
"index": 0
}
]
]
},
"OpenAI Chat Model": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Gemini Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Structured Output Parser": {
"ai_outputParser": [
[
{
"node": "Basic LLM Chain",
"type": "ai_outputParser",
"index": 0
}
]
]
},
"Google Gemini Chat Model1": {
"ai_languageModel": [
[
{
"node": "AI Agent1",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Google Gemini Chat Model2": {
"ai_languageModel": [
[
{
"node": "Basic LLM Chain1",
"type": "ai_languageModel",
"index": 0
}
]
]
}
}
}
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.
airtableOAuth2ApigooglePalmApihttpHeaderAuthopenAiApi
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
How it Works: Trigger: The workflow is triggered by a webhook, initiated by an Airtable automation. This automation sends the Book or Chapter record ID and the desired action (e.g., "Generate Book Details," "Generate Chapters," "Generate Chapter Research," "Generate Chapter…
Source: https://n8n.io/workflows/2879/ — 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.
Tech CRM. Uses httpRequest, airtable, splitOut, markdown. Webhook trigger; 27 nodes.
CLINICAINTEGRAL_secretary. Uses postgres, mcpClientTool, googleDriveTool, toolWorkflow. Webhook trigger; 89 nodes.
leads. Uses supabase, gmail, formTrigger, httpRequest. Webhook trigger; 62 nodes.
kisisel asistan. Uses toolWorkflow, toolHttpRequest, toolCalculator, toolThink. Scheduled trigger; 43 nodes.
Schedule Twilio. Uses twilioTrigger, lmChatOpenAi, airtable, twilio. Event-driven trigger; 36 nodes.