{ "nodes": [ { "id": "d73e5113-119f-4e62-9872-48e6a971d760", "name": "Stop Interview?", "type": "n8n-nodes-base.if", "position": [ 3380, 920 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "3cf788a6-94d0-4223-9caa-30b8e4df8e01", "operator": { "type": "boolean", "operation": "true", "singleValue": true }, "leftValue": "={{ $json.output.stop_interview }}", "rightValue": "" } ] } }, "typeVersion": 2.2 }, { "id": "cda3c487-97fa-4037-b9a0-0802f4a02727", "name": "Generate Row", "type": "n8n-nodes-base.set", "position": [ 3740, 1200 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "06146a75-b67a-42cf-aa6f-241f23c47b9a", "name": "timestamp", "type": "string", "value": "={{ $now.toISO() }}" }, { "id": "b0278c64-58a7-487d-b7ba-d102fb5d4a0c", "name": "type", "type": "string", "value": "next_question" }, { "id": "ba034ca1-408e-422f-b071-dab0ef12fb48", "name": "question", "type": "string", "value": "={{ $('Parse Response').item.json.output.question }}" }, { "id": "a2231f6e-f507-408e-b598-53888cf8d4b5", "name": "answer", "type": "string", "value": "={{ $('Get Answer').item.json.answer }}" } ] } }, "typeVersion": 3.4 }, { "id": "3486f9ae-6a19-4f1f-be46-15376053e71f", "name": "Generate Row1", "type": "n8n-nodes-base.set", "position": [ 3580, 760 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "06146a75-b67a-42cf-aa6f-241f23c47b9a", "name": "timestamp", "type": "string", "value": "={{ $now.toISO() }}" }, { "id": "b0278c64-58a7-487d-b7ba-d102fb5d4a0c", "name": "type", "type": "string", "value": "stop_interview" }, { "id": "ba034ca1-408e-422f-b071-dab0ef12fb48", "name": "question", "type": "string", "value": "=None" }, { "id": "a2231f6e-f507-408e-b598-53888cf8d4b5", "name": "answer", "type": "string", "value": "=None" } ] } }, "typeVersion": 3.4 }, { "id": "a0e5d40d-e956-4ded-891f-ce5d0f55935f", "name": "Clear For Next Interview", "type": "@n8n/n8n-nodes-langchain.memoryManager", "position": [ 3900, 760 ], "parameters": { "mode": "delete", "deleteMode": "all" }, "typeVersion": 1.1 }, { "id": "66a33fcb-a902-4159-a025-2dff426c1fce", "name": "Sticky Note", "type": "n8n-nodes-base.stickyNote", "position": [ 2580, 860 ], "parameters": { "width": 180, "height": 260, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨 Set Interview Topic Here!" }, "typeVersion": 1 }, { "id": "5cfb7114-a773-4c76-bb3b-7c004be5f799", "name": "Send Reply To Agent", "type": "n8n-nodes-base.set", "position": [ 4060, 1200 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "06a9c730-4756-4bc8-a394-6ff249cf7117", "name": "answer", "type": "string", "value": "={{ $('Get Answer').item.json.answer }}" } ] } }, "typeVersion": 3.4 }, { "id": "aa30c462-7dfa-40a7-8e63-bed29b30213c", "name": "Sticky Note1", "type": "n8n-nodes-base.stickyNote", "position": [ 1880, 1060 ], "parameters": { "color": 7, "width": 490, "height": 220, "content": "## 1. Setup Interview\n[Learn more about the form trigger node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.formtrigger)\n\nThe form trigger node will be our entry point into this workflow and to start, we'll just ask for the user's name to start the interview.\nOur session storage will be using Redis via Upstash.com (you can use regular redis btw!) - whichever way, this ensures a highly scalable system able to handle many users." }, "typeVersion": 1 }, { "id": "5353a7c8-d0e4-429a-ab68-c54d9b845a43", "name": "Start Interview", "type": "n8n-nodes-base.formTrigger", "position": [ 1880, 880 ], "webhookId": "8d849295-ed30-41ab-a17c-464227cec8fb", "parameters": { "options": { "path": "driving-lessons-survey", "ignoreBots": true, "buttonLabel": "Begin Interview!", "appendAttribution": true, "useWorkflowTimezone": true }, "formTitle": "=UK Practical Driving Test Satisfaction Interview", "formFields": { "values": [ { "fieldLabel": "What is your name?", "placeholder": "ie. Sam Smith", "requiredField": true } ] }, "responseMode": "lastNode", "formDescription": "=Thanks for taking part in our Interview. You will be presented with an unending series of questions to help us with your experiences in preparing for and taking the UK Practical Driving Test.\n\nThe interviewer is an AI agent and the questions are dynamically generated. When you're done with answer, simple say STOP to exit the interview. Sessions are deleted after 24 hours." }, "typeVersion": 2.2 }, { "id": "c88a829f-c4b4-4ad4-b121-32b15fae9980", "name": "Sticky Note2", "type": "n8n-nodes-base.stickyNote", "position": [ 2840, 600 ], "parameters": { "color": 7, "width": 614, "height": 280, "content": "## 2. AI Researcher for Endless Interview Questions\n[Learn more about the AI Agent node](https://docs.n8n.io/integrations/builtin/cluster-nodes/root-nodes/n8n-nodes-langchain.agent/)\n\nAn AI interviewer is an interesting take on a role traditionally understood as expensive and time-consuming - both in preparation and execution. What if this could be handed off to an AI/LLM, which could perform when it suits the interviewee and ask a never-ending list of open and follow-on questions for deeper insights?\n\nThis is what this AI researcher agent is designed to do! Upon activation, a loop is created where the agent generates the question and the user answers via the form node. This continues until the user asks to stop the interview." }, "typeVersion": 1 }, { "id": "10e5dbe0-0163-4c21-8811-9ce9a2a5063b", "name": "Sticky Note3", "type": "n8n-nodes-base.stickyNote", "position": [ 3580, 1380 ], "parameters": { "color": 7, "width": 580, "height": 202, "content": "## 3. Record Answers and Prep for Next Question\n[Learn more about the n8n Form node](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.form/)\n\nThe interview is no good if we can't record the answers somewhere for later analysis! Using n8n form node to capture the answer, we can simple push our new question and answer pair to our Redis session to build our transcript before continuing the loop with the agent." }, "typeVersion": 1 }, { "id": "0a0cc961-d364-40d2-9ece-cef7d17c4b45", "name": "Sticky Note4", "type": "n8n-nodes-base.stickyNote", "position": [ 3820, 460 ], "parameters": { "color": 7, "width": 528, "height": 253, "content": "## 4. Graciously End the Interview\n[Read more about the Chat Manager node](https://docs.n8n.io/integrations/builtin/cluster-nodes/sub-nodes/n8n-nodes-langchain.memorymanager/)\n\nOnce the AI/LLM detects the user wishes to end the interview (which is done by the user explicitly saying in the form), then the loop breaks and we conclude the interview session and displaying the confirmation screen.\n\nFor this demo, I've created a special confirmation screen which also displays the transcript. This is done by redirecting to a webhook URL. If you don't need this, feel free to change this to \"show completion screen\" instead.\n" }, "typeVersion": 1 }, { "id": "279d9a67-1d3b-4ffe-a152-33164ef9e2c8", "name": "Get Answer", "type": "n8n-nodes-base.form", "position": [ 3580, 1200 ], "webhookId": "d96bb88d-db84-4a68-8f02-bcff9cb8429e", "parameters": { "options": { "formTitle": "={{ $json.output.question }}", "buttonLabel": "Next Question", "formDescription": "Please answer the question or type \"stop interview\" to end the interview." }, "formFields": { "values": [ { "fieldType": "textarea", "fieldLabel": "answer", "requiredField": true } ] } }, "typeVersion": 1 }, { "id": "4e284505-afc3-4e3e-88c8-38021efbf3c1", "name": "Sticky Note5", "type": "n8n-nodes-base.stickyNote", "position": [ 1280, 500 ], "parameters": { "width": 522.6976744186048, "height": 787.6241860465118, "content": "## Try it out! \n\n### Conducting user interviews have been traditionally difficult due to preparation, timing and execution costs. What if we let an AI/LLM do it instead?\n\nThis template enables automated AI/LLM powered user interviews using n8n forms and an AI agent where the question and answers are recorded in a google sheet for later analysis. A powerful tool for any researcher.\n\n### Check out the full showcase post here: https://community.n8n.io/t/build-your-own-ai-interview-agents-with-n8n-forms/62312\n\n### How it works\n* A form trigger is used to start the interview and a new session is created in redis to capture the transcript.\n* An AI agent is then tasked to ask questions to the user regarding the topic of the interview. This is setup as a loop so the questions never stop unless the user wishes to end the interview.\n* Each answer is recorded in our session set up earlier between questions.\n* Finally, when the user requests to end the interview we break the loop and show the interview completion screen.\n\n### Why Redis?\nRedis is a fast key-value datastore which makes it ideal for sessions. This ensures the interview flow stays snappy between questions. For my live demo, I used Upstash.com which has a generous free tier.\n\n\n### Need Help?\nJoin the [Discord](https://discord.com/invite/XPKeKXeB7d) or ask in the [Forum](https://community.n8n.io/)!\n\nHappy Hacking!\n" }, "typeVersion": 1 }, { "id": "ff37e943-851f-4ea7-bcab-b33150881b72", "name": "Set Interview Topic", "type": "n8n-nodes-base.set", "position": [ 2620, 880 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "386f91e1-cc3e-4912-84e3-5ecdbf5412c8", "name": "answer", "type": "string", "value": "=Hello, my name is {{ $('Start Interview').first().json['What is your name?'] }}" }, { "id": "492d5ecc-4e76-4297-b8a7-9ca4f801c855", "name": "interview_topic", "type": "string", "value": "Your experience preparing for and taking the UK practical driving test" } ] } }, "typeVersion": 3.4 }, { "id": "446937bc-a599-4184-b52e-be0607d62d94", "name": "UUID", "type": "n8n-nodes-base.crypto", "position": [ 2020, 880 ], "parameters": { "action": "generate" }, "typeVersion": 1 }, { "id": "da94c22a-4b26-4898-bde8-b57b5bf01f15", "name": "Generate Row2", "type": "n8n-nodes-base.set", "position": [ 2300, 880 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "06146a75-b67a-42cf-aa6f-241f23c47b9a", "name": "timestamp", "type": "string", "value": "={{ $now.toISO() }}" }, { "id": "b0278c64-58a7-487d-b7ba-d102fb5d4a0c", "name": "type", "type": "string", "value": "start_interview" }, { "id": "ba034ca1-408e-422f-b071-dab0ef12fb48", "name": "question", "type": "string", "value": "=What is your name?" }, { "id": "a2231f6e-f507-408e-b598-53888cf8d4b5", "name": "answer", "type": "string", "value": "={{ $('Start Interview').first().json['What is your name?'] }}" } ] } }, "typeVersion": 3.4 }, { "id": "9aba23d7-04af-4478-b39b-417f0917597d", "name": "Create Session", "type": "n8n-nodes-base.redis", "position": [ 2160, 880 ], "parameters": { "key": "=session_{{ $('UUID').item.json.data }}", "ttl": "={{ 60 * 60 * 24 }}", "value": "={{ [] }}", "expire": true, "keyType": "list", "operation": "set" }, "credentials": { "redis": { "id": "AbPH1yYQ924bVUqm", "name": "Upstash (ai interviewer)" } }, "typeVersion": 1 }, { "id": "217c9866-a162-41c6-b123-189869a6cb58", "name": "Update Session", "type": "n8n-nodes-base.redis", "position": [ 2440, 880 ], "parameters": { "list": "=session_{{ $('UUID').first().json.data }}", "tail": true, "operation": "push", "messageData": "={{ $json.toJsonString() }}" }, "credentials": { "redis": { "id": "AbPH1yYQ924bVUqm", "name": "Upstash (ai interviewer)" } }, "typeVersion": 1 }, { "id": "95e8b7c4-4f27-49f3-b509-5238c0f7bd5d", "name": "Update Session1", "type": "n8n-nodes-base.redis", "position": [ 3900, 1200 ], "parameters": { "list": "=session_{{ $('UUID').first().json.data }}", "tail": true, "operation": "push", "messageData": "={{ $json.toJsonString() }}" }, "credentials": { "redis": { "id": "AbPH1yYQ924bVUqm", "name": "Upstash (ai interviewer)" } }, "typeVersion": 1 }, { "id": "afaa55dd-844e-4bf3-8a31-3a0953caaf69", "name": "Update Session2", "type": "n8n-nodes-base.redis", "position": [ 3740, 760 ], "parameters": { "list": "=session_{{ $('UUID').first().json.data }}", "tail": true, "operation": "push", "messageData": "={{ $json.toJsonString() }}" }, "credentials": { "redis": { "id": "AbPH1yYQ924bVUqm", "name": "Upstash (ai interviewer)" } }, "typeVersion": 1 }, { "id": "c381d598-1902-4789-ac15-65ac2124fbdd", "name": "Valid Session?", "type": "n8n-nodes-base.if", "position": [ 5080, 1240 ], "parameters": { "options": {}, "conditions": { "options": { "version": 2, "leftValue": "", "caseSensitive": true, "typeValidation": "strict" }, "combinator": "and", "conditions": [ { "id": "500d6ca9-2a04-40f0-98e8-aa4290e6a30d", "operator": { "type": "array", "operation": "exists", "singleValue": true }, "leftValue": "={{ $json.data }}", "rightValue": "" } ] } }, "typeVersion": 2.2 }, { "id": "f26ccdaa-4f94-4acb-894b-341648aee8b0", "name": "Respond to Webhook", "type": "n8n-nodes-base.respondToWebhook", "position": [ 5440, 1240 ], "parameters": { "options": { "responseCode": 200, "responseHeaders": { "entries": [ { "name": "Content-Type", "value": "text/html" } ] } }, "respondWith": "text", "responseBody": "={{ $json.html }}" }, "typeVersion": 1.1 }, { "id": "09a05dc6-4a21-4df0-a83d-5e1b986090f8", "name": "Window Buffer Memory2", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 3000, 1120 ], "parameters": { "sessionKey": "={{ $('UUID').first().json.data }}", "sessionIdType": "customKey" }, "typeVersion": 1.2 }, { "id": "26f87c7d-9e2c-41e8-b7eb-3c249a69f905", "name": "Window Buffer Memory", "type": "@n8n/n8n-nodes-langchain.memoryBufferWindow", "position": [ 3900, 920 ], "parameters": { "sessionKey": "={{ $('UUID').first().json.data }}", "sessionIdType": "customKey" }, "typeVersion": 1.2 }, { "id": "ab891c71-af03-49c9-b281-d0058374260b", "name": "Sticky Note6", "type": "n8n-nodes-base.stickyNote", "position": [ 4180, 740 ], "parameters": { "width": 276.4353488372094, "height": 320.31553488372094, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨 Set Your Webhook URL here!\nFor this demo, we want to show a customised completion screen with transcript so it's necessary to redirect to a webhook (see step 6)." }, "typeVersion": 1 }, { "id": "7a063851-1bea-4e34-897c-4038d08b845e", "name": "Redirect to Completion Screen", "type": "n8n-nodes-base.form", "position": [ 4260, 760 ], "webhookId": "9fdedf1b-e413-4fc3-94a4-9cc24bffff8a", "parameters": { "operation": "completion", "redirectUrl": "=https:///webhook//ai-interview-transcripts/{{ $('UUID').first().json.data }}", "respondWith": "redirect" }, "typeVersion": 1 }, { "id": "b67b3fa5-faf6-402b-9b9e-c783869770ca", "name": "Sticky Note7", "type": "n8n-nodes-base.stickyNote", "position": [ 4640, 1220 ], "parameters": { "color": 5, "width": 236.3564651162793, "height": 345.82027906976737, "content": "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n### 🚨 This is the webhook we want to redirect to!\nIf you're on n8n cloud, you may want to copy the webhook url generated here and use it as the form ending's redirect url." }, "typeVersion": 1 }, { "id": "583d1572-2d6f-4ca4-9e31-33dc1481e87a", "name": "Sticky Note8", "type": "n8n-nodes-base.stickyNote", "position": [ 4580, 980 ], "parameters": { "color": 7, "width": 588, "height": 207, "content": "## 6. Display the Transcript\n[Read more about the Webhook Trigger](https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook)\n\nThis step is totally optional. For a nicer user experience, I use this webhook mini-flow to display the user's transcript for the completion screen. It works by capturing the session_id in the webhook's url and searching for it in our redis database. If a match is found the transcript is fetched and rendered into a webpage using the HTML node and returned to the user. If no match is found, a 404 message is displayed instead." }, "typeVersion": 1 }, { "id": "5fcf86b9-3fa3-48f5-a4a4-a1e261a48b49", "name": "Webhook", "type": "n8n-nodes-base.webhook", "position": [ 4700, 1240 ], "webhookId": "78df12c4-ccd0-46dd-be0d-4445c2bd04f2", "parameters": { "path": "ai-interview-transcripts/:session_id", "options": { "ignoreBots": true }, "responseMode": "responseNode" }, "typeVersion": 2 }, { "id": "6df57307-feef-4be5-861d-fdc0b92d1ef6", "name": "404 Not Found", "type": "n8n-nodes-base.html", "position": [ 5260, 1320 ], "parameters": { "html": "\n\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\tDriving Practice Test 2024 Survey\n\n\t\t\n\t\n\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

404 Not Found

\n\t\t\t\t\t\t

The requested session does not exist.

\n

Your session may have expired.

\n
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t
\n\t\t
\n\t\n\n" }, "typeVersion": 1.2 }, { "id": "0e968154-ead5-4194-834e-0d1175e7c1d9", "name": "AI Researcher", "type": "@n8n/n8n-nodes-langchain.agent", "position": [ 2900, 920 ], "parameters": { "text": "={{ $json.answer }}", "options": { "systemMessage": "=You are a user research expert interviewing a user on the topic of \"{{ $('Set Interview Topic').first().json.interview_topic }}\".\n\n* Your task is to ask open-ended questions relevant to the interview topic.\n* Ask only one question at a time. Analyse the previous question and ask new question each time. If there is an opportunity to dig deeper into a previous answer, do so but limit to 1 follow-on question.\n* Keep asking questions until the user requests to stop the interview. When the user requests to stop the interview and no question is required, \"question\" is an empty string.\n* Use a friendly and polite tone when asking questions.\n* If the user answers are inrelevant to the question, ask the question again or move on to another question.\n* If the user's answer is beyond the scope of the interview, ignore the answer and ask if the user would like to stop the interview.\n*You must format your response using the following json schema as we require pre processing before responding to the user.\n```\n{\n \"type\":\"object\",\n \"properties\": {\n \"stop_interview\": { \"type\": \"boolean\" },\n \"question\": { \"type\": [\"string\", \"null\"] }\n }\n}\n```\n* Output only the json object and do not prefix or suffix the message with extraneous text." }, "promptType": "define", "hasOutputParser": true }, "typeVersion": 1.7 }, { "id": "969d4094-1046-4f53-bf8b-5ae7e50bd3ed", "name": "Parse Response", "type": "n8n-nodes-base.set", "position": [ 3220, 920 ], "parameters": { "options": {}, "assignments": { "assignments": [ { "id": "bf61134c-e24c-453e-97ef-5edd25726148", "name": "output", "type": "object", "value": "={{\n$json.output\n .replace('```json', '')\n .replace('```', '')\n .parseJson()\n}}" } ] } }, "typeVersion": 3.4 }, { "id": "323b73c4-8c77-48a9-a549-f3e863ba72c2", "name": "Groq Chat Model", "type": "@n8n/n8n-nodes-langchain.lmChatGroq", "position": [ 2860, 1120 ], "parameters": { "model": "llama-3.2-90b-text-preview", "options": {} }, "credentials": { "groqApi": { "id": "YQVoV5K9FREww7t1", "name": "Groq account" } }, "typeVersion": 1 }, { "id": "bf4518c4-8e59-450e-be5a-92f31cf38528", "name": "Show Transcript", "type": "n8n-nodes-base.html", "position": [ 5260, 1140 ], "parameters": { "html": "\n\n\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\tAI Interviewer Transcripts\n\n\t\t\n\t\n\n\t\n\t\t
\n\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Thanks for Completing the Interview!

\n\t\t\t\t\t\t

If you liked this demo,
please follow me on http://linkedin.com/in/jimleuk and\n https://x.com/jimle_uk\n

\n

\n \n Support my work! Sign up to n8n using this link 🙏\n \n

\n
\n\t\t\t\t
\n
\n\t\t\t\t\t
\n\t\t\t\t\t\t

Transcript

\n

This session is deleted within 24 hours.

\n {{\n $json.data\n .map(item => JSON.parse(item))\n .filter(item => item.type === 'next_question')\n .map(item => `\n
\n
\n ${DateTime.fromISO(item.timestamp).format('dd MMM, hh:mm')}\n
\n
\n
${item.question}
\n
${item.answer}
\n
\n
\n `)\n .join('\\n')\n }}\n \t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t
\n\t\t
\n\t\n\n" }, "typeVersion": 1.2 }, { "id": "dff24e45-8e57-4dfc-8b65-9d315b406bd2", "name": "Save to Google Sheet", "type": "n8n-nodes-base.googleSheets", "position": [ 5040, 760 ], "parameters": { "columns": { "value": { "name": "{{ $('Start Interview').first().json['What is your name?'] }}", "session_id": "={{ $('UUID').first().json.data }}" }, "schema": [ { "id": "session_id", "type": "string", "display": true, "required": false, "displayName": "session_id", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "timestamp", "type": "string", "display": true, "required": false, "displayName": "timestamp", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "name", "type": "string", "display": true, "required": false, "displayName": "name", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "type", "type": "string", "display": true, "required": false, "displayName": "type", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "question", "type": "string", "display": true, "required": false, "displayName": "question", "defaultMatch": false, "canBeUsedToMatch": true }, { "id": "answer", "type": "string", "display": true, "required": false, "displayName": "answer", "defaultMatch": false, "canBeUsedToMatch": true } ], "mappingMode": "autoMapInputData", "matchingColumns": [] }, "options": { "useAppend": true }, "operation": "append", "sheetName": { "__rl": true, "mode": "list", "value": 1695693704, "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1wKjVdm7HeufJkHrUJn_bW9bFI_blm0laoI_jgXKDe0Q/edit#gid=1695693704", "cachedResultName": "transcripts" }, "documentId": { "__rl": true, "mode": "list", "value": "1wKjVdm7HeufJkHrUJn_bW9bFI_blm0laoI_jgXKDe0Q", "cachedResultUrl": "https://docs.google.com/spreadsheets/d/1wKjVdm7HeufJkHrUJn_bW9bFI_blm0laoI_jgXKDe0Q/edit?usp=drivesdk", "cachedResultName": "AI Researcher with n8n Forms" } }, "credentials": { "googleSheetsOAuth2Api": { "id": "FsFwFchwmgtBu5l7", "name": "Google Sheets account" } }, "typeVersion": 4.5 }, { "id": "8eb03a1c-02e4-4d49-bf68-bb148585828f", "name": "Session to List", "type": "n8n-nodes-base.splitOut", "position": [ 4700, 760 ], "parameters": { "options": {}, "fieldToSplitOut": "session" }, "typeVersion": 1 }, { "id": "c594aa2b-a29d-42e4-8799-1c557d78932d", "name": "Messages To JSON", "type": "n8n-nodes-base.set", "position": [ 4860, 760 ], "parameters": { "mode": "raw", "options": {}, "jsonOutput": "={{\n{\n ...$json.session.parseJson(),\n session_id: `session_${$('UUID').first().json.data}`,\n name: $('Start Interview').first().json['What is your name?'],\n}\n}}" }, "typeVersion": 3.4 }, { "id": "106bd688-6ccc-4a6a-9b52-ee7187d9aebe", "name": "Sticky Note9", "type": "n8n-nodes-base.stickyNote", "position": [ 4540, 420 ], "parameters": { "color": 7, "width": 508, "height": 293, "content": "## 5. Save the Interview to Sheets\n[Read more about the Google Sheets node](https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.googlesheets/)\n\nFor easier data-sharing, we can have the workflow upload the session messages into data analysis tools for our team members.\n\nFor this demo, Google Sheets is an easy option. We'll pull the entire session out of redis and upload the messages one by one to sheets.\n\n### Check out the example sheet here: https://docs.google.com/spreadsheets/d/1wKjVdm7HeufJkHrUJn_bW9bFI_blm0laoI_jgXKDe0Q/edit?usp=sharing" }, "typeVersion": 1 }, { "id": "b7754724-7473-4245-8b54-85c370a2b1be", "name": "Query By Session", "type": "n8n-nodes-base.redis", "position": [ 4920, 1240 ], "parameters": { "key": "=session_{{ $('Webhook').first().json.params.session_id }}", "options": {}, "operation": "get", "propertyName": "data" }, "credentials": { "redis": { "id": "AbPH1yYQ924bVUqm", "name": "Upstash (ai interviewer)" } }, "typeVersion": 1 }, { "id": "4b6a0db6-1d33-4ed3-a955-7562e0dba1f0", "name": "Get Session", "type": "n8n-nodes-base.redis", "position": [ 4540, 760 ], "parameters": { "key": "=session_{{ $('UUID').first().json.data }}", "keyType": "list", "options": {}, "operation": "get", "propertyName": "session" }, "credentials": { "redis": { "id": "AbPH1yYQ924bVUqm", "name": "Upstash (ai interviewer)" } }, "executeOnce": true, "typeVersion": 1 } ], "pinData": {}, "connections": { "UUID": { "main": [ [ { "node": "Create Session", "type": "main", "index": 0 } ] ] }, "Webhook": { "main": [ [ { "node": "Query By Session", "type": "main", "index": 0 } ] ] }, "Get Answer": { "main": [ [ { "node": "Generate Row", "type": "main", "index": 0 } ] ] }, "Get Session": { "main": [ [ { "node": "Session to List", "type": "main", "index": 0 } ] ] }, "Generate Row": { "main": [ [ { "node": "Update Session1", "type": "main", "index": 0 } ] ] }, "404 Not Found": { "main": [ [ { "node": "Respond to Webhook", "type": "main", "index": 0 } ] ] }, "AI Researcher": { "main": [ [ { "node": "Parse Response", "type": "main", "index": 0 } ] ] }, "Generate Row1": { "main": [ [ { "node": "Update Session2", "type": "main", "index": 0 } ] ] }, "Generate Row2": { "main": [ [ { "node": "Update Session", "type": "main", "index": 0 } ] ] }, "Create Session": { "main": [ [ { "node": "Generate Row2", "type": "main", "index": 0 } ] ] }, "Parse Response": { "main": [ [ { "node": "Stop Interview?", "type": "main", "index": 0 } ] ] }, "Update Session": { "main": [ [ { "node": "Set Interview Topic", "type": "main", "index": 0 } ] ] }, "Valid Session?": { "main": [ [ { "node": "Show Transcript", "type": "main", "index": 0 } ], [ { "node": "404 Not Found", "type": "main", "index": 0 } ] ] }, "Groq Chat Model": { "ai_languageModel": [ [ { "node": "AI Researcher", "type": "ai_languageModel", "index": 0 } ] ] }, "Session to List": { "main": [ [ { "node": "Messages To JSON", "type": "main", "index": 0 } ] ] }, "Show Transcript": { "main": [ [ { "node": "Respond to Webhook", "type": "main", "index": 0 } ] ] }, "Start Interview": { "main": [ [ { "node": "UUID", "type": "main", "index": 0 } ] ] }, "Stop Interview?": { "main": [ [ { "node": "Generate Row1", "type": "main", "index": 0 } ], [ { "node": "Get Answer", "type": "main", "index": 0 } ] ] }, "Update Session1": { "main": [ [ { "node": "Send Reply To Agent", "type": "main", "index": 0 } ] ] }, "Update Session2": { "main": [ [ { "node": "Clear For Next Interview", "type": "main", "index": 0 } ] ] }, "Messages To JSON": { "main": [ [ { "node": "Save to Google Sheet", "type": "main", "index": 0 } ] ] }, "Query By Session": { "main": [ [ { "node": "Valid Session?", "type": "main", "index": 0 } ] ] }, "Send Reply To Agent": { "main": [ [ { "node": "AI Researcher", "type": "main", "index": 0 } ] ] }, "Set Interview Topic": { "main": [ [ { "node": "AI Researcher", "type": "main", "index": 0 } ] ] }, "Window Buffer Memory": { "ai_memory": [ [ { "node": "Clear For Next Interview", "type": "ai_memory", "index": 0 } ] ] }, "Window Buffer Memory2": { "ai_memory": [ [ { "node": "AI Researcher", "type": "ai_memory", "index": 0 } ] ] }, "Clear For Next Interview": { "main": [ [ { "node": "Redirect to Completion Screen", "type": "main", "index": 0 } ] ] }, "Redirect to Completion Screen": { "main": [ [ { "node": "Get Session", "type": "main", "index": 0 } ] ] } } }