Automation library · Documents and files

Document Q&A system with Voyage-Context-3 and MongoDB Atlas

Started by someone opening a chat with it, and works across MongoDB. It hands the judgement calls to OpenAI. 43 steps, 5 loops or waits: large, and worth reading before you trust it with anything live.

LargeCalls a model: OpenAI

43 stepsLarge: read it before trusting it with anything live
0Branches: places the flow splits
5Loops or waits
1Service it connects to

The flow

Starts it 3Model 7Logic 24Service 9

The steps in the order they run, from what starts it.

  1. 1When clicking ‘Execute workflow’Manual triggerStarts it
  2. 2Subworkflow TriggerExecute Workflow triggerStarts it
  3. 3OpenAI Chat ModelLm Chat Open AiModel
  4. 4When chat message receivedChat triggerStarts it
  5. 5Fetch Document By Page NumberMongo Db ToolService
  6. 6Set VariablesSetLogic
  7. 7Loop Over ItemsSplit In BatchesLogic
  8. 8Generate Clarifying QuestionsInformation ExtractorModel
  9. 9Get QuerySetLogic
  10. 10RAG AgentOpen AiModel
  11. 11Clear CollectionMongo DbService
  12. 12Page RefNo OpLogic
  13. 13Split QuestionsSplit OutLogic
  14. 14Respond to UserChatModel
  15. 15Import Research PaperHttp RequestService
  16. 16Chunk Page TextCodeLogic
  17. 17Combine Content & MetadataSetLogic
  18. 18Loop Over QuestionsSplit In BatchesLogic
  19. 19Extract from FileExtract From FileService
  20. 20Voyage-Context-3 EmbeddingsHttp RequestService
  21. 21Insert Document PageMongo DbService
  22. 22Aggregate AnswersAggregateLogic
  23. 23Query RefNo OpLogic
  24. 24Split PagesSplit OutLogic
  25. 25Split OutSplit OutLogic
  26. 26MergeMergeLogic
  27. 27Quick ConfirmationChatModel
  28. 28Wait for AnswerChatModel
  29. 29Add Page NumberSetLogic
  30. 30For Each GroupSplit In BatchesLogic
  31. 31DoneSetLogic
  32. 32Voyage-Context-3 Embeddings1Http RequestService
  33. 33Batch 10Split In BatchesLogic
  34. 34No Operation, do nothingNo OpLogic
  35. 35Split Out1Split OutLogic
  36. 36Perform Similarity SearchMongo DbService
  37. 37Call Embeddings SubworkflowExecute WorkflowLogic
  38. 38Combine Content & VectorsSetLogic
  39. 39AggregateAggregateLogic
  40. 40WaitWaitLogic
  41. 41Insert Documents VectorsMongo DbService
  42. 42Quick UpdateChatModel
  43. 43Aggregate1AggregateLogic

How it's built

Starts on
Someone opening a chat with it
Steps
43, 5 loops or waits
Size
Large: read it before trusting it with anything live
Connects to
MongoDB
Model
OpenAI

Questions

What does it need to run?

An n8n account, plus your own MongoDB account, and a key for OpenAI. You connect your own accounts after importing it; none are included.

What starts it?

It starts on someone opening a chat with it.

Does it use AI?

Yes. It calls OpenAI. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 43 steps it is large: read it before trusting it with anything live.

How do I import it?

Copy the workflow, open a new workflow in n8n and paste. The steps appear on the canvas, ready for your own accounts.

Before you run it

Nothing here has been tested by us. It is somebody's working automation, read and described from its own steps. Treat the connections it wants as a list of accounts it will touch, and read the 43 steps before you point it at anything that matters.