Skip to content

Instantly share code, notes, and snippets.

@m3tam3re
Created February 28, 2025 08:16
Show Gist options
  • Save m3tam3re/a688cea3580b7bb7474fdb14341307e8 to your computer and use it in GitHub Desktop.
Save m3tam3re/a688cea3580b7bb7474fdb14341307e8 to your computer and use it in GitHub Desktop.
{
"nodes": [
{
"parameters": {
"httpMethod": "POST",
"path": "394e53fb-20a1-4a7b-b2be-b9fd51b60922",
"responseMode": "responseNode",
"options": {}
},
"type": "n8n-nodes-base.webhook",
"typeVersion": 2,
"position": [
-200,
-700
],
"id": "a0f96df5-573f-45cb-8000-2acba2438ff5",
"name": "Webhook",
"webhookId": "394e53fb-20a1-4a7b-b2be-b9fd51b60922"
},
{
"parameters": {
"promptType": "define",
"text": "=video_id: {{ $json.body[0].video_id }}",
"options": {
"systemMessage": "=You are a specialized Translation Coordination Agent for video content localization.\n\n# Workflow Responsibilities:\n1. Obtain video metadata using **Get_Video_Metadata** tool\n2. Store retrieved metadata in agent's working memory\n3. Identify the **source_language**\n4. Submit the obtained metadata to the **Translation_Agent** tool\n\n# Key Guidelines:\n- Retrieve metadata ONCE and reuse\n- Submit a single translation request\n**Translation_Agent** tool\n- Maintain original metadata integrity\n- After receiving **SUCESS** from the **Translation_Agent** respond with \"Translations have been submitted\""
}
},
"type": "@n8n/n8n-nodes-langchain.agent",
"typeVersion": 1.7,
"position": [
20,
-700
],
"id": "ea9e521f-5b50-48b1-aa7b-99afec4359ea",
"name": "AI Agent"
},
{
"parameters": {
"model": "qwen2.5:32b",
"options": {}
},
"type": "@n8n/n8n-nodes-langchain.lmChatOllama",
"typeVersion": 1,
"position": [
-220,
-460
],
"id": "04e0453f-d911-4366-b1b2-194f9811022e",
"name": "Ollama Chat Model",
"credentials": {
"ollamaApi": {
"id": "fXPH8vvuisTz43yf",
"name": "Ollama account"
}
}
},
{
"parameters": {
"name": "Get_Video_Metadata",
"description": "=Use this tool to retrieve the **original_title** and **original_description**",
"workflowId": {
"__rl": true,
"value": "84N2ZjZW2WlvuMEf",
"mode": "list",
"cachedResultName": "🧰 YT - Metadata"
},
"responsePropertyName": "=response",
"specifyInputSchema": true,
"jsonSchemaExample": "{\n\t\"video_id\": \"video_id\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 1.2,
"position": [
120,
-460
],
"id": "79598ebd-f4b9-4309-89fc-e21578aef380",
"name": "Get_Video_Metadata"
},
{
"parameters": {
"name": "Translation_Agent",
"description": "=Use this tool to submit obtained metadata for translation.",
"workflowId": {
"__rl": true,
"value": "n2BU4vko7n115Rt1",
"mode": "list",
"cachedResultName": "πŸ€– Translation_Agent - Local"
},
"fields": {
"values": [
{
"name": "video_id",
"stringValue": "={{ $json.body[0].video_id }}"
},
{
"name": "target_languages",
"type": "arrayValue",
"arrayValue": "={{ $json.body[0].target_languages }}"
}
]
},
"specifyInputSchema": true,
"jsonSchemaExample": "{\n \"original_title\": \"original_title\",\n \"original_description\": \"original_description\",\n \"source_language\": \"source_language\"\n}"
},
"type": "@n8n/n8n-nodes-langchain.toolWorkflow",
"typeVersion": 1.2,
"position": [
300,
-460
],
"id": "4a550da1-41c5-46fb-a3fc-33e324a4b84d",
"name": "Translation_Agent"
},
{
"parameters": {
"options": {
"responseCode": 200
}
},
"type": "n8n-nodes-base.respondToWebhook",
"typeVersion": 1.1,
"position": [
380,
-700
],
"id": "0c7df38a-f0fe-4a3c-a4e4-d9900d213f70",
"name": "Respond to Webhook"
},
{
"parameters": {
"sessionIdType": "customKey",
"sessionKey": "={{ $now }}",
"contextWindowLength": 1
},
"type": "@n8n/n8n-nodes-langchain.memoryBufferWindow",
"typeVersion": 1.2,
"position": [
-60,
-460
],
"id": "42079a5a-ca8c-4043-bda9-b9ad83d1a2de",
"name": "Window Buffer Memory"
}
],
"connections": {
"Webhook": {
"main": [
[
{
"node": "AI Agent",
"type": "main",
"index": 0
}
]
]
},
"AI Agent": {
"main": [
[
{
"node": "Respond to Webhook",
"type": "main",
"index": 0
}
]
]
},
"Ollama Chat Model": {
"ai_languageModel": [
[
{
"node": "AI Agent",
"type": "ai_languageModel",
"index": 0
}
]
]
},
"Get_Video_Metadata": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Translation_Agent": {
"ai_tool": [
[
{
"node": "AI Agent",
"type": "ai_tool",
"index": 0
}
]
]
},
"Window Buffer Memory": {
"ai_memory": [
[
{
"node": "AI Agent",
"type": "ai_memory",
"index": 0
}
]
]
}
},
"pinData": {
"Webhook": [
{
"headers": {
"host": "localhost:5678",
"content-type": "application/json",
"user-agent": "insomnia/10.2.0",
"accept": "*/*",
"content-length": "41"
},
"params": {},
"query": {},
"body": [
{
"video_id": "VDSjnICdXX4",
"target_languages": [
"de",
"fr",
"es"
]
}
],
"webhookUrl": "http://localhost:5678/webhook/a383af11-7ce3-4234-a0e3-9c24ac1137c7",
"executionMode": "production"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment