This workflow automates conversational tasks with memory using OpenAI’s GPT-4o-mini, maintaining context across queries with a bilingual output (English/Czech). Key nodes include Manual Trigger (initiates workflow), Input Validation (sets user_query, session_id), Validate Input (ensures query length ≥5 characters), Memory Agent (processes query with context), Bilingual Response Parser (structures output as english_answer, czech_answer), Window Buffer Memory (stores session history), OpenAI Chat Model (handles AI processing), Format Success Response (returns structured_data, session_id, english_answer, czech_answer), and Format Validation Error (handles invalid inputs). It uses OpenAI’s API for language processing and memory retention.\n\nSetup Requirements and Configuration: Install n8n by downloading from n8n.io for self-hosting or sign up at cloud.n8n.io for cloud setup. Follow installation prompts or create a cloud account. Obtain an OpenAI API key from platform.openai.com: sign up, go to ‘API Keys,’ and generate a key. In n8n, import the JSON workflow. Configure the OpenAI Chat Model node by adding your API key under ‘Credentials’ > ‘OpenAI API’ in n8n’s interface. Replace the Manual Trigger with a Webhook Trigger for automation: set path to ‘memory-agent,’ configure for POST requests, and optionally enable header authentication with a secure key. Ensure sufficient server resources for cloud or self-hosted setups to handle API requests and memory storage.\n\nTesting and Deployment Steps: Test by sending a POST request to the Webhook URL using Postman. Example JSON: {'user_query': 'My name is John. Remember it.', 'session_id': 'test_session'} followed by {'user_query': 'Can you still remember my name?', 'session_id': 'test_session'} with authentication header if set. Alternatively, use Manual Trigger. The ‘Format Success Response’ node returns a 200 status with structured_data, english_answer (e.g., ‘Yes, your name is John’), czech_answer, and session_id, or ‘Format Validation Error’ (400 status) for queries shorter than 5 characters. Monitor logs for errors like ‘Invalid API key’ or ‘Memory retrieval failed,’ and verify credentials or session_id consistency. Activate the workflow in n8n. Validate output to ensure English_answer and Czech_answer reflect the query and session context.
$6.99
Workflow steps: 9
Integrated apps: manualTrigger, set, if