V4 - AI Interpreter Test Harness¶
This workflow provides a testing interface for the OrganicAI Interpreter system, allowing developers to send test messages and validate AI responses through a simple webhook endpoint. It acts as a development tool to ensure the AI interpreter is working correctly before integrating with production systems.
Purpose¶
No business context provided yet — add a context.md to enrich this documentation.
This workflow serves as a test harness for the AI Interpreter system, enabling developers and QA teams to: - Test AI interpreter responses with various input scenarios - Validate conversation flow logic before production deployment - Debug issues with user message processing - Simulate different user states and conversation steps
How It Works¶
- Receive Test Request: A POST request is sent to the webhook endpoint with test data including user message, phone number, and conversation state
- Execute AI Interpreter: The workflow calls the main OrganicAI Interpreter workflow with the provided test parameters
- Return Results: The AI interpreter's response is returned directly to the caller for analysis
Workflow Diagram¶
graph TD
A[Webhook Trigger] --> B[Call AI Interpreter]
B --> C[Return Response]
style A fill:#e1f5fe
style B fill:#f3e5f5
style C fill:#e8f5e8
Trigger¶
Webhook (POST): Listens for HTTP POST requests at the endpoint /organic-ai-test
The webhook expects a JSON payload with the following structure:
- phoneNumber (optional): User's phone number (defaults to '+254700000099')
- currentStep (required): Current conversation step/state
- userMessage (required): The message to test with the AI interpreter
- firstName (optional): User's first name (defaults to 'TestUser')
Nodes Used¶
| Node Type | Node Name | Purpose |
|---|---|---|
| Webhook | Webhook | Receives test requests via HTTP POST |
| Execute Workflow | Call AI Interpreter | Invokes the main OrganicAI Interpreter workflow with test parameters |
External Services & Credentials Required¶
This workflow doesn't directly use external services but depends on the OrganicAI Interpreter workflow (ID: kGRj9YnsWFWe63G3), which may require:
- AI/LLM service credentials (OpenAI, Anthropic, etc.)
- Database connections for user state management
- SMS/messaging service credentials
Environment Variables¶
No specific environment variables are required for this test harness. All configuration is handled through the webhook payload and passed to the underlying AI Interpreter workflow.
Data Flow¶
Input¶
1 2 3 4 5 6 | |
Processing¶
- Maps input fields to the AI Interpreter workflow parameters
- Provides default values for optional fields (phoneNumber, firstName)
- Uses currentStep for both currentStep and expectedShape parameters
Output¶
Returns the complete response from the OrganicAI Interpreter workflow, which typically includes: - AI-generated response message - Next conversation step - Updated user state - Any additional metadata from the AI processing
Error Handling¶
This workflow uses basic error handling: - Missing Required Fields: The AI Interpreter workflow will handle validation of required parameters - Workflow Execution Errors: Any errors from the called workflow will be propagated back to the caller - Default Values: Provides fallback values for optional parameters to prevent execution failures
Known Limitations¶
- Depends entirely on the availability and proper configuration of the OrganicAI Interpreter workflow
- No input validation beyond what's provided by the called workflow
- Test data is not persisted or logged for analysis
- No rate limiting or authentication on the test endpoint
Related Workflows¶
- V4 - OrganicAIInterpreter (ID:
kGRj9YnsWFWe63G3): The main AI interpreter workflow that this harness tests
Setup Instructions¶
- Import Workflow: Import this workflow into your n8n instance
- Verify Dependencies: Ensure the OrganicAI Interpreter workflow is available and properly configured
- Activate Webhook: Activate the workflow to enable the webhook endpoint
- Test Connection: Send a test POST request to verify the setup:
1 2 3 4 5 6 7 8
curl -X POST https://your-n8n-instance.com/webhook/organic-ai-test \ -H "Content-Type: application/json" \ -d '{ "currentStep": "greeting", "userMessage": "Hello", "phoneNumber": "+254700000099", "firstName": "TestUser" }' - Configure Environment: Ensure the underlying AI Interpreter workflow has all necessary credentials and configurations
- Monitor Logs: Check n8n execution logs to verify successful test runs and identify any issues
Testing Tips¶
- Start with simple messages to verify basic functionality
- Test edge cases like empty messages or invalid step names
- Use different phone numbers to test user state isolation
- Verify that conversation flow progresses correctly through multiple steps