← All N8N workflows
AI & researchCodeDocument Default Data LoaderEmbeddings Open AiExecute WorkflowExecute Workflow Trigger

default data loader and recursive character text splitter and get survey results

Configured with Document Default Data Loader, Embeddings Open Ai, Execute Workflow, Execute Workflow Trigger, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
AI & modelsEmbeddings OpenAIEmbeddings Open AiFiles / mediaDefault Data LoaderDocument Default Data Lo…TransformConvert to QuestionAnswer PairsEdit FieldsTransformRecursive CharacterText SplitterText Splitter Recursive …Data storeGet Survey ResultsGoogle SheetsData storeGet Survey HeadersGoogle SheetsTransformExtract QuestionsEdit FieldsTransformQuestions to ListSplit OutWeb / APIFind All AnswersHTTP RequestWeb / APIGet Payload of PointsHTTP RequestTransformClusters To ListSplit OutTransformSet VariablesEdit FieldsAI & modelsOpenAI Chat ModelOpenAI Chat ModelTransformPrep Output For ExportEdit FieldsData storeExport To SheetsGoogle SheetsData storeExport To Sheets1Google SheetsRoutingFor Each Question...Loop Over ItemsSubworkflowTrigger InsightsExecute WorkflowTransformPrep Values For TriggerEdit FieldsTriggerExecute WorkflowTriggerExecute Workflow TriggerData storeCreate Insights SheetGoogle SheetsTransformPrep Values For ExportEdit FieldsTransformQA Pairs to ListSplit OutRoutingHas Clusters?IfTriggerWhen clicking ‘Testworkflow’Manual TriggerWeb / APIGet Sheet DetailsHTTP RequestRoutingOnly Clusters With 3+pointsFilterCodeApply K-meansClustering AlgorithmCodeData storeQdrant Vector StoreVector Store QdrantAI & modelsSurvey Insights AgentInformation Extractor

Node categories in this workflow

  • AI & models
  • Files / media
  • Transform
  • Data store
  • Web / API
  • Routing
  • Subworkflow
  • Trigger
  • Code

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
Embeddings OpenAIAI & modelsEmbeddings Open AiSee node parameters
Default Data LoaderFiles / mediaDocument Default Data LoaderSee node parameters
Convert to Question Answer PairsTransformEdit FieldsSee node parameters
Recursive Character Text SplitterTransformText Splitter Recursive Character Text SplitterSee node parameters
Get Survey ResultsData storeGoogle SheetsSee node parameters
Get Survey HeadersData storeGoogle SheetsSee node parameters
Extract QuestionsTransformEdit FieldsSee node parameters
Questions to ListTransformSplit OutSee node parameters
Find All AnswersWeb / APIHTTP RequestPOST
Get Payload of PointsWeb / APIHTTP RequestPOST
Clusters To ListTransformSplit OutSee node parameters
Set VariablesTransformEdit FieldsSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
Prep Output For ExportTransformEdit FieldsSee node parameters
Export To SheetsData storeGoogle Sheetsappend
Export To Sheets1Data storeGoogle Sheetsappend
For Each Question...RoutingLoop Over ItemsSee node parameters
Trigger InsightsSubworkflowExecute WorkflowSee node parameters
Prep Values For TriggerTransformEdit FieldsSee node parameters
Execute Workflow TriggerTriggerExecute Workflow TriggerSee node parameters
Create Insights SheetData storeGoogle Sheetscreate
Prep Values For ExportTransformEdit FieldsSee node parameters
QA Pairs to ListTransformSplit OutSee node parameters
Has Clusters?RoutingIfSee node parameters
When clicking ‘Test workflow’TriggerManual TriggerSee node parameters
Get Sheet DetailsWeb / APIHTTP RequestSee node parameters
Only Clusters With 3+ pointsRoutingFilterSee node parameters
Apply K-means Clustering AlgorithmCodeCodeSee node parameters
Qdrant Vector StoreData storeVector Store QdrantSee node parameters
Survey Insights AgentAI & modelsInformation ExtractorSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • googleSheetsOAuth2Api
  • openAiApi
  • qdrantApi

Workflow notes

Step 1. Import Survey Responses

