← All N8N workflows
AI & researchAgentChat TriggerExecute Workflow TriggerHTTP RequestIf

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

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

Workflow preview
TriggerWhen chat messagereceivedChat TriggerAI & modelsAI AgentAgentAI & modelsOpenAI Chat Model1OpenAI Chat ModelTriggerWhen Executed byAnother WorkflowExecute Workflow TriggerTransformQUERY_PARAMSEdit FieldsTransformCONFIGEdit FieldsWeb / APIHTTP RequestHTTP RequestRoutingIs error?IfTransformStringify error messageEdit FieldsTransformExctract HTML BodyEdit FieldsTransformRemove extra tagsEdit FieldsRoutingSimplify?IfTransformSimplify outputEdit FieldsTransformConvert to MarkdownMarkdownTransformSend Page ContentEdit FieldsSubworkflowHTTP_Request_ToolTool Workflow

Node categories in this workflow

  • Trigger
  • AI & models
  • Transform
  • Web / API
  • 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
When chat message receivedTriggerChat TriggerSee node parameters
AI AgentAI & modelsAgentSee node parameters
OpenAI Chat Model1AI & modelsOpenAI Chat ModelSee node parameters
When Executed by Another WorkflowTriggerExecute Workflow TriggerSee node parameters
QUERY_PARAMSTransformEdit FieldsSee node parameters
CONFIGTransformEdit FieldsSee node parameters
HTTP RequestWeb / APIHTTP RequestSee node parameters
Is error?RoutingIfSee node parameters
Stringify error messageTransformEdit FieldsSee node parameters
Exctract HTML BodyTransformEdit FieldsSee node parameters
Remove extra tagsTransformEdit FieldsSee node parameters
Simplify?RoutingIfSee node parameters
Simplify outputTransformEdit FieldsSee 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

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
Convert the query string into JSON, apply the limit for a page length

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

Purpose and structure

This folder contains the Convert the query string into JSON, apply the limit for a page length workflow. Its executable nodes use agent, chatTrigger, executeWorkflowTrigger, httpRequest, if, lmChatOpenAi, 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

When chat message received, When Executed by Another Workflow

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/0363_HTTP_Executeworkflow_Automate_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