# Auto workflow positioning with OpenAI and in-memory vectors: n8n workflow

> Started by another system calling it, and works across in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you...

Source: https://millionrounds.com/workflow/auto-workflow-positioning-with-openai-and-in-memory-vectors (Millionrounds; every figure on the page links to its filing or article)

[Automation library](https://millionrounds.com/workflows) · [AI assistants](https://millionrounds.com/workflows?category=AI+assistants#library)

# Auto workflow positioning with OpenAI and in-memory vectors

Started by another system calling it, and works across in-memory vectors. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 31 steps, 2 branches, 1 loop or waits: large, and worth reading before you trust it with anything live.

Large Calls a model: OpenAI Retrieval

[Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fauto-workflow-positioning-with-openai-and-in-memory-vectors)

**31 steps** Large: read it before trusting it with anything live

**2** Branches: places the flow splits

**1** Loop or waits

**1** Service it connects to

## The flow

Starts it 4 Model 10 Logic 13 Service 4

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

- 1 **When clicking ‘Test workflow’** Manual trigger *Starts it*
- 2 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 3 **Window Buffer Memory** Memory Buffer Window *Model*
- 4 **Embeddings OpenAI** Embeddings Open Ai *Model*
- 5 **Dummy Tool** Tool Http Request *Model*
- 6 **Dummy Tool (1)** Tool Http Request *Model*
- 7 **OpenAI Chat Model (1)** Lm Chat Open Ai *Model*
- 8 **POST /workflow/magic/position/id** Webhook *Starts it*
- 9 **Schedule Trigger** Schedule trigger *Starts it*
- 10 **Magic Positioning** Http Request *Service*
- 11 **IF** If *Logic*
- 12 **AI Agent** Agent *Model*
- 13 **In-Memory Vector Store** Vector Store In Memory *Model*
- 14 **Question and Answer Chain** Chain Retrieval Qa *Model*
- 15 **Get n8n Workflow** N8n *Service*
- 16 **Dummy Node** No Op *Logic*
- 17 **Vector Store Retriever** Retriever Vector Store *Model*
- 18 **Magic Positioning IA2S** Http Request *Service*
- 19 **Dummy Node (1)** No Op *Logic*
- 20 **Dummy Node (3)** No Op *Logic*
- 21 **Update n8n Workflow** N8n *Service*
- 22 **Loop Over Items** Split In Batches *Logic*
- 23 **Dummy Node (4)** No Op *Logic*
- 24 **Simple Webhook Response** Respond To Webhook *Starts it*
- 25 **Dummy Node (2)** No Op *Logic*
- 26 **Dummy Node (5)** No Op *Logic*
- 27 **Switch** Switch *Logic*
- 28 **Dummy Node (6)** No Op *Logic*
- 29 **Dummy Node (7)** No Op *Logic*
- 30 **Dummy Node (8)** No Op *Logic*
- 31 **Dummy Node (9)** No Op *Logic*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 31, with 2 branches, 1 loop or waits
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** in-memory vectors
- **Model:** OpenAI
- **Retrieval:** Answers are drawn from documents you supply, not from the model alone

## Questions

What does it need to run?

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

What starts it?

It starts on another system calling it.

Does it use AI?

Yes. It calls OpenAI. Its answers draw on documents you give it, not on the model alone. Model calls are billed by the provider, not by n8n.

How long does it take to set up?

Take your time. At 31 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 31 steps before you point it at anything that matters.

## Run it in n8n

- **Create your n8n account** Free to start. n8n is where the workflow runs. [Create an n8n account ↗](https://millionrounds.com/n8n)
- **Download the workflow** Free with a Millionrounds account. [Download free](https://millionrounds.com/login?next=%2Fapp%2Fworkflow%2Fauto-workflow-positioning-with-openai-and-in-memory-vectors)
- **Paste it into n8n** Open a new workflow in n8n and paste. Then connect your own accounts.

Stored with the author's traces removed: canvas notes, instance identifiers, saved credential names and any live document they had left behind.

## Connects to

Each opens the other workflows that use it.

[in-memory vectors](https://millionrounds.com/workflows?service=in-memory+vectors#library)

## Workflows like it

Also ai assistants, with the same services where possible, closest in size first.

- [**Detect multi-modal plagiarism with OpenAI and Whisper** 25 steps · calls a model · in-memory vectors](https://millionrounds.com/workflow/detect-multi-modal-plagiarism-with-openai-and-whisper)
- [**Analyze and modernize university curricula with OpenAI** 24 steps · calls a model · in-memory vectors, n8n data table](https://millionrounds.com/workflow/analyze-and-modernize-university-curricula-with-openai)
- [**Segment players and predict churn with OpenAI** 23 steps · calls a model · in-memory vectors, n8n data table](https://millionrounds.com/workflow/segment-players-and-predict-churn-with-openai)
- [**Create a knowledge base chatbot with Google Drive and OpenAI** 20 steps · calls a model · Google Drive, in-memory vectors](https://millionrounds.com/workflow/create-a-knowledge-base-chatbot-with-google-drive-and-openai)
- [**Run Bunker Guard NPC chat and RAG lore checks with Gemini** 19 steps · calls a model · Google Drive, in-memory vectors](https://millionrounds.com/workflow/run-bunker-guard-npc-chat-and-rag-lore-checks-with-gemini)
- [**Gmail smart auto-responder with OpenAI and Google Drive** 17 steps · calls a model · Gmail, Google Drive](https://millionrounds.com/workflow/gmail-smart-auto-responder-with-openai-and-google-drive)