Step 1. Import Survey Responses

Read more about Google Sheets

Our approach requires to import all participant responses as vectors with metadata linking them to the questions being answered. To do this, we'll generate questiona and answer pairs from the survey.

Step 2. Vectorize Each Response Into Qdrant

Step 2. Vectorize Each Response Into Qdrant

Read more about using Qdrant

Special attention is given to how metadata is captured as it becomes key to this workflow is being able to retrieve subsets of the data for analysis.

Step 3. Trigger Insights SubWorkflow

Step 3. Trigger Insights SubWorkflow

Learn more about Workflow Triggers

A subworkflow is used to trigger the analysis for the survey. This separation is optional but used here to better demonstrate the two part process.

Step 4. Create Insights Sheet

Step 4. Create Insights Sheet

Learn more about Workflow Triggers

To capture the generated insights, we'll create a new unique sheet within the survey spreadsheet. This is optional and you may want to capture in other datastores depending on your needs.

Step 5. Get List Of Questions From Survey

Step 5. Get List Of Questions From Survey

Read more about using Google Sheets

Next we'll fetch the survey for metadata and questions, splitting them into separate workflow items. Our intention is to process each question end-to-end before moving to the next. This approach is a little "safer" in the scenario where an interruption occurs we won't lose all our work.

Step 6. Find Groups of Similar Answers For Each Question

Step 6. Find Groups of Similar Answers For Each Question

Learn more about using the Code Node

Giving all the responses to an LLM to analyse is the common but naive approach; the summarisation is usually too high level for real insights and loses a lot of detail such as the number and identity of respondants. What we want to do instead is find and group popular answers for each question to ensure all perspectives are considered.

Our approach does this by mapping our answer vectors to a 2D grid and then identifying where the vector points are "clustered"; where a group of points are within close proximity to each other.

Step 7b. Skip If No Clusters Found

Step 7b. Skip If No Clusters Found

Where no clusters were found, it means the answers were unique enough to not show any pattern. eg. "What's you name?"

Step 7a. Summarise the Top Groups of Similar Answers

Step 7a. Summarise the Top Groups of Similar Answers

Read more about using the Information Extractor Node

Each discovered cluster will return a reference vector which is used to fetch all related answers in the group. The group is then sent to the LLM to summarise as well as assign a sentiment score.

Step 8. Write To Insights Sheet

Step 8. Write To Insights Sheet

Finally, our completed insights to appended to the Insights Sheet we created earlier in the workflow.

Run this once!

Run this once!

If for any reason you need to run more than once, be sure to clear the existing data first.

Try It Out!

Try It Out!

This workflow generates highly-detailed insights from survey responses. Works best when dealing with a large number of participants.

  • Import survey responses and vectorise in Qdrant vectorstore.
  • Identify clusters of popular responses to questions using K-means clustering algorithm.
  • Each valid cluster is analysed and summarised by LLM.
  • Export LLM response and cluster results back into sheet.

Check out the reference google sheet here: https://docs.google.com/spreadsheets/d/REPLACE_WITH_DOCUMENT_ID/2PACX-1vT6m8XH8JWJTUAfwojc68NAUGC7q0lO7iV738J7aO5fuVjiVzdTRRPkMmT1C4N8TwejaiT0XrmF1Q48/pubhtml

Need Help?

Join the Discord or ask in the Forum!

Happy Hacking!

First Time Running?

First Time Running?

There is a slight delay on first run because the code node has to download the required packages.

default data loader and recursive character text splitter and get survey results

default data loader and recursive character text splitter and get survey results

Purpose and structure

This folder contains the default data loader and recursive character text splitter and get survey results workflow. Its executable nodes use code, documentDefaultDataLoader, embeddingsOpenAi, executeWorkflow, executeWorkflowTrigger, filter, googleSheets, httpRequest, if, informationExtractor, lmChatOpenAi, manualTrigger, set, splitInBatches, splitOut, textSplitterRecursiveCharacterTextSplitter, vectorStoreQdrant. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

Execute Workflow Trigger, When clicking ‘Test workflow’

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Splitout/0554_Splitout_Code_Create_Webhook.json MIT; preserve source notices.

More in AI & research