Spaces:
Sleeping
Sleeping
| { | |
| "name": "WF-01: Message Router — Webhook Trigger", | |
| "nodes": [ | |
| { | |
| "parameters": { | |
| "path": "webhook/message", | |
| "responseMode": "responseNode", | |
| "responseData": "firstEntryData" | |
| }, | |
| "id": "webhook-trigger", | |
| "name": "Message Webhook Input", | |
| "type": "n8n-nodes-base.webhook", | |
| "typeVersion": 2, | |
| "position": [200, 300] | |
| }, | |
| { | |
| "parameters": { | |
| "url": "https://tillu-ai-tillu-backend.hf.space/internal/classify/intent", | |
| "method": "POST", | |
| "contentType": "application/json", | |
| "body": { | |
| "text": "={{ $json.message }}", | |
| "llm_provider": "groq" | |
| }, | |
| "authentication": "generic", | |
| "genericAuthType": "httpHeaderAuth", | |
| "httpHeaderAuth": { | |
| "name": "Authorization", | |
| "value": "Bearer sk-tillu-internal-token-intent-classifier" | |
| } | |
| }, | |
| "id": "classify-intent", | |
| "name": "Classify Intent via Groq", | |
| "type": "n8n-nodes-base.httpRequest", | |
| "typeVersion": 4.1, | |
| "position": [400, 300] | |
| }, | |
| { | |
| "parameters": { | |
| "dataPropertyName": "intent", | |
| "value": "conversation", | |
| "nodeOutput": 0 | |
| }, | |
| "id": "route-by-intent", | |
| "name": "Route by Intent Type", | |
| "type": "n8n-nodes-base.switch", | |
| "typeVersion": 1, | |
| "position": [600, 300] | |
| }, | |
| { | |
| "parameters": { | |
| "url": "https://tillu-ai-tillu-backend.hf.space/internal/chains/conversational", | |
| "method": "POST", | |
| "contentType": "application/json", | |
| "body": { | |
| "message": "={{ $json.message }}", | |
| "user_id": "={{ $json.user_id }}", | |
| "llm_provider": "groq", | |
| "model": "llama-3.1-70b-versatile" | |
| }, | |
| "authentication": "generic", | |
| "genericAuthType": "httpHeaderAuth", | |
| "httpHeaderAuth": { | |
| "name": "Authorization", | |
| "value": "Bearer sk-tillu-internal-token-conversational-chain" | |
| }, | |
| "options": { | |
| "timeout": 60000 | |
| } | |
| }, | |
| "id": "run-conversation-chain", | |
| "name": "Run Conversational Chain", | |
| "type": "n8n-nodes-base.httpRequest", | |
| "typeVersion": 4.1, | |
| "position": [800, 150] | |
| }, | |
| { | |
| "parameters": { | |
| "url": "https://tillu-ai-tillu-backend.hf.space/internal/chains/research", | |
| "method": "POST", | |
| "contentType": "application/json", | |
| "body": { | |
| "query": "={{ $json.message }}", | |
| "user_id": "={{ $json.user_id }}", | |
| "llm_provider": "groq", | |
| "mode": "balanced" | |
| }, | |
| "authentication": "generic", | |
| "genericAuthType": "httpHeaderAuth", | |
| "httpHeaderAuth": { | |
| "name": "Authorization", | |
| "value": "Bearer sk-tillu-internal-token-research-chain" | |
| }, | |
| "options": { | |
| "timeout": 90000 | |
| } | |
| }, | |
| "id": "run-research-chain", | |
| "name": "Run Research Chain via WebSearch", | |
| "type": "n8n-nodes-base.httpRequest", | |
| "typeVersion": 4.1, | |
| "position": [800, 300] | |
| }, | |
| { | |
| "parameters": { | |
| "url": "https://tillu-ai-tillu-backend.hf.space/internal/memory/store", | |
| "method": "POST", | |
| "contentType": "application/json", | |
| "body": { | |
| "user_id": "={{ $json.user_id }}", | |
| "content": "={{ $json.message }}", | |
| "embedding_model": "all-mpnet-base-v2", | |
| "timestamp": "={{ new Date().toISOString() }}" | |
| }, | |
| "authentication": "generic", | |
| "genericAuthType": "httpHeaderAuth", | |
| "httpHeaderAuth": { | |
| "name": "Authorization", | |
| "value": "Bearer sk-tillu-internal-token-memory" | |
| } | |
| }, | |
| "id": "store-memory", | |
| "name": "Store Message in Memory", | |
| "type": "n8n-nodes-base.httpRequest", | |
| "typeVersion": 4.1, | |
| "position": [1000, 300] | |
| }, | |
| { | |
| "parameters": { | |
| "url": "https://tillu-ai-tillu-backend.hf.space/internal/events/publish", | |
| "method": "POST", | |
| "contentType": "application/json", | |
| "body": { | |
| "channel": "tillu:message_processed", | |
| "event": { | |
| "type": "message_completed", | |
| "user_id": "={{ $json.user_id }}", | |
| "intent": "={{ $json.intent }}", | |
| "response": "={{ $json.response }}", | |
| "timestamp": "={{ new Date().toISOString() }}" | |
| } | |
| }, | |
| "authentication": "generic", | |
| "genericAuthType": "httpHeaderAuth", | |
| "httpHeaderAuth": { | |
| "name": "Authorization", | |
| "value": "Bearer sk-tillu-internal-token-events" | |
| } | |
| }, | |
| "id": "publish-event", | |
| "name": "Publish Completion Event", | |
| "type": "n8n-nodes-base.httpRequest", | |
| "typeVersion": 4.1, | |
| "position": [1200, 300] | |
| } | |
| ], | |
| "connections": { | |
| "Message Webhook Input": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Classify Intent via Groq", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Classify Intent via Groq": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Route by Intent Type", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Route by Intent Type": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Run Conversational Chain", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ], | |
| [ | |
| { | |
| "node": "Run Research Chain via WebSearch", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Run Conversational Chain": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Store Memory", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Run Research Chain via WebSearch": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Store Memory", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| }, | |
| "Store Memory": { | |
| "main": [ | |
| [ | |
| { | |
| "node": "Publish Completion Event", | |
| "type": "main", | |
| "index": 0 | |
| } | |
| ] | |
| ] | |
| } | |
| }, | |
| "pinData": {}, | |
| "settings": { | |
| "executionOrder": "v1", | |
| "timezone": "Asia/Kolkata" | |
| }, | |
| "tags": [ | |
| { | |
| "name": "message-processing", | |
| "id": "message-tag" | |
| }, | |
| { | |
| "name": "groq-llm", | |
| "id": "groq-tag" | |
| }, | |
| { | |
| "name": "webhook", | |
| "id": "webhook-tag" | |
| } | |
| ] | |
| } | |