Skip to content
AI Agents

Gilfoyle-persona Slack chatbot with AI agent tools

14 nodes 22 2 Webhook
Download

Loading workflow…

Workflow Description

This workflow receives Slack messages via a POST Webhook, filters out bot messages with an IF node, and passes the message text to an AI Agent running GPT-4 that role-plays Gilfoyle from Silicon Valley with a blunt, sarcastic personality. The Agent has SerpAPI and Wikipedia tools for lookups when needed, keeps per-channel conversation history via a window buffer memory keyed by channel ID, and finally sends the Agent output back to the originating Slack user as a direct message via a Slack node.

How it works

  1. 1.A Webhook listens for POST requests on the slack-gilfoyle path from Slack events.
  2. 2.An IF node checks the bot_id field to discard bot messages and only process human messages.
  3. 3.The message text is passed to the Agent with a system message defining Gilfoyle's cynical, cutting persona.
  4. 4.The Agent uses GPT-4 as its language model with window buffer memory keyed by channel ID (context window of 30).
  5. 5.The Agent may invoke SerpAPI and Wikipedia tools to look up information when necessary.
  6. 6.The Agent output is sent as a Slack direct message to the user who posted the original message.

Use cases

  • A team Slack assistant that answers questions with a distinctive sarcastic persona.
  • Fetching information from Wikipedia and web search without leaving Slack.
  • A reference example for building an AI-agent Slack bot with per-channel conversation memory.

Requirements

  • A Slack app configured with Event Subscriptions that deliver message events to the n8n Webhook URL.
  • Slack API credentials configured in n8n for the message-sending node.
  • OpenAI API credentials for the Chat OpenAI node (gpt-4 model).
  • SerpAPI credentials for the search tool; the Wikipedia tool requires no credentials.

Setup and testing in n8n

  1. Activate the workflow and set the Webhook URL in the Slack app's event subscription settings.
  2. Post a text message as a user in a subscribed channel and verify a Gilfoyle-style reply arrives as a direct message.
  3. Post a message from another bot and confirm it is ignored via the No Operation branch.
  4. Ask a question requiring lookup and verify the Agent invokes the SerpAPI or Wikipedia tool.

Service Value

Ideal as a smart automation service combining integrations and AI to produce ready-to-use results.

Apps Used

Webhook Slack OpenAI Memory Tool No Op If AI Agent

Details

Trigger Webhook
Nodes 14
Apps 8
Views 22
Downloads 2

How to Use

  1. 1.Click "Download Template"
  2. 2.Open your n8n dashboard
  3. 3.Go to Workflows > Import from File
  4. 4.Select downloaded file and configure credentials

Nodes Used (14)

/

Webhook

Webhook

#1

Slack

Slack

#2

Chat OpenAI

OpenAI

#3

Window Buffer Memory

Memory Buffer Window

#4

Wikipedia

Tool Wikipedia

#5

No Operation, do nothing

No Op

#6

Is user message

If

#7

Sticky Note

Sticky Note

#8

SerpAPI

Tool Serp Api

#9

Sticky Note1

Sticky Note

#10

Sticky Note2

Sticky Note

#11

Sticky Note3

Sticky Note

#12

Sticky Note4

Sticky Note

#13

Agent

Agent

#14

Source and license

Sticky Note

#15
Stay in the loop

Fresh workflows, straight to your inbox

Get newly published DROPIDEA workflows, a clear overview of what they do, and a link to explore them.

  • New workflows
  • Clear overviews
  • Setup guides

Be first to discover what is new

Your name, your email, and one confirmation.

Email confirmation · Unsubscribe anytime