OpenAI responses API adapter for LLM and AI agent workflows
Needs changesWhat this workflow does
This AI workflow has 14 nodes and runs when a chat message arrives (plus 2 other triggers). Along the way it connects OpenAI Chat Model. It also calls api.openai.com over HTTP.
How it runs
Trigger: When a chat message arrives (plus 2 other triggers).
- AI Agent: runs an AI agent, with model: n8n Webhook
- OpenAI Models (HTTP Request): calls api.openai.com
- Remap to Response API Schema (Code): runs custom JavaScript code
- Models Response (Respond to Webhook): sends the response back to the webhook caller
- OpenAI Responses API (HTTP Request): calls api.openai.com (POST)
- Is Agent? (If): checks a condition and branches into true / false
- Format Stream Response (Code): runs custom JavaScript code
- Format Completion Response (Code): runs custom JavaScript code
- Text Response (Respond to Webhook): sends the response back to the webhook caller
- JSON Response (Respond to Webhook): sends the response back to the webhook caller
Services it uses
HTTP calls to: api.openai.com
Before you upgrade to n8n 3.0
1 thing in this workflow is removed in n8n 3.0. Fix it before you upgrade:
- AI Agent v1 (old agent modes) in AI Agent (v1.9): replace with Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent.
| Removed in 3.0 | Replace with |
|---|---|
| AI Agent v1 (old agent modes) AI Agent (v1.9) | Latest AI Agent node (Tools Agent). For SQL Agent, use a Postgres or MySQL tool with a recent AI Agent. |
Nodes used (8)
- Chat Trigger
@n8n/n8n-nodes-langchain.chatTrigger - AI Agent
@n8n/n8n-nodes-langchain.agent - Webhook
n8n-nodes-base.webhook - HTTP Request
n8n-nodes-base.httpRequest - Respond to Webhook
n8n-nodes-base.respondToWebhook - Code
n8n-nodes-base.code - If
n8n-nodes-base.if - OpenAI Chat Model
@n8n/n8n-nodes-langchain.lmChatOpenAi
From the author
This n8n template demonstrates how to use OpenAI's Responses API with existing LLM and AI Agent nodes. Though I would recommend just waiting for official support, if you're impatient and would like a round-about way to integrate OpenAI's responses API into…