OpenAI Assistant with Custom Fictional Country Tools
detail.loadingPreview
This workflow leverages an OpenAI Assistant to interact with custom tools for retrieving fictional country capitals and the current date.
About This Workflow
This n8n workflow orchestrates an OpenAI Assistant, enabling it to interact with two custom tools: country_capitals_tool and date_tool. The country_capitals_tool is a sub-workflow designed to either list known fictional countries or return the capital of a specified country. The date_tool provides the current timestamp. The main workflow triggers when a manual chat message is received, sending it to the OpenAI Assistant. The assistant can then decide to use one of the available tools based on the user's query.
Key Features
- OpenAI Assistant Integration: Seamlessly connects with OpenAI's Assistant API for intelligent conversation and tool utilization.
- Custom Sub-workflow Tool (
country_capitals_tool): Allows the Assistant to access a list of fictional countries and their capitals. It supports two modes: listing all known countries or fetching a specific capital. - Date and Time Tool (
date_tool): Enables the Assistant to provide the current date and time in ISO format. - Manual Chat Trigger: Initiates the workflow via manual user input in a chat interface.
- Workflow Orchestration: Manages the flow of information between the trigger, the AI assistant, and the custom tools.
How To Use
- Trigger the Workflow: Initiate a manual chat message to the "On new manual Chat Message" node.
- Assistant Interaction: The message is sent to the "OpenAI Assistant" node, which uses the
assistantIdto communicate with your OpenAI Assistant. - Tool Selection: Based on your input, the OpenAI Assistant will decide to use one of the tools:
country_capitals_tool: If your query is about a fictional country's capital or requesting a list of countries.- Mode 1 (List Countries): Input
listinto the "Execute Workflow Trigger" node (which is used by the tool). - Mode 2 (Specific Capital): Input the country name into the "Execute Workflow Trigger" node.
- Mode 1 (List Countries): Input
date_tool: If your query is about the current date or time.
- Tool Execution: The respective tool node (either the sub-workflow or the
toolCodenode) is executed. - Response Generation: The result from the tool is returned to the OpenAI Assistant, which then formulates a natural language response to you.
Apps Used
Workflow JSON
{
"id": "fe72f3a8-be2d-480b-9cec-cd966d6e7045",
"name": "OpenAI Assistant with Custom Fictional Country Tools",
"nodes": 10,
"category": "AI",
"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: fe72f3a8-be2d...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Automated Gmail Labeling with AI
Automatically categorize incoming emails in Gmail using AI, creating new labels when necessary.
Build an AI Documentation Expert Chatbot with Gemini RAG
This n8n workflow automates the creation of an AI-powered expert chatbot capable of answering questions based on your documentation. It intelligently ingests, cleans, and processes your knowledge base, preparing it for a Retrieval Augmented Generation (RAG) pipeline with Google Gemini.
Generate Multilingual Image Captions and Overlay
This workflow generates captions for images using Google Gemini and overlays them onto the image, with support for multilingual output.