When someone asks a question in Slack, finds the Notion FAQ pages that match and drafts an answer from them for you to approve.

UsesClaudeNotionSlack

Answer Slack questions from your Notion FAQ

When someone asks a question in the Slack channel you choose, AI first checks it really is a question; greetings, thanks and chat are left alone and nothing is posted. For a real question it picks up to three search words, finds the Notion pages whose titles match, reads each page's title, link and property values, and drafts a short answer built only from what those pages say, naming the page each point came from. Lodol cannot read the body text of a Notion page, so it works best on an FAQ kept as a Notion database with the answer in a property.

The draft comes for approval, in full with its sources, before anything reaches the channel; anyone in your Lodol workspace can approve unless you name approvers. Approve it and the answer goes into the thread with the page links; reject it, or leave it for three days, and only the links are shared, with a line saying which happened. If no page title matches, or the pages found do not cover the question, the thread is told so and no answer is invented to fill the gap.

You need a Slack connection, a Notion connection with your FAQ pages shared with Lodol, and an Anthropic connection; the Slack channel where questions arrive; and a few sentences about your team.

SlackSlackWhen someone posts in a channel. Save it as request.When someone posts in a channel. Save it as request.
ValuesSet teamContext to blank.Set teamContext to blank.
ValuesSet maxPages to 5.Set maxPages to 5.
ValuesSet questionText to blank.Set questionText to blank.
Decisions & LoopsIf a step below fails, save the error as readErrorIf a step below fails, save the error as readError
Try
TextTrim request.text and save it as questionText.Trim request.text and save it as questionText.
On error
ValuesShow in the output: The Slack message carried no text to read, so it was skipped..Show in the output: The Slack message carried no text to read, so it was skipped..
Decisions & LoopsIf questionText is emptyIf questionText is empty
Yes
Decisions & LoopsFinish the run: The message had no text, so there was no question to answer.Finish the run: The message had no text, so there was no question to answer.
No
No steps
AI AgentRun an AI agent: The message posted in the channel: questionText and save it as screening.Run an AI agent: The message posted in the channel: questionText and save it as screening.
Decisions & LoopsIf screening.output.is_question is noIf screening.output.is_question is no
Yes
Decisions & LoopsFinish the run: The message is not a question, so nothing was searched or posted.Finish the run: The message is not a question, so nothing was searched or posted.
Else if @screening.output.is_question is not "yes"
Decisions & LoopsStop and report a problem: The AI could not tell whether this message is a question (it answered @screening.output.is_question), so nothing was searched or posted. The message was: questionText.Stop and report a problem: The AI could not tell whether this message is a question (it answered @screening.output.is_question), so nothing was searched or posted. The message was: questionText.
Otherwise
No steps
ListsTake the first 3 items of screening.output.search_words and save it as searchWords.Take the first 3 items of screening.output.search_words and save it as searchWords.
Decisions & LoopsIf searchWords is emptyIf searchWords is empty
Yes
ValuesChange searchWords to [questionText].Change searchWords to [questionText].
No
No steps
ValuesSet foundPages to an empty list.Set foundPages to an empty list.
Decisions & LoopsFor each searchWord in searchWords:For each searchWord in searchWords:
NotionNotionSearch pages for searchWord. Save it as found.Search pages for searchWord. Save it as found.
ListsCombine foundPages and found.pages into one list and save it as foundPages.Combine foundPages and found.pages into one list and save it as foundPages.
ListsRemove duplicates of id from foundPages and save it as uniquePages.Remove duplicates of id from foundPages and save it as uniquePages.
ListsTake the first maxPages items of uniquePages and save it as pagesToRead.Take the first maxPages items of uniquePages and save it as pagesToRead.
TextJoin searchWords with , and save it as searchedFor.Join searchWords with , and save it as searchedFor.
ValuesSet sourceBlocks to an empty list.Set sourceBlocks to an empty list.
ValuesSet sourceLinks to an empty list.Set sourceLinks to an empty list.
Decisions & LoopsFor each page in pagesToRead:For each page in pagesToRead:
ValuesSet pageTitle to blank.Set pageTitle to blank.
Decisions & LoopsIf a step below fails, save the error as titleErrorIf a step below fails, save the error as titleError
Try
TextTrim page.title and save it as pageTitle.Trim page.title and save it as pageTitle.
On error
ValuesShow in the output: Skipped a search result that had no title..Show in the output: Skipped a search result that had no title..
Decisions & LoopsIf pageTitle isn't emptyIf pageTitle isn't empty
Yes
ValuesSet pageLink to blank.Set pageLink to blank.
Decisions & LoopsIf a step below fails, save the error as linkErrorIf a step below fails, save the error as linkError
Try
TextTrim page.url and save it as pageLink.Trim page.url and save it as pageLink.
On error
ValuesShow in the output: No link came back for the page pageTitle.Show in the output: No link came back for the page pageTitle.
ValuesSet pageDetails to (only the title and link are available).Set pageDetails to (only the title and link are available).
Decisions & LoopsIf a step below fails, save the error as detailErrorIf a step below fails, save the error as detailError
Try
NotionNotionGet page.id. Save it as fullPage.Get page.id. Save it as fullPage.
TextConvert fullPage.properties to a bulleted list and save it as readable.Convert fullPage.properties to a bulleted list and save it as readable.
Decisions & LoopsIf readable isn't emptyIf readable isn't empty
Yes
ValuesChange pageDetails to readable.Change pageDetails to readable.
No
No steps
On error
ValuesShow in the output: Could not read the details of the page pageTitle, so only its title and link were used: detailError as text.Show in the output: Could not read the details of the page pageTitle, so only its title and link were used: detailError as text.
ListsAdd PAGE: pageTitleAdd PAGE: pageTitle LINK: pageLink DETAILS: pageDetails to the end of sourceBlocks and save it as sourceBlocks.
ListsAdd - pageTitle pageLink to the end of sourceLinks and save it as sourceLinks.Add - pageTitle pageLink to the end of sourceLinks and save it as sourceLinks.
No
No steps
Decisions & LoopsIf sourceBlocks is emptyIf sourceBlocks is empty
Yes
SlackSlackReply in a thread in request.channel_id.Reply in a thread in request.channel_id. Reply To: request.message_tsI could not find a page in our Notion workspace about this (I searched page titles for: searchedFor), so there is nothing written down for me to answer from. Someone will need to answer this one by hand.
Decisions & LoopsFinish the run: No Notion page title matched the search (searchedFor), so no answer was drafted.Finish the run: No Notion page title matched the search (searchedFor), so no answer was drafted.
No
No steps
TextJoin sourceBlocks with a blank line and save it as sources.Join sourceBlocks with a blank line and save it as sources.
TextJoin sourceLinks with a new line and save it as linkList.Join sourceLinks with a new line and save it as linkList.
ClaudeClaudeAsk Claude: 'You are answering a question using ONLY the Notion pages listed below. They come from this team's own workspace. Do not use anything you know from outside them, and do not guess.Ask Claude: 'You are answering a question using ONLY the Notion pages listed below. They come from this team's own workspace. Do not use anything you know from outside them, and do not guess. Write a short, direct answer - a few sentences, or a short list. After each point, name the page it came from in square brackets, exactly as that page's title is written below. Never invent a page title, a link, or a detail that is not in the pages. If the pages below do not contain enough to answer the question, reply with exactly: NOT_IN_THE_WIKI and nothing else. An invented answer that looks like it came from the team's own documentation is far worse than no answer. About the team and who is asking: teamContext The question: questionText The pages found in Notion, with their links and property values: sources'. Save it as drafted. Maximum response length: 700
TextTrim drafted.response_text and save it as answer.Trim drafted.response_text and save it as answer.
Decisions & LoopsIf answer is empty or answer contains NOT_IN_THE_WIKI (ignoring case)If answer is empty or answer contains NOT_IN_THE_WIKI (ignoring case)
Yes
SlackSlackReply in a thread in request.channel_id.Reply in a thread in request.channel_id. Reply To: request.message_tsI found these pages in our Notion workspace, but none of them answers this: linkList Someone will need to answer this one by hand.
Decisions & LoopsFinish the run: The pages found did not answer the question, so only their links were shared.Finish the run: The pages found did not answer the question, so only their links were shared.
No
No steps
ApprovalsRequest approval: Post this answer in Slack to: questionText Save it as review.Request approval: Post this answer in Slack to: questionText Save it as review.Someone asked in Slack: questionText Drafted answer: answer Drafted from these Notion pages: linkList ...
Decisions & LoopsIf review.approved is yesIf review.approved is yes
Yes
SlackSlackReply in a thread in request.channel_id.Reply in a thread in request.channel_id. Reply To: request.message_tsanswer From our Notion workspace: linkList _Drafted from the pages above and checked by a person before posting._
No
ValuesSet outcomeNote to:Set outcomeNote to:A drafted answer was checked and not approved, so only the links are shared here.
Decisions & LoopsIf review.timed_out is yesIf review.timed_out is yes
Yes
ValuesChange outcomeNote to:Change outcomeNote to:Nobody checked the drafted answer within three days, so only the links are shared here.
No
No steps
SlackSlackReply in a thread in request.channel_id.Reply in a thread in request.channel_id. Reply To: request.message_tsThese pages in our Notion workspace look relevant to your question: linkList@outcomeNote