AutomationFlowsWeb Scraping › Codex Cli Webhook Chat

Codex Cli Webhook Chat

Codex CLI Webhook Chat. Uses chatTrigger, httpRequest. Chat trigger; 3 nodes.

Chat trigger trigger★★★★☆ complexityAI-powered3 nodesChat TriggerHTTP Request
Web Scraping Trigger: Chat trigger Nodes: 3 Complexity: ★★★★☆ AI nodes: yes Added:

This workflow follows the Chat Trigger → HTTP Request 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": "Codex CLI Webhook Chat",
  "nodes": [
    {
      "parameters": {
        "options": {}
      },
      "type": "@n8n/n8n-nodes-langchain.chatTrigger",
      "typeVersion": 1.4,
      "position": [
        0,
        300
      ],
      "id": "chat-trigger-1",
      "name": "When chat message received"
    },
    {
      "parameters": {
        "method": "POST",
        "url": "https://example.com/codex",
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "content-type",
              "value": "application/json"
            }
          ]
        },
        "sendBody": true,
        "specifyBody": "json",
        "jsonBody": "={\n  \"prompt\": \"{{$json.chatInput}}\"\n}",
        "options": {
          "timeout": 600000
        }
      },
      "id": "http-1",
      "name": "Send Message to AI Endpoint",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.4,
      "position": [
        320,
        300
      ]
    },
    {
      "parameters": {
        "jsCode": "return items.map(({ json }) => {\n  const raw = String(json.data ?? json.ndjson ?? json.body ?? '');\n  const normalized = raw.replace(/\\\\n/g, '\\n');\n  let answer = '';\n\n  for (const line of normalized.split(/\\r?\\n/)) {\n    try {\n      const event = JSON.parse(line.trim());\n      if (event.type === 'item.completed' && event.item?.type === 'agent_message') {\n        answer = event.item.text;\n        break;\n      }\n    } catch {}\n  }\n\n  if (!answer) {\n    const matches = [...raw.matchAll(/\\\"type\\\":\\\"agent_message\\\",\\\"text\\\":\\\"((?:\\\\.|[^\\\"\\\\])*)\\\"/g)];\n    if (matches.length) answer = JSON.parse(`\\\"${matches.at(-1)[1]}\\\"`);\n  }\n\n  if (!answer) throw new Error('No agent answer found.');\n  return { json: { output: answer } };\n});"
      },
      "id": "code-1",
      "name": "Extract Agent Answer",
      "type": "n8n-nodes-base.code",
      "typeVersion": 2,
      "position": [
        640,
        300
      ]
    }
  ],
  "connections": {
    "When chat message received": {
      "main": [
        [
          {
            "node": "Send Message to AI Endpoint",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "Send Message to AI Endpoint": {
      "main": [
        [
          {
            "node": "Extract Agent Answer",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  },
  "settings": {
    "executionOrder": "v1"
  },
  "meta": {
    "templateCredsSetupCompleted": false
  }
}
Pro

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

About this workflow

Codex CLI Webhook Chat. Uses chatTrigger, httpRequest. Chat trigger; 3 nodes.

Source: https://github.com/mobizmad/n8n-workflow-templates/blob/main/chatbots/codex-cli-webhook-chat/workflow.json — original creator credit. Request a take-down →

More Web Scraping workflows → · Browse all categories →

Related workflows

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

Web Scraping

Analyze up to 100 URLs in one run and export key on-page SEO data to CSV automatically.

HTTP Request, Chat Trigger, Item Lists +1
Web Scraping

N8N Chain Translation. Uses httpRequest, chatTrigger, n8n-nodes-docx-extractor. Chat trigger; 31 nodes.

HTTP Request, Chat Trigger, N8N Nodes Docx Extractor
Web Scraping

o1 - mini. Uses redis, httpRequest, chatTrigger. Chat trigger; 26 nodes.

Redis, HTTP Request, Chat Trigger
Web Scraping

pfe-hunter-sophistique. Uses lmChatGroq, chatTrigger, chainLlm, httpRequest. Chat trigger; 24 nodes.

Groq Chat, Chat Trigger, Chain Llm +1
Web Scraping

o1 - groq. Uses redis, httpRequest, chatTrigger. Chat trigger; 22 nodes.

Redis, HTTP Request, Chat Trigger