All workflows
Slack logoOpenAI logo

Answer channel questions from what was already said

Answers a question posted in Slack using only the messages that channel already contains, in a thread.

On new message in Slack2 apps7 steps

Apps it connects

Authenticate each one once and the workflow is ready to run.

What it does

Each integration step this workflow runs, in order, what it is for, and the conditions and loops that decide when it runs.

  1. 1SlackNew message triggerStarts a run only when a message containing the ask word is posted in the channel you chose.
  2. 2SlackGet channel historyReads the channel's most recent messages as context, leaving out empty ones, duplicates and other questions to the bot.
  3. 3OpenAIQuery modelAsks the AI for a short search phrase, then for an answer drawn only from the quoted channel messages.
  4. If searchPhrase is not empty

    1. 4SlackFind messagesLooks through the channel's 200 most recent messages for ones containing the search phrase, to widen the evidence.
  5. If draftProblem is not empty

    1. 5SlackSend messagePosts the answer in a thread under the question, or the closest messages found when no safe answer could be drafted.

    Otherwise, if draft is empty, draft is “null” or draft starts with “NOT FOUND”

    1. 6SlackSend message
  6. 7SlackSend message

How it works

What happens on each run, in plain English.

When someone posts a message in your chosen Slack channel that contains the ask word ('!ask' unless you change it), the rest of the message is treated as a question; other messages do not start the workflow at all. The channel's 20 most recent messages are read, the AI works out a short search phrase, the channel's last 200 messages are searched for it, and the AI drafts an answer from the messages found alone.

The answer is posted in a thread under the question, with a line saying how many earlier messages it read. When nothing relevant turns up it says so instead of improvising, and when the draft quotes a figure that appears in none of the messages, the draft is withheld and the closest messages are posted instead. If the AI does not respond, the thread is told it cannot answer right now and the run is marked as failed. Mentions in anything it posts are defused, so nobody is pinged.

You need a Slack connection and an OpenAI connection, the Slack channel to watch, and a line or two describing your team. It only sees messages posted in the channel itself, and only the last 200: replies written inside threads, and anything older, cannot be found.

slackopenaiquestion answeringknowledge baseevent drivenai

Start from a workflow that already works.

Add "Answer channel questions from what was already said" to your workspace, connect its apps, and make it yours.

Free plan, no credit card