LLM OpenAI GPT-3.5-turbo Chain Chatbot

This workflow automates text processing using OpenAI’s GPT-3.5-turbo-0125 model for generating chat-based responses. Key nodes include Manual Trigger (initiates workflow), Input Validation (sets and validates prompt), OpenAI Chat (API interaction), OpenAI Chat Model (configures model), Check Response (verifies output), Format Success Response, and Format Error Response (manages outputs). It leverages OpenAI’s API for chat-based language processing.\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, navigate to ‘API Keys’ in your account, and generate a key. In n8n, import the provided JSON to create the 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 its path to ‘openai-chat,’ ensure it accepts 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.\n\nTesting and Deployment Steps: Test by sending a POST request to the Webhook URL (after replacing Manual Trigger) using Postman. Example JSON body: {'prompt': 'What is 1+1?'} with the authentication header if enabled. Alternatively, use the Manual Trigger in n8n’s editor. The ‘Format Success Response’ node returns a 200 status with response, model (gpt-3.5-turbo-0125), and prompt_used, or ‘Format Error Response’ (500 status) for API issues like invalid credentials. Monitor logs for errors like ‘Invalid API key’ or ‘Rate limit exceeded,’ and verify credentials or prompt format if issues occur. Activate the workflow in n8n’s interface for deployment. Validate outputs to confirm the response matches the prompt and provider is ‘openai_chat.

$6.99

Workflow steps: 7

Integrated apps: manualTrigger, set, chainLlm

LLM OpenAI GPT-3.5-turbo Chain Chatbot preview