Quick overview
This workflow syncs Notion pages and Google Drive files into a Pinecone vector index nightly, then answers Slack @mentions using an OpenAI chat model with retrieval from that Pinecone knowledge base and replies with a source URL.
How it works
- Runs every night at 2am and searches for content across Notion and Google Drive.
- Combines both result sets into a single normalized list of documents with IDs, titles, URLs, and source labels.
- Iterates through each document and extracts plain text either from Notion page blocks or by downloading and text-extracting the Google Drive file.
- Generates OpenAI embeddings and inserts each document plus metadata into a Pinecone index.
- Triggers when the bot is @mentioned in a specified Slack channel, cleans the message to a plain question, and keeps the thread context.
- Uses an OpenAI chat model with a Pinecone retrieval tool to answer the question and posts the response back to the originating Slack thread, while sending any workflow errors to an ops Slack channel.
Setup
- Add credentials for Notion, Google Drive, Slack, OpenAI, and Pinecone.
- Create or select a Pinecone index and replace the placeholder index name in both the ingestion and retrieval Pinecone nodes.
- Set the Slack channel ID for Q&A mentions and the ops-alerts channel ID for error notifications, then install/configure the Slack app so it can receive app_mention events.