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 →
{
"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
}
}
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 →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Analyze up to 100 URLs in one run and export key on-page SEO data to CSV automatically.
N8N Chain Translation. Uses httpRequest, chatTrigger, n8n-nodes-docx-extractor. Chat trigger; 31 nodes.
o1 - mini. Uses redis, httpRequest, chatTrigger. Chat trigger; 26 nodes.
pfe-hunter-sophistique. Uses lmChatGroq, chatTrigger, chainLlm, httpRequest. Chat trigger; 24 nodes.
o1 - groq. Uses redis, httpRequest, chatTrigger. Chat trigger; 22 nodes.