OpenAI by Pathfinding icon

OpenAI by Pathfinding

OpenAI Responses API based Agent

OpenAI by Pathfinding

AI-generated

Overview

This node integrates with the OpenAI Responses API to generate AI-driven responses based on user prompts, system instructions, and optional context such as PDF files, images, and web search results. It supports session-based conversations to maintain context across multiple interactions. The node is useful for applications requiring conversational AI, document analysis, image understanding, and real-time web-informed responses, such as chatbots, virtual assistants, and automated research tools.

Use Case Examples

  1. A chatbot that maintains conversation context using session IDs and system prompts.
  2. An AI assistant that references uploaded PDFs and images to answer user queries.
  3. A research tool that performs web searches to provide up-to-date information in responses.

Properties

Name Meaning
Session ID Session ID for the conversation to track context across messages.
Prompt ID Optional prompt ID for OpenAI API to specify a custom prompt handling.
User Prompt The main user input text to which the AI will respond.
System Prompt System instructions sent only on the first message of a conversation to guide the AI's behavior.
PDF Files PDF file IDs to provide document context; can be a single ID, an array, or an expression.
Images Image URLs or file IDs to provide visual context; can be a single value, an array, or an expression.
Options Collection of settings to customize the AI response, including max tokens, model selection, quick response mode, reasoning effort and summary, temperature, and request timeout.
Web Search Options to enable and configure web search capabilities for current information, including domain restrictions, search context size, source inclusion, and user location for localized results.

Output

JSON

  • text - The generated AI response text.
  • model - The AI model used for generating the response.
  • usage - Token usage statistics for the request.
  • pdfCount - Number of PDF files included in the request.
  • imageCount - Number of image files included in the request.
  • timeout - Timeout setting used for the request.
  • quickMode - Indicates if quick response mode was enabled.
  • responseId - Unique identifier of the current AI response.
  • previousResponseId - Identifier of the previous AI response in the session, if any.
  • webSearch - Details of the web search call including status, query, domains, and sources.
  • citations - List of URL citations referenced in the response text.
  • sources - List of sources included when web search sources are enabled.
  • reasoningSummary - Summary of the AI's reasoning process, if requested.
  • fullResponse - The complete raw response object from the OpenAI API.

Dependencies

  • OpenAI API key credential

Troubleshooting

  • Timeout errors may occur if the request takes longer than the configured timeout. Increase the timeout setting or enable Quick Response Mode to reduce processing time.
  • Errors related to API authentication may occur if the OpenAI API key is missing or invalid. Ensure valid credentials are provided.
  • If the node fails with HTTP errors, check the network connectivity and API endpoint URL.
  • Large inputs or complex reasoning with web search enabled may require increasing n8n's EXECUTIONS_TIMEOUT environment variable for longer execution times.
  • Malformed input for PDF or image files (e.g., incorrect IDs or URLs) may cause errors; ensure correct formatting and valid references.

Discussion