At a glance
- Trigger
- Manual Chat Trigger (On new manual Chat Message)
- Nodes
- 16
- Apps
- OpenAI
- AI nodes
- 4
- Credentials
- 1 type
- Category
- AI agents and LLM tools
Apps and integrations
Node types used
How it works
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
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
Convert the query string into JSON, apply the limit for a page length
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.
Setup notes
The text below comes from the sticky notes inside the workflow. We removed links, code samples and anything that looks like a key or token.
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.
Nodes in this workflow
The 16 nodes in file order (sticky notes excluded). Branches and connections determine execution order in n8n:
- On new manual Chat Message (Manual Chat Trigger)
- OpenAI Chat Model (OpenAI Chat Model)
- HTTP Request (HTTP Request)
- Exctract HTML Body (Edit Fields (Set))
- Is error? (If)
- Stringify error message (Edit Fields (Set))
- Execute Workflow Trigger (Execute Workflow Trigger)
- Remove extra tags (Edit Fields (Set))
- Simplify output (Edit Fields (Set))remove links and image URLs
- Simplify? (If)
- QUERY_PARAMS (Edit Fields (Set))
- CONFIG (Edit Fields (Set))
- ReAct AI Agent (AI Agent)
- Convert to Markdown (Markdown)
- Send Page Content (Edit Fields (Set))
- HTTP_Request_Tool (Call n8n Workflow Tool)
Credentials you need
- OpenAI API – used by OpenAI Chat Model
Configure your own credentials after importing. Create each credential in n8n, then select it in the node.
How to import into n8n
- Download the JSON file with the button above.
- In n8n, open a new workflow, select the ... menu and choose Import from File. You can also paste the JSON straight into the editor canvas.
- Open each node that shows a warning and select or create its credential.
- Read the notes on the canvas, test the workflow with sample data, then activate it.
Do you need somewhere to run it? Read our guide to self-hosted n8n.