{
  "id": "UEMiYKbevdzCdGfN",
  "meta": {
    "templateCredsSetupCompleted": true
  },
  "name": "Planning Research",
  "tags": [],
  "nodes": [
    {
      "id": "a92f96d8-42fd-498e-bc7d-60d9bfb0e191",
      "name": "On form submission",
      "type": "n8n-nodes-base.formTrigger",
      "position": [
        496,
        704
      ],
      "parameters": {
        "options": {},
        "formTitle": "Provide Context for Writing a Research Plan",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "What type of organization do you work for?",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "What kind of product, service, or experience does your company provide?",
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "What do you want to learn about your users or the problem you are addressing?",
              "requiredField": true
            },
            {
              "fieldType": "email",
              "fieldLabel": "Which email address would you prefer to receive the email at?",
              "requiredField": true
            }
          ]
        }
      },
      "typeVersion": 2.3
    },
    {
      "id": "c73b6880-dc9c-4678-a2cf-b092a2b52eef",
      "name": "Gemini",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        672,
        848
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "68573d63-98b1-42f0-83d3-9bce7d364a11",
      "name": "AI Agent: Question Maker",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        672,
        704
      ],
      "parameters": {
        "text": "=You are a UX researcher assistant. Your role is to generate **10 research questions** based on the following information:\n\n* What type of organization do you work for?: `{{ $json['What type of organization do you work for?'] }}`\n* What kind of product, service, or experience does your company provide?: `{{ $json['What kind of product, service, or experience does your company provide?'] }}`\n* What do you want to learn about your users or the problem you are addressing?: `{{ $json['What do you want to learn about your users or the problem you are addressing?'] }}`\n\nReturn the questions in **JSON format** exactly as follows:\n\n```json\n{\n  \"Question 01\": \"<created question>\",\n  \"Question 02\": \"<created question>\",\n  \"Question 03\": \"<created question>\",\n  \"Question 04\": \"<created question>\",\n  \"Question 05\": \"<created question>\",\n  \"Question 06\": \"<created question>\",\n  \"Question 07\": \"<created question>\",\n  \"Question 08\": \"<created question>\",\n  \"Question 09\": \"<created question>\",\n  \"Question 10\": \"<created question>\"\n}\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "70af22d2-8bda-479c-a1d0-2b3f166a31b8",
      "name": "AI Agent: Question Editor",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        848,
        1104
      ],
      "parameters": {
        "text": "=You are a UX research assistant helping refine Planning Research Questions.\n\nHere is general information about the organization and research goal:\n\n* Type of organization: {{ $('On form submission').item.json['What type of organization do you work for?'] }}\n* Product/service/experience provided: {{ $('On form submission').item.json['What kind of product, service, or experience does your company provide?'] }}\n* Research objective: {{ $('On form submission').item.json['What do you want to learn about your users or the problem you are addressing?'] }}\n\nThe previous AI Agent generated several user research questions:\n{{ $('AI Agent: Question Maker').item.json.output }}\n\nThe designer reviewed these questions and gave feedback.  \nSome were **approved**, some were **rejected**, and some were marked as **\"Should be edited\"**.\nAlso the user give their feedback on how you can improve it.\n\nYour task:\n- For questions marked as **\"Should be edited\"**, rephrase or refine them based on the user's feedback. If there is no feedback from the user edit it to improve clarity, relevance, or tone.  \n- **Avoid reusing the format or style** of any questions that were rejected.\n- If a question was approved, keep it unchanged.\n\nHere are the questions and their respective review outcomes:\n\n\n{{ $json['Question 1'] }}\nStatus: {{ $json['status 1'] }}\nIf Question 01 needs editing, how should it be edited?: {{ $json['status 1'] }}\n---\n{{ $json['Question 2'] }}\nStatus: {{ $json['status 2'] }}\nIf Question 02 needs editing, how should it be edited?: {{ $json['status 2'] }}\n---\n{{ $json['Question 3'] }}\nStatus: {{ $json['status 3'] }}\nIf Question 03 needs editing, how should it be edited?: {{ $json['status 3'] }}\n---\n{{ $json['Question 4'] }}\nStatus: {{ $json['status 4'] }}\nIf Question 04 needs editing, how should it be edited?: {{ $json['status 4'] }}\n---\n{{ $json['Question 5'] }}\nStatus: {{ $json['status 5'] }}\nIf Question 05 needs editing, how should it be edited?: {{ $json['status 5'] }}\n---\n{{ $json['Question 6'] }}\nStatus: {{ $json['status 6'] }}\nIf Question 06 needs editing, how should it be edited?: {{ $json['status 6'] }}\n---\n{{ $json['Question 7'] }}\nStatus: {{ $json['status 7'] }}\nIf Question 07 needs editing, how should it be edited?: {{ $json['status 7'] }}\n---\n{{ $json['Question 8'] }}\nStatus: {{ $json['status 8'] }}\nIf Question 08 needs editing, how should it be edited?: {{ $json['status 8'] }}\n---\n{{ $json['Question 9'] }}\nStatus: {{ $json['status 9'] }}\nIf Question 09 needs editing, how should it be edited?: {{ $json['status 9'] }}\n---\n{{ $json['Question 10'] }}\nStatus: {{ $json['status 10'] }}\nIf Question 10 needs editing, how should it be edited?: {{ $json['status 10'] }}\n\nReturn your final output **only** in a list of questions (no markdown or extra text). Reset the numbering so it starts again from Question 01 in order. \n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "f0cdc45b-6a52-44c0-a9cd-cbeef08f8d58",
      "name": "Gemini Google",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        848,
        1248
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "88aececb-21da-4a47-a23c-1cc7eb1172d4",
      "name": "Separate Questions",
      "type": "n8n-nodes-base.code",
      "position": [
        976,
        704
      ],
      "parameters": {
        "jsCode": "// n8n Function Node code\n// Assumes input comes in the first item as `input[0].json.output`\n\n// Get the raw string containing JSON\nconst rawString = $json[\"output\"];\n\n// Remove the ```json wrapper if present\nconst jsonString = rawString.replace(/```json|```/g, '').trim();\n\n// Parse it into a JavaScript object\nconst data = JSON.parse(jsonString);\n\n// Return only the questions in the same structure\nreturn [\n  {\n    json: data\n  }\n];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "1bc75236-67a4-4d5f-934f-c868287be67d",
      "name": "Question Approval",
      "type": "n8n-nodes-base.gmail",
      "position": [
        496,
        1104
      ],
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json['Which email address would you prefer to receive the email at?'] }}",
        "message": "=Dear Designer,\n\nI hope this email finds you well.\n\nI am writing to share the proposed research questions for your project and kindly request your feedback. Please review each question and indicate whether you approve or disapprove of them.\n\nYour guidance is greatly appreciated, and your approval will help me move forward with the research design.\n\nThank you very much for your time and support.\n\nBest regards,\nYour UX Assistance",
        "options": {},
        "subject": "Request for Approval of Research Questions",
        "operation": "sendAndWait",
        "formFields": {
          "values": [
            {
              "fieldType": "radio",
              "fieldLabel": "=Question 01: {{ $json[\"Question 01\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 01 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 02\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 02 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 03\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 03 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 04\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 04 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 05\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 05 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 06\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 06 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 07\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 07 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 08\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 08 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 09\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 09 needs editing, how should it be edited?"
            },
            {
              "fieldType": "radio",
              "fieldLabel": "={{ $json[\"Question 10\"] }}",
              "fieldOptions": {
                "values": [
                  {
                    "option": "Approved"
                  },
                  {
                    "option": "Disapproved"
                  },
                  {
                    "option": "Should be edited"
                  }
                ]
              },
              "requiredField": true
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "If Question 10 needs editing, how should it be edited?"
            }
          ]
        },
        "responseType": "customForm"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "feac9d2d-23be-42d8-ad97-90757c98748f",
      "name": "Edit Approval",
      "type": "n8n-nodes-base.gmail",
      "position": [
        496,
        1504
      ],
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json['Which email address would you prefer to receive the email at?'] }}",
        "message": "=Dear Designer,\n\nI hope this email finds you well.\n\nI am writing to share the proposed research questions for your project and kindly request your feedback. Please review each question and indicate whether you approve or disapprove of them:\n{{ $('AI Agent: Question Editor').item.json.output }}\n\nYour guidance is greatly appreciated, and your approval will help me move forward with the research design.\n\nThank you very much for your time and support.\n\nBest regards,\nYour UX Assistance",
        "options": {},
        "subject": "Request for Approval of Research Questions",
        "operation": "sendAndWait",
        "formFields": {
          "values": [
            {
              "fieldLabel": "Which question have you not approved? Please write the number only."
            },
            {
              "fieldType": "textarea",
              "fieldLabel": "Why are they rejected?"
            }
          ]
        },
        "responseType": "customForm"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "5c37ff3e-1433-4bd4-a6d8-588e406e56ce",
      "name": "Google Gemini Chat Model",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        624,
        1632
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "e859a1db-874f-475f-8d06-957a544938fd",
      "name": "AI Agent: Second Editor",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        624,
        1504
      ],
      "parameters": {
        "text": "=You are a UX research assistant helping refine Planning Research Questions.\n\nHere is general information about the organization and research goal:\n\n* Type of organization: {{ $('On form submission').item.json['What type of organization do you work for?'] }}\n* Product/service/experience provided: {{ $('On form submission').item.json['What kind of product, service, or experience does your company provide?'] }}\n* Research objective: {{ $('On form submission').item.json['What do you want to learn about your users or the problem you are addressing?'] }}\n\nThe previous AI Agent generated several user research questions:\n{{ $('AI Agent: Question Editor').item.json.output }}\n\nThe designer reviewed these questions and gave feedback.  \nSome were **approved**, some were **rejected**, and the reason why it is rejected.\n\nWhich question have been rejected: \n{{ $json.data['Which question have you not approved? Please write the number only.'] }}\n\nYour task:\n- Rewrite the questions that the user not approved. Use the users' feedback if it is available:\n{{ $json.data['Why are they rejected?'] }}\n\nReturn your final output **only** in a list of questions (no markdown or extra text). Reset the numbering so it starts again from Question 01 in order. \n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "77e4a8bc-c953-461e-86e8-79d869a6ce72",
      "name": "Google Gemini Chat",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        912,
        1648
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "d07287cb-de97-453a-861b-a76d6c414883",
      "name": "AI Agent: Request Methods",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        912,
        1504
      ],
      "parameters": {
        "text": "=You are a **UX research assistant** helping identify suitable **research methods** for user research questions.\n\n**Context**\n\n* **Type of organization:** {{ $('On form submission').item.json['What type of organization do you work for?'] }}\n* **Product/service/experience provided:** {{ $('On form submission').item.json['What kind of product, service, or experience does your company provide?'] }}\n* **Research objective:** {{ $('On form submission').item.json['What do you want to learn about your users or the problem you are addressing?'] }}\n\n**Input**\n\nThe previous AI Agent generated the following user research questions:\n{{ $json.output }}\n\n**Your task**\n\nFor each research question:\n\n* Recommend the **most suitable UX research method(s)** (e.g., interviews, usability testing, diary study, survey, A/B testing, etc.).\n* Explain **why** that method is appropriate for the question and research goal.\n* Ensure your reasoning is clear, concise, and practical.\n\n**Output format**\n\nReturn your final answer **only** as a list, with each item containing:\n\n1. The **question**\n2. The **recommended method(s)**\n3. A brief **rationale** for why the method was chosen\n\nDo **not** include markdown formatting, bullet points, or extra text \u2014 only the numbered list in plain text.\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "9f14a352-e490-43d9-8b90-e0df4379bfcc",
      "name": "Sticky Note",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        592
      ],
      "parameters": {
        "height": 384,
        "content": "## Get Information about Organisation\n"
      },
      "typeVersion": 1
    },
    {
      "id": "a981eb5a-12a7-4783-8ff6-ae76d5e18be5",
      "name": "Sticky Note1",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        592
      ],
      "parameters": {
        "width": 496,
        "height": 384,
        "content": "## Using AI to Write a Research Plan\n"
      },
      "typeVersion": 1
    },
    {
      "id": "cb8bdd33-627c-4a57-a879-9ee50dc5f9e6",
      "name": "Sticky Note2",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        992
      ],
      "parameters": {
        "color": 2,
        "height": 384,
        "content": "## Questions are checked by the user\n"
      },
      "typeVersion": 1
    },
    {
      "id": "2985ebff-dc3d-42e7-9046-21835e8af4b3",
      "name": "Sticky Note3",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        656,
        992
      ],
      "parameters": {
        "color": 2,
        "width": 496,
        "height": 384,
        "content": "## Edit the questions based on the user's feedback and be rechecked by the user\n"
      },
      "typeVersion": 1
    },
    {
      "id": "e0188e7d-ec2f-4ee2-a940-9636ab92a729",
      "name": "Sticky Note4",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        400,
        1392
      ],
      "parameters": {
        "color": 3,
        "width": 480,
        "height": 384,
        "content": "## Questions are regenerated "
      },
      "typeVersion": 1
    },
    {
      "id": "85e322c2-7987-49cf-965e-59efdb1b733a",
      "name": "Sticky Note5",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        896,
        1392
      ],
      "parameters": {
        "color": 3,
        "width": 256,
        "height": 384,
        "content": "## Design methods are proposed for each question"
      },
      "typeVersion": 1
    },
    {
      "id": "9adff9a5-cbfd-4ecc-8a75-b0e75666c2c8",
      "name": "Combine Questions",
      "type": "n8n-nodes-base.code",
      "position": [
        704,
        1104
      ],
      "parameters": {
        "jsCode": "const inputData = items[0].json.data;\nlet combined = {};\nlet questionCount = 1;\n\nfor (let key in inputData) {\n    // Skip edit keys\n    if (key.startsWith(\"If Question\")) continue;\n\n    // Main question\n    const editKey = `If Question ${questionCount} needs editing, how should it be edited?`;\n\n    combined[`Question ${questionCount}`] = key;                   // question text\n    combined[`status ${questionCount}`] = inputData[key];          // status\n    combined[`edit ${questionCount}`] = inputData[editKey] || \"\";  // edit suggestion\n\n    questionCount++;\n}\n\nreturn [{ json: combined }];\n"
      },
      "typeVersion": 2
    },
    {
      "id": "5db3754b-8720-4fce-9aa3-93ed878b540d",
      "name": "AI Agent",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1472,
        1504
      ],
      "parameters": {
        "text": "=You are given a research plan generated by AI, which includes UX research methods and related details.\n\nYour task is to transform this raw content into a **visually appealing, well-structured HTML report** suitable for conversion into a Google Doc.\n\nRequirements:\n- Organize the report into clear, logical sections (e.g., <h1>Title</h1>, <h2>Introduction</h2>, <h2>Objectives</h2>, <h2>Research Questions</h2>, <h2>Methods</h2>, <h2>Expected Outcomes</h2>, <h2>Timeline</h2>, <h2>References</h2>).\n- Use clean, semantic HTML (<h1>, <h2>, <p>, <ul>, <ol>, <strong>, <em>).\n- Make the layout **visually appealing**: \n  - Add light visual hierarchy (consistent heading sizes and spacing).\n  - Use short paragraphs, bullet points, and bold for emphasis where helpful.\n  - Keep style elegant and minimal \u2014 suitable for academic or professional presentation.\n- Ensure it looks **polished, readable, and ready to paste into Google Docs**.\n- Do not include scripts or external CSS; use inline styling only if needed for visual clarity (e.g., font-weight, spacing, or color).\n\nInput content:\n{{ $('AI Agent: Request Methods').item.json.output }}\n",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "d4eacca7-a927-4b49-b7c1-5dd6eadb5b38",
      "name": "Gemini ChatAssis",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1472,
        1648
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "3ebf7abd-96a7-49ef-96b8-2859a7d4a2fd",
      "name": "Sticky Note6",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        1424
      ],
      "parameters": {
        "color": 4,
        "width": 528,
        "height": 352,
        "content": "## Prepare the Report"
      },
      "typeVersion": 1
    },
    {
      "id": "41a3d493-2ffa-4674-86da-603ec94b455b",
      "name": "Report Approval",
      "type": "n8n-nodes-base.gmail",
      "position": [
        2000,
        1504
      ],
      "parameters": {
        "sendTo": "={{ $('On form submission').item.json['Which email address would you prefer to receive the email at?'] }}",
        "message": "=Dear Designer,\n\nI hope this email finds you well.\n\nHere you can find the planning research question and the proposed method: \n{{ 'https://docs.google.com/document/d/' + $('Create a Report').item.json.id + '/view' }}\n\nPlease take a look and share your feedback.\n\nThank you very much for your time and support.\n\nBest regards,\nYour UX Assistant",
        "options": {},
        "subject": "Feedback on Research Question and Proposed Method",
        "operation": "sendAndWait",
        "formFields": {
          "values": [
            {
              "fieldType": "textarea",
              "fieldLabel": "In what ways should the report be changed?"
            }
          ]
        },
        "responseType": "customForm"
      },
      "credentials": {
        "gmailOAuth2": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2.1
    },
    {
      "id": "acd40e18-6b97-4def-ac96-5f62ac5717fe",
      "name": "Sticky Note7",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        1424
      ],
      "parameters": {
        "color": 4,
        "width": 432,
        "height": 352,
        "content": "## Get and Send the Report"
      },
      "typeVersion": 1
    },
    {
      "id": "c6cb50d3-32ed-411f-b12b-1bcdbd9b0322",
      "name": "Google GeminiChat",
      "type": "@n8n/n8n-nodes-langchain.lmChatGoogleGemini",
      "position": [
        1280,
        1280
      ],
      "parameters": {
        "options": {}
      },
      "credentials": {
        "googlePalmApi": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 1
    },
    {
      "id": "54ca1d28-b042-4630-be9f-689c6d479295",
      "name": "Sticky Note8",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1200,
        1072
      ],
      "parameters": {
        "color": 5,
        "width": 528,
        "height": 336,
        "content": "## Edit the Report"
      },
      "typeVersion": 1
    },
    {
      "id": "1a478b88-3d92-48c8-95d9-e67e10501e31",
      "name": "AI Agent: Report Editor",
      "type": "@n8n/n8n-nodes-langchain.agent",
      "position": [
        1280,
        1136
      ],
      "parameters": {
        "text": "=You are given a research plan generated by an AI, which includes UX research methods and related details.\n\nRead the report below:\n{{ $('AI Agent').item.json.output }}\n\nThen read the user\u2019s feedback:\n{{ $json.data[\"In what ways should the report be changed?\"] }}\n\nRevise the research plan according to the user\u2019s feedback. Keep the structure and clarity of the report while making the requested changes.",
        "options": {},
        "promptType": "define"
      },
      "typeVersion": 2.2
    },
    {
      "id": "4cb275cd-c95d-43f9-8d9d-61c0c2e36b96",
      "name": "HTTP Request: Report",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1824,
        1504
      ],
      "parameters": {
        "url": "https://script.google.com/macros/s/AKfycbycCRkQRMw2hQPRKvBq-8fPSTlrWsHt3rNd5qjuCytZavI66m1ovif4HEoW9TtuUaar/exec",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "docId",
              "value": "={{ $('Create a Report').item.json.id }}"
            },
            {
              "name": "mode",
              "value": "append"
            },
            {
              "name": "HTML",
              "value": "={{ $json.output }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f220a797-73af-4dbb-a696-66c218e9e65b",
      "name": "HTTP Request: Edited Report",
      "type": "n8n-nodes-base.httpRequest",
      "position": [
        1824,
        1136
      ],
      "parameters": {
        "url": "https://script.google.com/macros/s/AKfycbycCRkQRMw2hQPRKvBq-8fPSTlrWsHt3rNd5qjuCytZavI66m1ovif4HEoW9TtuUaar/exec",
        "method": "POST",
        "options": {},
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "docId",
              "value": "={{ $json.id }}"
            },
            {
              "name": "mode",
              "value": "append"
            },
            {
              "name": "HTML",
              "value": "={{ $('AI Agent: Report Editor').item.json.output }}"
            }
          ]
        }
      },
      "typeVersion": 4.2
    },
    {
      "id": "f71091c1-74b5-4b6f-8840-2978a0cf0163",
      "name": "Create a Report",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1280,
        1504
      ],
      "parameters": {
        "title": "=Research Plan {{ new Date().toLocaleString('en-GB', { hour12: false }).replace(/[/,: ]/g, '.').replace(',', '').slice(0, 16).replace(' ', '.') }}",
        "folderId": "default"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "1a235927-f553-4e5f-b027-1d10abb14fd4",
      "name": "Create the Final Report",
      "type": "n8n-nodes-base.googleDocs",
      "position": [
        1584,
        1136
      ],
      "parameters": {
        "title": "=Final Research Plan {{ new Date().toLocaleString('en-GB', { hour12: false }).replace(/[/,: ]/g, '.').replace(',', '').slice(0, 16).replace(' ', '.') }}",
        "folderId": "default"
      },
      "credentials": {
        "googleDocsOAuth2Api": {
          "name": "<your credential>"
        }
      },
      "typeVersion": 2
    },
    {
      "id": "83b8608e-1431-461d-b515-a296de5b02f6",
      "name": "Sticky Note9",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        1744,
        1072
      ],
      "parameters": {
        "color": 5,
        "width": 432,
        "height": 336,
        "content": "## Create the Final Report"
      },
      "typeVersion": 1
    },
    {
      "id": "e43ceaa3-8b69-4d04-b822-5280cda43c43",
      "name": "Sticky Note10",
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        112,
        592
      ],
      "parameters": {
        "color": 6,
        "height": 1184,
        "content": "## Planning Research Workflow\n\nThis automation streamlines the process of designing and refining a research plan using AI and human feedback. It integrates Google Gemini, Gmail, and HTTP requests to coordinate each stage\u2014from gathering information to delivering a finalized report.\n\nGet Information \u2013 Collects key details about the organization or project through a form submission.\n\nAI-Assisted Planning \u2013 Gemini generates an initial research plan and breaks it into structured questions.\n\nUser Review Loop \u2013 The questions are sent to the user via email for review, edits, or approval. Feedback triggers AI refinement.\n\nQuestion Regeneration & Method Design \u2013 If needed, the system regenerates improved questions and proposes appropriate design methods for each.\n\nReport Preparation \u2013 The approved content is compiled into a structured research report.\n\nFinal Editing & Delivery \u2013 Gemini edits the report, creates the final document, and sends it automatically for approval or sharing."
      },
      "typeVersion": 1
    }
  ],
  "active": false,
  "settings": {
    "executionOrder": "v1"
  },
  "versionId": "42a5e2bf-c3cc-4926-87a2-2d8351885fe3",
  "connections": {
    "Gemini": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Question Maker",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent": {
      "main": [
        [
          {
            "node": "HTTP Request: Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Edit Approval": {
      "main": [
        [
          {
            "node": "AI Agent: Second Editor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini Google": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Question Editor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Create a Report": {
      "main": [
        [
          {
            "node": "AI Agent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Report Approval": {
      "main": [
        [
          {
            "node": "AI Agent: Report Editor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Gemini ChatAssis": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Combine Questions": {
      "main": [
        [
          {
            "node": "AI Agent: Question Editor",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google GeminiChat": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Report Editor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Question Approval": {
      "main": [
        [
          {
            "node": "Combine Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Request Methods",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "On form submission": {
      "main": [
        [
          {
            "node": "AI Agent: Question Maker",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Separate Questions": {
      "main": [
        [
          {
            "node": "Question Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "HTTP Request: Report": {
      "main": [
        [
          {
            "node": "Report Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Report Editor": {
      "main": [
        [
          {
            "node": "Create the Final Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Second Editor": {
      "main": [
        [
          {
            "node": "AI Agent: Request Methods",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Create the Final Report": {
      "main": [
        [
          {
            "node": "HTTP Request: Edited Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Question Maker": {
      "main": [
        [
          {
            "node": "Separate Questions",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Google Gemini Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent: Second Editor",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Question Editor": {
      "main": [
        [
          {
            "node": "Edit Approval",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent: Request Methods": {
      "main": [
        [
          {
            "node": "Create a Report",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}