AutomationFlowsAI & RAG › Trustfield Agentic Reply Catcher

Trustfield Agentic Reply Catcher

TrustField Agentic Reply Catcher. Uses telegram, httpRequest. Webhook trigger; 5 nodes.

Webhook trigger★★★★☆ complexity5 nodesTelegramHTTP Request
AI & RAG Trigger: Webhook Nodes: 5 Complexity: ★★★★☆ Added:

This workflow follows the HTTP Request → Telegram recipe pattern — see all workflows that pair these two integrations.

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
{
  "name": "TrustField Agentic Reply Catcher",
  "nodes": [
    {
      "parameters": {
        "httpMethod": "POST",
        "path": "agentic-reply",
        "responseMode": "onReceived"
      },
      "id": "webhook",
      "name": "Resend Inbound Webhook",
      "type": "n8n-nodes-base.webhook",
      "typeVersion": 2,
      "position": [
        240,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "const body = $input.first().json.body || $input.first().json;\nconst text = (body.text || body.html || '').toLowerCase();\nlet label = 'objection';\nif (/unsubscribe|remove me|opt out/.test(text)) label = 'unsubscribe';\nelse if (/out of office|ooo/.test(text)) label = 'ooo';\nelse if (/wrong person|not the right/.test(text)) label = 'wrong_person';\nelse if (/interested|let's talk|schedule|demo/.test(text)) label = 'interested';\nreturn [{ json: { label, from: body.from, subject: body.subject, snippet: text.slice(0, 200) } }];"
      },
      "id": "classify",
      "name": "Classify Reply",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        480,
        300
      ]
    },
    {
      "parameters": {
        "conditions": {
          "string": [
            {
              "value1": "={{$json.label}}",
              "operation": "equals",
              "value2": "interested"
            }
          ]
        }
      },
      "id": "if_interested",
      "name": "Interested?",
      "type": "n8n-nodes-base.if",
      "typeVersion": 2,
      "position": [
        720,
        300
      ]
    },
    {
      "parameters": {
        "chatId": "={{$env.TELEGRAM_CHANNEL_ID}}",
        "text": "=Agentic reply INTERESTED from {{$json.from}}\n{{$json.snippet}}"
      },
      "id": "telegram_alert",
      "name": "Telegram Alert",
      "type": "n8n-nodes-base.telegram",
      "typeVersion": 1,
      "position": [
        960,
        200
      ]
    },
    {
      "parameters": {
        "method": "POST",
        "url": "={{$env.TRUSTFIELD_API_URL}}/api/admin/agentic/reply-inbound",
        "sendBody": true,
        "bodyParameters": {
          "parameters": [
            {
              "name": "company",
              "value": "={{$json.company}}"
            },
            {
              "name": "classification",
              "value": "={{$json.label}}"
            },
            {
              "name": "reply_ref",
              "value": "=reply:{{$json.message_id}}"
            },
            {
              "name": "from_email",
              "value": "={{$json.from}}"
            }
          ]
        }
      },
      "id": "api_log",
      "name": "Log Reply API",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4,
      "position": [
        960,
        400
      ],
      "credentials": {
        "httpHeaderAuth": {
          "name": "<your credential>"
        }
      }
    }
  ],
  "connections": {
    "Resend Inbound Webhook": {
      "main": [
        [
          {
            "node": "Classify Reply",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Classify Reply": {
      "main": [
        [
          {
            "node": "Log Reply API",
            "type": "main",
            "index": 0
          },
          {
            "node": "Interested?",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Interested?": {
      "main": [
        [
          {
            "node": "Telegram Alert",
            "type": "main",
            "index": 0
          }
        ],
        []
      ]
    }
  },
  "meta": {
    "description": "Wire Resend inbound to webhook. Manual reply log: ./scripts/outreach_mark_replied.sh"
  }
}

Credentials you'll need

Each integration node will prompt for credentials when you import. We strip credential IDs before publishing — you'll add your own.

Pro

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

About this workflow

TrustField Agentic Reply Catcher. Uses telegram, httpRequest. Webhook trigger; 5 nodes.

Source: https://gist.github.com/kazemnezhadsina144-dot/7c4826fbe2e149d75abc832b5a0b3d0f — original creator credit. Request a take-down →

More AI & RAG workflows → · Browse all categories →

Related workflows

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

AI & RAG

🤖 Telegram Messaging Agent for Text/Audio/Images. Uses telegram, httpRequest. Webhook trigger; 39 nodes.

Telegram, HTTP Request
AI & RAG

AI Phone Agent with RetellAI. Uses telegram, googleCalendar, httpRequest, googleDrive. Webhook trigger; 36 nodes.

Telegram, Google Calendar, HTTP Request +1
AI & RAG

Trato Hecho - Chat Agent. Uses httpRequest, telegram, gmail. Webhook trigger; 26 nodes.

HTTP Request, Telegram, Gmail
AI & RAG

Trato Hecho - Chat Agent. Uses httpRequest, telegram, gmail. Webhook trigger; 26 nodes.

HTTP Request, Telegram, Gmail
AI & RAG

Local AI Agent (HTTP-based). Uses telegram, httpRequest. Webhook trigger; 24 nodes.

Telegram, HTTP Request