Skip to main content

OpenAI responses API adapter for LLM and AI agent workflows

Workflow preview

Workflow preview
100%
OpenAI responses API adapter for LLM and AI agent workflows preview
Open on n8n.io

Important notice

This workflow is provided as-is. Please review and test before using in production.

1. Workflow Overview

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...

Best for

  • Engineering automation workflows
  • AI Chatbot automation workflows
  • advanced n8n builders looking for reusable templates

Tools used

@n8n/n8n-nodes-langchain.chattrigger, @n8n/n8n-nodes-langchain.agent, n8n-nodes-base.webhook, n8n-nodes-base.httprequest, n8n-nodes-base.respondtowebhook, n8n-nodes-base.code, n8n-nodes-base.if, @n8n/n8n-nodes-langchain.lmchatopenai

Source and attribution

This workflow is cataloged by N8N Workflows and links back to its original n8n.io source page by Jimleuk.

Original n8n.io source

1.1 Workflow description

Title
OpenAI responses API adapter for LLM and AI agent workflows
Workflow name
OpenAI responses API adapter for LLM and AI agent workflows

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 your existing AI workflows then this template is sure to satisfy!

This approach implements a simple API wrapper for the Responses API using n8n's builtin webhooks. When the base url is pointed to these webhooks using a custom OpenAI credential, it's possible to intercept the request and remap for compatibility.

How it works

  • An OpenAI subnode is attached to our agent but has a special custom credential where the base_url is changed to point at this template's webhooks.
  • When executing a query, the agent's request is forwarded to our mini chat completion workflow.
  • Here, we take the default request and remap the values to use with a HTTP node which is set to query the Responses API.
  • Once a response is received, we'll need to remap the output for Langchain compatibility. This just means the LLM or Agent node can parse it and respond to the user.
  • There are two response formats, one for streaming and one for non-streaming responses.

How to use

  • You must activate this workflow to be able to use the webhooks.
  • Create the custom OpenAI credential as instructed.
  • Go to your existing AI workflows and replace the LLM node with the custom OpenAI credential. You do not need to copy anything else over to the existing template.

Requirements

  • OpenAI account for Responses API

Customising this workflow

  • Feel free to experiment with other LLMs using this same technique!
  • Keep up to date with the Responses API announcements and make modifications as required.

1.2 Logical Blocks

This catalog entry is organized from the workflow JSON. The node-level section below shows the executable blocks available for review before importing the template.

2. Block-by-Block Analysis

Block 1 - When chat message received

Type / Role
@n8n/n8n-nodes-langchain.chatTrigger - chatTrigger
Config choices
Version 1.1

Block 2 - AI Agent

Type / Role
@n8n/n8n-nodes-langchain.agent - agent
Config choices
Version 1.9

Block 3 - Webhook

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 4 - OpenAI Models

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 5 - POST ChatCompletions

Type / Role
n8n-nodes-base.webhook - webhook
Config choices
Version 2

Block 6 - Models Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

Block 7 - Remap to Response API Schema

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 8 - OpenAI Responses API

Type / Role
n8n-nodes-base.httpRequest - httpRequest
Config choices
Version 4.2

Block 9 - Is Agent?

Type / Role
n8n-nodes-base.if - if
Config choices
Version 2.2

Block 10 - n8n Webhook

Type / Role
@n8n/n8n-nodes-langchain.lmChatOpenAi - lmChatOpenAi
Config choices
Version 1.2

Block 11 - Sticky Note1

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 12 - Sticky Note

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 13 - Sticky Note2

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 14 - Format Completion Response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 15 - JSON Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

Block 16 - Text Response

Type / Role
n8n-nodes-base.respondToWebhook - respondToWebhook
Config choices
Version 1.2

Block 17 - Sticky Note3

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

Block 18 - Format Stream Response

Type / Role
n8n-nodes-base.code - code
Config choices
Version 2

Block 19 - Sticky Note4

Type / Role
n8n-nodes-base.stickyNote - stickyNote
Config choices
Version 1

3. Summary Table

Workflow OpenAI responses API adapter for LLM and AI agent workflows
Complexity advanced
Nodes 19
Categories Engineering, AI Chatbot
Author Jimleuk
Published 19 May 2025

4. Reproducing the Workflow from Scratch

  1. 1. Download the workflow JSON

    Use the JSON export at /data/workflows/4218/4218.json as the source template for this automation.

  2. 2. Import the template into n8n

    Open n8n, import the downloaded JSON, and review each node before activating the workflow.

  3. 3. Configure credentials and variables

    Replace placeholder credentials, API keys, webhook URLs, account IDs, and environment-specific values with your own settings.

  4. 4. Test with sample data

    Run the workflow manually or in a staging workspace, inspect node output, and confirm downstream systems receive the expected data.

  5. 5. Activate and monitor

    Enable the workflow only after testing, then monitor executions, errors, and rate limits during the first production runs.

5. General Notes & Resources

Review imported nodes carefully before activation. This catalog entry is intended to help you inspect the workflow structure, understand required services, and find related templates faster.

Node names, credentials, schedules, webhook paths, and external service limits may need adjustment for your workspace.

Frequently asked questions

What does OpenAI responses API adapter for LLM and AI agent workflows do?

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...

What do I need before importing this workflow?

Review the workflow JSON, configure any required credentials in n8n, and test the automation in a safe workspace before using it in production.

Can I customize this workflow?

Yes. Use the block-by-block analysis and the downloadable JSON to inspect each node, then adjust credentials, prompts, schedules, filters, or destinations for your Engineering, AI Chatbot use case.