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.
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.
| Node | Category | Type | Operation |
|---|---|---|---|
| On new manual Chat Message | Trigger | Manual Chat Trigger | See node parameters |
| OpenAI Chat Model | AI & models | OpenAI Chat Model | See node parameters |
| HTTP Request | Web / API | HTTP Request | See node parameters |
| Exctract HTML Body | Transform | Edit Fields | See node parameters |
| Is error? | Routing | If | See node parameters |
| Stringify error message | Transform | Edit Fields | See node parameters |
| Execute Workflow Trigger | Trigger | Execute Workflow Trigger | See node parameters |
| Remove extra tags | Transform | Edit Fields | See node parameters |
| Simplify output | Transform | Edit Fields | See node parameters |
| Simplify? | Routing | If | See node parameters |
| QUERY_PARAMS | Transform | Edit Fields | See node parameters |
| CONFIG | Transform | Edit Fields | See node parameters |
| ReAct AI Agent | AI & models | Agent | See node parameters |
| Convert to Markdown | Transform | Markdown | See node parameters |
| Send Page Content | Transform | Edit Fields | See node parameters |
| HTTP_Request_Tool | Subworkflow | Tool Workflow | See node parameters |
Setup
- Download the JSON and import it into an isolated n8n instance. Leave the workflow inactive.
- Connect your own credentials through n8n’s credential store. Replace
REPLACE_WITH_*values with your resource identifiers. - Inspect API destinations, Code nodes, database queries, file paths, and outbound actions.
- 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:
- If query param was incorrect, return the instruction. AI Agent should pick up on this and adapt the query on the next iteration.
- 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:
- Keep only content
- Remove inline tag entirely, as well as: NOSCRIPT, IFRAME, OBJECT, EMBED, VIDEO, AUDIO, SVG, and HTML comments.
- 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
- 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.
- 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
- Agent Prompt is default
- 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