← All N8N workflows
AI & researchAgentExecute Workflow TriggerHTTP RequestIfOpenAI Chat Model

Agent with custom HTTP Request

Configured with Agent, Execute Workflow Trigger, HTTP Request, OpenAI Chat Model, and additional nodes. Review the connections and setup before adapting this template.

Workflow preview
TriggerOn new manual ChatMessageManual Chat TriggerAI & modelsOpenAI Chat ModelOpenAI Chat ModelWeb / APIHTTP RequestHTTP RequestTransformExctract HTML BodyEdit FieldsRoutingIs error?IfTransformStringify error messageEdit FieldsTriggerExecute WorkflowTriggerExecute Workflow TriggerTransformRemove extra tagsEdit FieldsTransformSimplify outputEdit FieldsRoutingSimplify?IfTransformQUERY_PARAMSEdit FieldsTransformCONFIGEdit FieldsAI & modelsReAct AI AgentAgentTransformConvert to MarkdownMarkdownTransformSend Page ContentEdit FieldsSubworkflowHTTP_Request_ToolTool Workflow

Node categories in this workflow

  • Trigger
  • AI & models
  • Web / API
  • Transform
  • Routing
  • Subworkflow

Icons describe general node roles, inferred from node types. Inspect the parameters for the configured action.

Drag to pan; use + and − to zoom. Reconstructed from the exported node positions; nothing runs here. Dashed lines represent non-main connections. Full node names and notes appear below.

How it works

The exported workflow contains the following configured nodes. Their connections are shown above; inspect the JSON for the complete logic, expressions, and external actions.

Workflow node names, types, and operations
NodeCategoryTypeOperation
On new manual Chat MessageTriggerManual Chat TriggerSee node parameters
OpenAI Chat ModelAI & modelsOpenAI Chat ModelSee node parameters
HTTP RequestWeb / APIHTTP RequestSee node parameters
Exctract HTML BodyTransformEdit FieldsSee node parameters
Is error?RoutingIfSee node parameters
Stringify error messageTransformEdit FieldsSee node parameters
Execute Workflow TriggerTriggerExecute Workflow TriggerSee node parameters
Remove extra tagsTransformEdit FieldsSee node parameters
Simplify outputTransformEdit FieldsSee node parameters
Simplify?RoutingIfSee node parameters
QUERY_PARAMSTransformEdit FieldsSee node parameters
CONFIGTransformEdit FieldsSee node parameters
ReAct AI AgentAI & modelsAgentSee node parameters
Convert to MarkdownTransformMarkdownSee node parameters
Send Page ContentTransformEdit FieldsSee node parameters
HTTP_Request_ToolSubworkflowTool WorkflowSee node parameters

Setup

  1. Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
  2. Connect your own credentials through n8n’s credential store. Replace REPLACE_WITH_* values with your resource identifiers.
  3. Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
  4. Run with synthetic data and harmless destinations. Enable triggers only after checking the actual outputs.

Requirements

An n8n instance with the listed node types and compatible versions. Service-connected workflows may require accounts, credentials, or paid APIs.

Credential types declared in the source

  • openAiApi

Workflow notes

Simplify output

remove links and image URLs

Send an error message:

Send an error message:

  1. If query param was incorrect, return the instruction. AI Agent should pick up on this and adapt the query on the next iteration.
  2. If the query is OK and an error was during the HTTP Request, then send back the original error message.
Post-processing of the HTML page:

Post-processing of the HTML page:

  1. Keep only content
  2. Remove inline tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments.
  3. In case query parameter method=simplified, replace all page URLs (a href) and IMG (src) with NOURL / NOIMG - this may save up to 20% of the page length
  4. Convert the remaining HTML to Markdown. This step further reduces the length of the page: long HTML tags and styles are eliminated, but the markdown syntax keeps some page structure. This gives much better results compared to just a blank text.
  5. Finally, check the page length. If it's too long, send an "ERROR: PAGE CONTENT TOO LONG" instead of the actual page. Of course, you could split the page content in chunks, but sometimes long pages just don't have a needed content, so it makes little sense to burn tokens on them.
Example ReAct AI Agent

Example ReAct AI Agent

  1. Agent Prompt is default
  2. Check the description of the HTTP_Request_Tool, it guides the agent to provide a query string with several parameters instead of a JSON object
Agent with custom HTTP Request

Agent with custom HTTP Request

Purpose and structure

This folder contains the Agent with custom HTTP Request workflow. Its executable nodes use agent, executeWorkflowTrigger, httpRequest, if, lmChatOpenAi, manualChatTrigger, markdown, set, toolWorkflow. The table and connection map below are derived from the JSON, not an inferred guarantee of behavior.

Setup

Import inactive. Configure your own credentials and replace REPLACE_WITH_* values. Review external destinations and Code nodes before running.

Entry points

On new manual Chat Message, Execute Workflow Trigger

Verification

Sanitized source candidate; not runtime-tested. This overview is generated from node metadata. Read the folder README for the connection map, credential types, and license.

Attribution

https://github.com/Zie619/n8n-workflows/blob/94007c1445d9258a7da116646b79473e7c7c3282/workflows/Http/1267_HTTP_Markdown_Automation_Webhook.json MIT; preserve source notices.

Canvas section labels

These name areas of the original canvas; they do not include explanatory instructions.

  • Convert the query string into JSON, apply the limit for a page length

More in AI & research