Build Your Own Fictional Country Capital Chatbot
detail.loadingPreview
Instantly create an AI-powered chatbot that can answer questions about fictional country capitals. This workflow leverages OpenAI's capabilities with custom tools for a dynamic and engaging conversational experience.
About This Workflow
This n8n workflow empowers you to build a sophisticated chatbot capable of conversing with users about fictional country capitals. At its core, the workflow utilizes the power of OpenAI's Assistant API, allowing for natural language interactions. It seamlessly integrates custom tools, including one that can list known fictional countries and their capitals, or retrieve the capital for a specific country. A simple memory buffer ensures the chatbot retains context during conversations. This workflow is ideal for developers and automation enthusiasts looking to experiment with AI-powered conversational agents in a low-code environment.
Key Features
- AI-Powered Conversation: Harnesses OpenAI's Assistant API for intelligent and natural language responses.
- Custom Fictional Country Data: Includes a tool to manage and query a list of fictional countries and their capitals.
- Contextual Memory: Maintains conversation history for a more fluid user experience.
- Date and Time Utility: Integrates a tool to fetch the current date and time.
- Sub-workflow Integration: Demonstrates calling a separate workflow for specific functionalities.
How To Use
- Configure OpenAI Credentials: Ensure your OpenAI API credentials are set up in n8n.
- Set Up the Chat Trigger: The
When chat message receivednode initiates the workflow upon receiving a chat message. - Connect to OpenAI Assistant: The
OpenAInode is configured to interact with your chosen OpenAI Assistant (asst_BWy0154vMGMdrX7MjCYaYv6ain this example). - Integrate Custom Tools: The
Tool to call the workflow below(country_capitals_tool) andTool: Get current date and time(date_tool) are crucial for adding specific functionalities. Thecountry_capitals_toolrequires theworkflowIdto be set to the current workflow's ID. - Define Tool Logic: The
Mapping datacode node generates the list of fictional countries and capitals. TheList countries?IF node handles requests to list countries, and thec0b21934-8518-49b4-bbab-f13ad0a74343Setnode formats the response. - Add Memory: The
Simple Memorynode helps the assistant remember previous parts of the conversation. - Trigger the Sub-workflow (Optional): The
When Executed by Another Workflownode can be used to trigger theList countries?logic from an external source if needed.
Apps Used
Workflow JSON
{
"id": "4df9742f-c036-4901-a33d-5537c7fe7e11",
"name": "Build Your Own Fictional Country Capital Chatbot",
"nodes": 10,
"category": "DevOps",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 4df9742f-c036...
About the Author
Free n8n Workflows Official
System Admin
The official repository for verified enterprise-grade workflows.
Statistics
Related Workflows
Discover more workflows you might like
Effortless Bug Reporting: Slack Slash Command to Linear Issue
Streamline your bug reporting process by instantly creating Linear issues directly from Slack using a simple slash command. This workflow enhances team collaboration by providing immediate feedback and a structured approach to logging defects, saving valuable time for development and QA teams.
Automated PR Merged QA Notifications
Streamline your QA process with this automated workflow that notifies your team upon successful Pull Request merges. Leverage AI and vector stores to enrich notifications and ensure seamless integration into your development pipeline.
Visualize Your n8n Workflows: Interactive Dashboard with Mermaid.js
Gain unparalleled visibility into your n8n automation landscape. This workflow transforms your n8n instance into a dynamic, interactive dashboard, leveraging Mermaid.js to visualize all your workflows in one accessible place.