Skip to content
FlowHubFluxonLab
A
AI Automationfree

Allow your AI to call an API to fetch data

by Deborahadapted from n8n official workflow galleryUpdated Aug 2026
RequiresAAI AgentAuto-fixing Output ParserAuto-fixing Output ParserBBasic LLM ChainCall n8n Workflow ToolCall n8n Workflow ToolHTTP RequestHTTP RequestOpenAI Chat ModelOpenAI Chat ModelSSimple MemoryStructured Output ParserStructured Output Parser
Share Post Share
ChWhen chat message receivedWhen chat messa…OpenAI Chat ModelOpenAI Chat Mod…MBSimple MemoryEWWhen Executed by Another WorkflowWhen Executed b…OpenAI Chat Model1OpenAI Chat Mod…IEWork out activity type and number of people1Work out activi…HRCall the APITWActivity ToolSeSet 'response' valueSet 'response' …AgCombineAgAI Agent1234
1/5
FLOWS
STEPS · 4
Starts from a chat message

Use n8n to bring data from any API to your AI. This workflow uses the Chat Trigger to provide the chat interface, and the Custom n8n Workflow Tool to call a second workflow that calls the API. The second workflow uses AI functionality to refine the API request based on the user's query. It then makes an API call, and returns the response to the main workflow. This workflow is used in Advanced AI examples | Call an API to fetch data in the documentation. To use this workflow: Load it into your n8n instance. Add your credentials as prompted by the notes.

Tags

n8nreference-onlyagentchain-llmlm-chat-open-aimemory-buffer-windowoutput-parser-autofixingoutput-parser-structuredtool-workflow
Connects
AAI AgentautofixingoutputparserAuto-fixing Output ParserBBasic LLM Chaincalln8nworkflowtoolCall n8n Workflow ToolWHTTP RequestopenaichatmodelOpenAI Chat Model
CategoryAI Automation
Triggermanual
Complexitycomplex
Nodes11
AddedFeb 14, 2024

Related workflows

See all AI Automation
autofixingoutputparserBopenaichatmodelstructuredoutputparser
free

Force AI to use a specific output format

This workflow is for anyone looking to automatically fetch, validate, and parse complex language-based queries into a structured format. Its unique capability lies in not only processing language but also fixing invalid outputs before structuring them. Note that to use this template, you need to be on n8n version 1.19.4 or later.

by n8n Team
BCWopenaichatmodel
free

Audit landing page CRO and log results with OpenAI and Data Tables

Quick overview This workflow collects a landing page URL, scrapes its HTML, and uses OpenAI to generate a structured conversion-rate-optimization (CRO) audit with scores and prioritized tips, then renders a styled report in the browser and logs each audit to an n8n Data Table. How it works Presents an n8n Form where the user submits a landing page URL. Fetches the landing page HTML via an HTTP request with retries, and routes to an error page if the URL can’t be retrieved. Sends the scraped HTML and URL to OpenAI to produce a CRO audit including an overall score, category scores, a written roast, and a ranked list of optimization tips. Uses a structured output parser with an OpenAI “fixer” model to validate and auto-correct the AI response into the required JSON schema. Builds a styled HTML report from the structured audit results. Logs the audit metadata (URL, score, verdict, summary, language, timestamp) to an n8n Data Table and displays the report back in the user’s browser. Setup Add an OpenAI API credential and select it for both the main OpenAI model and the output-fixer model. Create or select an n8n Data Table (for example, “CRO Audit Log”) and map the columns used for url,

by Dr. Firas
ACgmailsheets
free

Analyze YouTube comments with OpenAI, Google Sheets, and Gmail

Quick overview This workflow monitors a Google Sheets list of YouTube video IDs, fetches video details and top comments from the YouTube Data API, analyzes the comments with OpenAI into structured sentiment and themes, emails an HTML report via Gmail, and writes the results back to Google Sheets. How it works Triggers every minute when a row in Google Sheets is added or updated. Reads the video ID and status from the row and continues only if the status is set to “Pending”. Calls the YouTube Data API to fetch the video’s metadata and the top comment threads for that video. Flattens the comment threads, calculates basic stats (comment count and average likes), and compiles a limited comment text block for analysis. If comments exist, sends the compiled comments and video title to OpenAI to generate a structured analysis (sentiment score, sentiment breakdown, themes, questions, feedback, insights, and summary). Builds an HTML email report from the structured results, sends it to the configured recipient with Gmail, and updates the Google Sheet row with the analysis fields; if no comments exist, marks the row as “No comments”. Setup Create or duplicate a Google Sheet with at least “Vi

by Dr. Firas