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 Slack, Notion and Anthropic connected, with your FAQ pages shared with Lodol in Notion; 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.
Set teamContext to blank.Set teamContext to blank.
Set maxPages to 5.Set maxPages to 5.
Set questionText to blank.Set questionText to blank.
If a step below fails, save the error as readErrorIf a step below fails, save the error as readError
Try
Trim request.text and save it as questionText.Trim request.text and save it as questionText.
On error
Show 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.”.
If questionText is emptyIf questionText is empty
Yes
Finish 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
Run 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.
If screening.output.is_question is “no”If screening.output.is_question is “no”
Yes
Finish 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"
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.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
Take 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.
If searchWords is emptyIf searchWords is empty
Yes
Change searchWords to [questionText].Change searchWords to [questionText].
No
No steps
Set foundPages to an empty list.Set foundPages to an empty list.
For 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.
Combine 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.
Remove duplicates of “id” from foundPages and save it as uniquePages.Remove duplicates of “id” from foundPages and save it as uniquePages.
Take the first maxPages items of uniquePages and save it as pagesToRead.Take the first maxPages items of uniquePages and save it as pagesToRead.
Join searchWords with “, ” and save it as searchedFor.Join searchWords with “, ” and save it as searchedFor.
Set sourceBlocks to an empty list.Set sourceBlocks to an empty list.
Set sourceLinks to an empty list.Set sourceLinks to an empty list.
For each page in pagesToRead:For each page in pagesToRead:
Set pageTitle to blank.Set pageTitle to blank.
If a step below fails, save the error as titleErrorIf a step below fails, save the error as titleError
Try
Trim page.title and save it as pageTitle.Trim page.title and save it as pageTitle.
On error
Show in the output: “Skipped a search result that had no title.”.Show in the output: “Skipped a search result that had no title.”.
If pageTitle isn't emptyIf pageTitle isn't empty
Yes
Set pageLink to blank.Set pageLink to blank.
If a step below fails, save the error as linkErrorIf a step below fails, save the error as linkError
Try
Trim page.url and save it as pageLink.Trim page.url and save it as pageLink.
On error
Show in the output: No link came back for the page pageTitle.Show in the output: No link came back for the page pageTitle.
Set pageDetails to “(only the title and link are available)”.Set pageDetails to “(only the title and link are available)”.
If 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.
Convert fullPage.properties to a bulleted list and save it as readable.Convert fullPage.properties to a bulleted list and save it as readable.
If readable isn't emptyIf readable isn't empty
Yes
Change pageDetails to readable.Change pageDetails to readable.
No
No steps
On error
Show 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.
Add PAGE: pageTitleAdd PAGE: pageTitle LINK: pageLink DETAILS: pageDetails to the end of sourceBlocks and save it as sourceBlocks.
Add - 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
If 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.
Finish 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
Join sourceBlocks with a blank line and save it as sources.Join sourceBlocks with a blank line and save it as sources.
Join 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
Trim drafted.response_text and save it as answer.Trim drafted.response_text and save it as answer.
If 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.
Finish 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
Ask a person: Post this answer in Slack to: questionText Save it as review.Ask a person: 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 ...
If 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
Set outcomeNote to:Set outcomeNote to:A drafted answer was checked and not approved, so only the links are shared here.
If review.timed_out is yesIf review.timed_out is yes
Yes
Change 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