# Reply to social media and email sales inquiries with OpenAI: n8n workflow

> Started by another system calling it, and works across Email, Google Sheets and Pinecone. It puts OpenAI behind a retrieval step, so answers are drawn from...

Source: https://millionrounds.com/workflow/reply-to-social-media-and-email-sales-inquiries-with-openai (Millionrounds; every figure on the page links to its filing or article)

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

# Reply to social media and email sales inquiries with OpenAI

Started by another system calling it, and works across Email, Google Sheets and Pinecone. It puts OpenAI behind a retrieval step, so answers are drawn from documents you supply rather than from the model alone. 30 steps, 1 branch: 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%2Freply-to-social-media-and-email-sales-inquiries-with-openai)

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

**1** Branch: places the flow splits

**0** Loops or waits

**3** Services it connects to

## The flow

Starts it 6 Model 7 Logic 9 Service 8

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

- 1 **Sync Knowledge Base (Manual)** Manual trigger *Starts it*
- 2 **OpenAI Embeddings (Ingest)** Embeddings Open Ai *Model*
- 3 **Meta Webhook (IG + FB)** Webhook *Starts it*
- 4 **TikTok Webhook** Webhook *Starts it*
- 5 **Email Trigger (IMAP)** Email Read Imap *Service*
- 6 **OpenAI Embeddings (Query)** Embeddings Open Ai *Model*
- 7 **OpenAI Chat Model** Lm Chat Open Ai *Model*
- 8 **Structured Output Parser** Output Parser Structured *Model*
- 9 **Error Trigger** Error trigger *Starts it*
- 10 **Fetch Offerings Data Source** Google Sheets *Service*
- 11 **Upsert Offerings to Pinecone** Vector Store Pinecone *Model*
- 12 **Ack Meta (200 OK)** Respond To Webhook *Starts it*
- 13 **Normalize Meta Event** Code *Logic*
- 14 **Ack TikTok (200 OK)** Respond To Webhook *Starts it*
- 15 **Normalize TikTok Event** Code *Logic*
- 16 **Normalize Email Event** Code *Logic*
- 17 **Retrieve Relevant Offerings** Vector Store Pinecone *Model*
- 18 **RAG Sales Reply Agent** Agent *Model*
- 19 **Format Error Details** Code *Logic*
- 20 **Build KB Chunks** Code *Logic*
- 21 **Merge Interactions** Merge *Logic*
- 22 **Assemble Context** Code *Logic*
- 23 **Format Final Reply** Code *Logic*
- 24 **Send Error Alert** Email Send *Service*
- 25 **Route by Platform** Switch *Logic*
- 26 **Reply on Instagram** Http Request *Service*
- 27 **Reply on Facebook** Http Request *Service*
- 28 **Reply on TikTok** Http Request *Service*
- 29 **Reply via Email** Email Send *Service*
- 30 **Log Interaction** Google Sheets *Service*

## How it's built

- **Starts on:** Another system calling it
- **Steps:** 30, with 1 branch
- **Size:** Large: read it before trusting it with anything live
- **Connects to:** Email, Google Sheets, Pinecone
- **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 Email, Google Sheets and Pinecone accounts, 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 30 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 30 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%2Freply-to-social-media-and-email-sales-inquiries-with-openai)
- **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.

[Email](https://millionrounds.com/workflows?service=Email#library)[Google Sheets](https://millionrounds.com/workflows?service=Google+Sheets#library)[Pinecone](https://millionrounds.com/workflows?service=Pinecone#library)

## Workflows like it

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

- [**Analyze customer feedback and send AI-written replies** 31 steps · calls a model · Email, Google Sheets](https://millionrounds.com/workflow/analyze-customer-feedback-and-send-ai-written-replies)
- [**Deal Room - AI-Powered M&A Due Diligence Accelerator** 31 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/deal-room-ai-powered-m-and-a-due-diligence-accelerator)
- [**LinkedIn auto-connect & personalized messaging for sales** 29 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/linkedin-auto-connect-and-personalized-messaging-for-sales)
- [**Restaurant daily insights with Gemini** 27 steps · calls a model · Gmail, Google Sheets](https://millionrounds.com/workflow/restaurant-daily-insights-with-gemini)
- [**Draft case study one-pagers from Closed Won deals** 27 steps · Email, Google Sheets](https://millionrounds.com/workflow/draft-case-study-one-pagers-from-closed-won-deals)
- [**Recover missed demos with Calendly and Zoom** 26 steps · calls a model · Email, HubSpot](https://millionrounds.com/workflow/recover-missed-demos-with-calendly-and-zoom)
