AutomationFlowsGeneral › n8n File Watcher for Transcript Processing

n8n File Watcher for Transcript Processing

Original n8n title: N8n Workflow

N8N Workflow. Uses executeCommand, localFileTrigger. Event-driven trigger; 7 nodes.

Event trigger★★☆☆☆ complexity7 nodesExecute CommandLocal File Trigger
General Trigger: Event Nodes: 7 Complexity: ★★☆☆☆ Added:

The workflow JSON

Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →

Download .json
{
  "nodes": [
    {
      "parameters": {
        "updates": [
          "message"
        ],
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegramTrigger",
      "typeVersion": 1.2,
      "position": [
        -96,
        400
      ],
      "id": "ee05fea8-b0d4-474a-a6b2-b10db895c871",
      "name": "Telegram Trigger",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "allow-user",
              "leftValue": "={{ $json.message.from.id }}",
              "rightValue": 957087985,
              "operator": {
                "type": "number",
                "operation": "equals"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        208,
        400
      ],
      "id": "7f9299cc-bb14-4376-96c8-e723eede06d0",
      "name": "Allowed User?"
    },
    {
      "parameters": {
        "rules": {
          "values": [
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "leftValue": "={{ $json.message.voice }}",
                    "rightValue": "",
                    "operator": {
                      "type": "object",
                      "operation": "exists",
                      "singleValue": true
                    },
                    "id": "5db5977a-590d-452a-94a2-7340adc55300"
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Audio"
            },
            {
              "conditions": {
                "options": {
                  "caseSensitive": true,
                  "leftValue": "",
                  "typeValidation": "strict",
                  "version": 2
                },
                "conditions": [
                  {
                    "id": "24e2a1cd-2c86-4f59-8cc5-ccca86d581d3",
                    "leftValue": "={{ $json.message.voice }}",
                    "rightValue": "",
                    "operator": {
                      "type": "object",
                      "operation": "notExists",
                      "singleValue": true
                    }
                  }
                ],
                "combinator": "and"
              },
              "renameOutput": true,
              "outputKey": "Text"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.switch",
      "typeVersion": 3.2,
      "position": [
        528,
        384
      ],
      "id": "3dfb901a-e422-4a67-a540-288272b33f3c",
      "name": "Voice or Text?"
    },
    {
      "parameters": {
        "resource": "file",
        "fileId": "={{ $json.message.voice.file_id }}",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        816,
        144
      ],
      "id": "a1716da9-355f-4e2d-9b2e-87ef7f43e459",
      "name": "Get File (Voice)",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "method": "POST",
        "url": "{{SARVAM_ENDPOINT}}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "api-subscription-key",
              "value": "{{SARVAM_API_KEY}}"
            }
          ]
        },
        "sendBody": true,
        "contentType": "multipart-form-data",
        "bodyParameters": {
          "parameters": [
            {
              "name": "model",
              "value": "saarika:v2.5"
            },
            {
              "name": "language_code",
              "value": "en-IN"
            },
            {
              "parameterType": "formBinaryData",
              "name": "file",
              "inputDataFieldName": "=data"
            }
          ]
        },
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1040,
        144
      ],
      "id": "8d6576eb-216e-469a-9813-785a13cbe25a",
      "name": "Sarvam STT"
    },
    {
      "parameters": {
        "jsCode": "const msg = $input.item.json;\nif (msg.text && !msg.transcript) msg.transcript = msg.text;\nreturn [{ json: msg }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1264,
        144
      ],
      "id": "912af435-aa73-4ae9-a8da-88bd9523316c",
      "name": "Set Transcript"
    },
    {
      "parameters": {
        "jsCode": "const msg = $input.item.json;\nconst unified_text = (msg.transcript || msg.message?.text || '').trim();\nreturn [{ json: {\n  ...msg,\n  chat_id: msg.message?.chat?.id ?? msg.chat_id ?? 'unknown',\n  user_id: msg.message?.from?.id ?? msg.user_id ?? 'unknown',\n  first_name: msg.message?.from?.first_name ?? null,\n  unified_text,\n} }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1504,
        400
      ],
      "id": "c977d2d5-c3e9-49c2-b2fc-d98ee07d6182",
      "name": "Build Unified Text"
    },
    {
      "parameters": {
        "model": "anthropic.claude-3-5-sonnet-20241022-v2:0",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAwsBedrock",
      "typeVersion": 1.1,
      "position": [
        -144,
        1072
      ],
      "id": "b2cf5558-6a55-46cd-b980-1f50f79f653c",
      "name": "AWS Bedrock (Classifier)",
      "credentials": {
        "aws": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.unified_text }}",
        "options": {
          "systemMessage": "You are a strict intent classifier for a Telegram expense bot. Classify exactly one message into one of: INGEST, QUERY, or UNKNOWN.\\n\\nDEFINITIONS:\\n- INGEST: User is recording a personal expense they made (mentions amount/currency/merchant/time/payment etc.).\\n- QUERY: User asks about past expenses, totals, trends, merchants, date ranges, top N, comparisons.\\n- UNKNOWN: Anything else.\\n\\nOUTPUT FORMAT (JSON only):\\n{\"intent\":\"INGEST|QUERY|UNKNOWN\",\"confidence\":0.0-1.0,\"reason\":\"short phrase\",\"entities\":{\"amount\":[],\"currency\":[],\"payment\":[],\"merchants\":[],\"dates\":[]}}\\n\\nGUIDANCE:\\n- Prefer INGEST if the message clearly records a new spend.\\n- Prefer QUERY if it asks to search/analyze previous data.\\n- Use UNKNOWN if ambiguous.\\n- Be conservative with confidence for vague texts."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        -96,
        864
      ],
      "id": "0930a81c-af94-4438-a596-9d46e1d8d205",
      "name": "Classifier Agent (LLM)",
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "jsCode": "const raw = $input.item.json.output;\nfunction extractFirstJsonObject(str){\n  const s = str.indexOf('{'); if(s===-1) throw new Error('No JSON found');\n  let d=0; for(let i=s;i<str.length;i++){ const c=str[i]; if(c==='{' ) d++; else if(c==='}'){ d--; if(d===0) return str.slice(s,i+1);} }\n  throw new Error('Unbalanced JSON');\n}\nlet intent='UNKNOWN', confidence=0, reason='';\ntry{\n  const text = extractFirstJsonObject(raw);\n  const obj = JSON.parse(text);\n  intent = (obj.intent||'').toUpperCase();\n  confidence = Number(obj.confidence)||0;\n  reason = obj.reason||'';\n  if(!['INGEST','QUERY','UNKNOWN'].includes(intent)) intent='UNKNOWN';\n} catch(e){ intent='UNKNOWN'; confidence=0; reason='parse_error'; }\nreturn [{ json: { ...$input.item.json, intent, confidence, classify_reason: reason } }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        240,
        864
      ],
      "id": "ef3ad348-0a02-4bf8-803c-33f956880e3d",
      "name": "Parse Classifier JSON"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "I couldn't tell if you want to add an expense or ask a question. Reply with either:\n\u2022 \"add expense: <your text>\"\n\u2022 \"ask: <your question>\"",
        "additionalFields": {}
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        640,
        688
      ],
      "id": "ef499365-f2e9-46da-8ed4-9963d980cd71",
      "name": "Ask Clarification",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "leftValue": "={{ $json.intent }}",
              "rightValue": "INGEST",
              "operator": {
                "type": "string",
                "operation": "equals"
              },
              "id": "route-intent"
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        800,
        880
      ],
      "id": "cab8fa74-8990-4b01-90ef-ba5068669b6e",
      "name": "Route by Intent"
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $('Build Unified Text').item.json.unified_text }}",
        "options": {
          "systemMessage": "Role:\nYou are a Telegram assistant connected to Elasticsearch via the MCP server. Your job is to turn user questions into precise tool calls and reply with clear, concise answers suitable for chat.\n\nInputs:\nPlain-text user messages from Telegram.\n\nData Sources (choose exactly one per query):\n\nindex - notebook_index_semantic_v1 \u2192 Uber trips (fare, promotions, travel date/time, duration).\n\nindex - {{ES_INDEX}} \u2192 Personal expenses (merchants, items like biryani/burger/fried rice, car rentals; payment methods; categories).\n\nIf the expense data is not available in \"{{ES_INDEX}}\" index, then try \"expenses\" index.\n\nBehavior:\n\nParse intent (examples: totals, time ranges, top-N, categories, merchants, payment methods, receipts/trips).\n\nPick the correct index based on intent:\n\nUber trip info \u2192 notebook_index_semantic_v1\n\nGeneral/personal spend \u2192 expenses\n\nPrefer structured queries (ES|QL or equivalent MCP tools) over vague responses.\n\nReturn curated answers:\n\nA one-paragraph summary in natural language.\n\nThen a compact numbers/table block if helpful (totals, counts, top-N, date, merchant, amount).\n\nHide internals: Do not expose URLs, tokens, raw JSON, or query payloads unless the user explicitly asks for them.\n\nDate & Time Handling (VERY IMPORTANT):\n\nTimezone: Asia/Kolkata.\n\nRelative dates:\n\n\u201ctoday\u201d, \u201cyesterday\u201d, \u201cday before yesterday\u201d \u2192 resolve to their calendar dates in Asia/Kolkata.\n\nYear rule: Unless the user explicitly specifies another year, interpret all relative-date queries as referring to the year 2025.\n\nExample: On any day, \u201cyesterday\u201d \u2192 yesterday\u2019s date in 2025, not 2024/2023.\n\nIf the user says a different year (e.g., \u201cyesterday in 2024\u201d), honor that year.\n\nIf the user provides explicit dates, use them as-is (dd-mm-yyyy or yyyy-mm-dd; be tolerant).\n\nTone:\nProfessional, clear, and direct. Short enough for a chat interface.\n\nConstraints / Fallback:\n\nIf a query can\u2019t be answered from Elasticsearch, reply:\n\u201cI wasn\u2019t able to find that in Elasticsearch. Can you rephrase or provide more details?\u201d\n\nIf intent or dates are ambiguous, make the best safe assumption per rules above and proceed.\n\nOutput Format:\n\n1\u20133 concise sentences summarizing the result.\n\nOptional small table for top-N or breakdowns (date, merchant/category, count/amount).\n\nCurrency: preserve stored currency fields; if mixed, state totals per currency.\n\nExamples (Intent \u2192 Index \u2192 Action \u2192 Answer style):\n\n\u201cTotal Uber spend last month?\u201d\n\u2192 notebook_index_semantic_v1 \u2192 ES|QL sum(total_fare) over last month (in 2025 unless year specified).\n\u2192 \u201cYour Uber spend for September 2025 was \u20b97,840 across 12 trips.\u201d\n\n\u201cShow my food expenses yesterday.\u201d\n\u2192 expenses (category = food) \u2192 filter date = yesterday (Asia/Kolkata) in 2025.\n\u2192 \u201cYou had 3 food expenses yesterday (2025-10-09) totaling \u20b91,120.\u201d + 3-row table.\n\n\u201cTop 5 merchants this week by amount.\u201d\n\u2192 expenses \u2192 group by merchant, sum(amount), order desc, limit 5.\n\u2192 \u201cTop merchants this week (2025): \u2026\u201d + small table.\n\n\u201cLongest Uber trip in August?\u201d\n\u2192 notebook_index_semantic_v1 \u2192 filter Aug 2025, order by duration desc, limit 1.\n\u2192 \u201cYour longest August 2025 trip was 48m on 2025-08-17 (\u20b9420 after \u20b930 promo).\u201d\n\nDisallowed to reveal unless asked:\n\nRaw ES|QL/MCP payloads, index schemas, hostnames, tokens.\n\nSuccess Criterion:\nEach reply picks the right index, uses structured queries, resolves dates per the 2025 rule, and returns a crisp, human summary with numbers/tables when useful."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1088,
        1088
      ],
      "id": "c3a045a7-5839-4159-91d7-966086a2c6f8",
      "name": "AI Agent (Query)",
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "model": "anthropic.claude-3-5-sonnet-20241022-v2:0",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAwsBedrock",
      "typeVersion": 1.1,
      "position": [
        1040,
        1248
      ],
      "id": "3a8555c0-5302-4d89-8450-a505efe7dac8",
      "name": "AWS Bedrock Chat Model",
      "credentials": {
        "aws": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "endpointUrl": "{{ES_MCP_URL}}",
        "serverTransport": "httpStreamable",
        "authentication": "headerAuth",
        "options": {
          "timeout": 60000
        }
      },
      "type": "@n8n/n8n-nodes-langchain.mcpClientTool",
      "typeVersion": 1.1,
      "position": [
        1296,
        1264
      ],
      "id": "51540921-ff04-4b22-8d7c-9783523d4a49",
      "name": "MCP Client",
      "notesInFlow": true,
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "={{ $json.output }}",
        "additionalFields": {
          "appendAttribution": false,
          "parse_mode": "HTML"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1456,
        1088
      ],
      "id": "262c734c-3591-43a4-9ae4-3d14f4fada48",
      "name": "Send a text message (Query)",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "promptType": "define",
        "text": "={{ $json.chat_id }}{{ $json.user_id }}{{ $json.first_name }}{{ $json.unified_text }}{{ $('Build Unified Text').item.json.unified_text }}",
        "options": {
          "systemMessage": "You extract daily expense details from a Telegram message and return exactly ONE valid JSON object (no code fences). Fields: chat_id, user_id, ts (ISO 8601), amount (number), currency (ISO 4217), normalized_inr (number if INR else omit), merchant, category (food,grocery,transport,fuel,shopping,utilities,rent,entertainment,health,travel,education,fees,subscriptions,other), payment_method (upi,credit_card,debit_card,card,cash,net_banking,wallet,cod,unknown), note, raw_transcript, segments[]. Rules: Use Asia/Kolkata now if time not provided; interpret today/yesterday as 2025. Detect \u20b9\u2192INR. Normalize GPay\u2192upi. Do not invent values; omit unknowns. Output only one clean JSON object."
        }
      },
      "type": "@n8n/n8n-nodes-langchain.agent",
      "typeVersion": 2.2,
      "position": [
        1088,
        688
      ],
      "id": "5068c593-fa13-4ce9-86bc-279db56f58cc",
      "name": "Ingestion Agent",
      "onError": "continueRegularOutput"
    },
    {
      "parameters": {
        "jsCode": "const raw = $input.all()[0]?.json?.output;\nfunction extractFirstJsonObject(str){\n  const start = str.indexOf('{');\n  if(start===-1) throw new Error(\"No '{' found\");\n  let depth=0;\n  for(let i=start;i<str.length;i++){\n    const ch=str[i];\n    if(ch==='{' ) depth++;\n    else if(ch==='}'){\n      depth--;\n      if(depth===0) return str.slice(start,i+1);\n    }\n  }\n  throw new Error('Unbalanced braces');\n}\nconst text = extractFirstJsonObject(raw).trim();\nlet doc;\ntry { doc = JSON.parse(text); } catch { throw new Error('Invalid JSON from model'); }\nreturn [{ json: doc }];"
      },
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        1376,
        688
      ],
      "id": "d0bc90fa-6623-4349-a9d2-477d74cde288",
      "name": "Extract JSON"
    },
    {
      "parameters": {
        "method": "PUT",
        "url": "= {{ES_HTTP_BASE}}/{{ES_INDEX}}/_create/{{ $('Telegram Trigger').item.json.message.message_id }}",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "Authorization",
              "value": "ApiKey {{ES_API_KEY}}"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"ts\": \"{{ $json.ts }}\",\n  \"amount\": \"{{ $json.amount }}\",\n  \"currency\": \"{{ $json.currency }}\",\n  \"normalized_inr\": \"{{ $json.normalized_inr || 0 }}\",\n  \"merchant\": \"{{ $json.merchant }}\",\n  \"category\": \"{{ $json.category }}\",\n  \"payment_method\": \"{{ $json.payment_method }}\",\n  \"note\": \"{{ $json.note }}\",\n  \"raw_transcript\": \"{{ $json.raw_transcript }}\",\n  \"@timestamp\" : \"{{ new Date($json.ts).toISOString() }}\"\n}",
        "options": {}
      },
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        1568,
        688
      ],
      "id": "b76c0efb-9ff8-42d8-b5e6-c622a8eb9bda",
      "name": "Index in Elasticsearch"
    },
    {
      "parameters": {
        "chatId": "={{ $('Telegram Trigger').item.json.message.chat.id }}",
        "text": "=Added Expense:\nPaid {{ $('Extract JSON').item.json.currency }} {{ $('Extract JSON').item.json.amount }} via {{ $('Extract JSON').item.json.payment_method }} on spend {{ $('Extract JSON').item.json.note }}\n",
        "additionalFields": {
          "appendAttribution": false,
          "parse_mode": "HTML"
        }
      },
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1.2,
      "position": [
        1776,
        688
      ],
      "id": "dfa97604-72a3-4799-a1eb-4c8caddc685d",
      "name": "Ack (Ingestion)",
      "credentials": {
        "telegramApi": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "model": "anthropic.claude-3-5-sonnet-20241022-v2:0",
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.lmChatAwsBedrock",
      "typeVersion": 1.1,
      "position": [
        1056,
        864
      ],
      "id": "064044d5-7d46-4b68-a81f-57dde771716f",
      "name": "AWS Bedrock Chat Model1",
      "credentials": {
        "aws": {
          "name": "<your credential>"
        }
      }
    },
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.3,
      "position": [
        0,
        0
      ],
      "id": "9f8015b3-f83e-4418-abba-e6def3561813",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "content": "Intent Classifier",
        "height": 384,
        "width": 400,
        "color": 6
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        -208,
        848
      ],
      "typeVersion": 1,
      "id": "34151664-254e-4d14-b8ba-5e0a7e2d2d59",
      "name": "Sticky Note"
    },
    {
      "parameters": {
        "content": "Query Flow",
        "height": 320,
        "width": 672
      },
      "type": "n8n-nodes-base.stickyNote",
      "position": [
        992,
        1040
      ],
      "typeVersion": 1,
      "id": "e87e8644-235b-49b1-b53a-e8d5dbea68b8",
      "name": "Sticky Note2"
    },
    {
      "parameters": {
        "conditions": {
          "options": {
            "caseSensitive": true,
            "leftValue": "",
            "typeValidation": "strict",
            "version": 2
          },
          "conditions": [
            {
              "id": "07ecae80-fca2-4d48-b46c-7a9d07a61bb6",
              "leftValue": "={{ $('Parse Classifier JSON').item.json.confidence }}",
              "rightValue": 0.5,
              "operator": {
                "type": "number",
                "operation": "lt"
              }
            }
          ],
          "combinator": "and"
        },
        "options": {}
      },
      "type": "n8n-nodes-base.if",
      "typeVersion": 2.2,
      "position": [
        448,
        864
      ],
      "id": "e2caded4-5aba-43e9-b781-fd148695b97d",
      "name": "Low Confidence Gates?"
    },
    {
      "parameters": {
        "errorMessage": "Sorry did not find out"
      },
      "type": "n8n-nodes-base.stopAndError",
      "typeVersion": 1,
      "position": [
        784,
        688
      ],
      "id": "b5ef68f5-08d3-4f81-8bdb-b07d553a2f52",
      "name": "Stop and Error"
    }
  ],
  "connections": {
    "Telegram Trigger": {
      "main": [
        [
          {
            "node": "Allowed User?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Allowed User?": {
      "main": [
        [
          {
            "node": "Voice or Text?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Voice or Text?": {
      "main": [
        [
          {
            "node": "Get File (Voice)",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Build Unified Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Get File (Voice)": {
      "main": [
        [
          {
            "node": "Sarvam STT",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Sarvam STT": {
      "main": [
        [
          {
            "node": "Set Transcript",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Set Transcript": {
      "main": [
        [
          {
            "node": "Build Unified Text",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Build Unified Text": {
      "main": [
        [
          {
            "node": "Classifier Agent (LLM)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AWS Bedrock (Classifier)": {
      "ai_languageModel": [
        [
          {
            "node": "Classifier Agent (LLM)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Classifier Agent (LLM)": {
      "main": [
        [
          {
            "node": "Parse Classifier JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Parse Classifier JSON": {
      "main": [
        [
          {
            "node": "Low Confidence Gates?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Ask Clarification": {
      "main": [
        [
          {
            "node": "Stop and Error",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Route by Intent": {
      "main": [
        [
          {
            "node": "Ingestion Agent",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "AI Agent (Query)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AI Agent (Query)": {
      "main": [
        [
          {
            "node": "Send a text message (Query)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AWS Bedrock Chat Model": {
      "ai_languageModel": [
        [
          {
            "node": "AI Agent (Query)",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "MCP Client": {
      "ai_tool": [
        [
          {
            "node": "AI Agent (Query)",
            "type": "ai_tool",
            "index": 0
          }
        ]
      ]
    },
    "Ingestion Agent": {
      "main": [
        [
          {
            "node": "Extract JSON",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Extract JSON": {
      "main": [
        [
          {
            "node": "Index in Elasticsearch",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Index in Elasticsearch": {
      "main": [
        [
          {
            "node": "Ack (Ingestion)",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "AWS Bedrock Chat Model1": {
      "ai_languageModel": [
        [
          {
            "node": "Ingestion Agent",
            "type": "ai_languageModel",
            "index": 0
          }
        ]
      ]
    },
    "Low Confidence Gates?": {
      "main": [
        [
          {
            "node": "Ask Clarification",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "Route by Intent",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "meta": {
    "templateCredsSetupCompleted": true
  }
}
Pro

For the full experience including quality scoring and batch install features for each workflow upgrade to Pro

About this workflow

N8N Workflow. Uses executeCommand, localFileTrigger. Event-driven trigger; 7 nodes.

Source: https://github.com/shra1-cmd/claraai_assgn/blob/539dfe9331fed3be933867b0bd243ad9c84450fd/workflows/n8n_workflow.json — original creator credit. Request a take-down →

More General workflows → · Browse all categories →

Related workflows

Workflows that share integrations, category, or trigger type with this one. All free to copy and import.

General

N8N Workflow. Uses localFileTrigger, executeCommand, readWriteFile. Event-driven trigger; 16 nodes.

Local File Trigger, Execute Command, Read Write File
General

eco-gdrive-uploads-v1. Uses localFileTrigger, readBinaryFiles, googleDrive, executeCommand. Event-driven trigger; 5 nodes.

Local File Trigger, Read Binary Files, Google Drive +1
General

Executecommand Localfile. Uses localFileTrigger, executeCommand, lmChatMistralCloud, outputParserStructured. Event-driven trigger; 16 nodes.

Local File Trigger, Execute Command, Lm Chat Mistral Cloud +2
General

company manager. Uses localFileTrigger, readWriteFile, @packitoo/n8n-nodes-hipe. Event-driven trigger; 9 nodes.

Local File Trigger, Read Write File, @Packitoo/N8N Nodes Hipe
General

project manager. Uses localFileTrigger, readWriteFile, @packitoo/n8n-nodes-hipe. Event-driven trigger; 9 nodes.

Local File Trigger, Read Write File, @Packitoo/N8N Nodes Hipe