n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
47.55k stars 7.17k forks source link

HTTP Request Tool where enabling Optimise Response for HTML errors #11385

Open jimleuk opened 3 hours ago

jimleuk commented 3 hours ago

Bug Description

When enabling "Optimise Response" option for HTML in the HTTP request tool, the user recieves the following error as tool output. This prevents the AI agent from using the tool correctly.

{
  "response": "There was an error: \"Cannot read properties of undefined (reading 'load')\""
}

Disabling the "Optimise Response" option allows the tool to function as expected.

With "Optimise Response" option

Without "Optimise Response" option

HTTP Request Tool Options

To Reproduce

  1. Create Tools agent and attach HTTP Request Tool
  2. Define URL placeholder for agent to input desired web address to visit
  3. Enable "Optimise Response" option and select "HTML" from dropdown. Use default "body" as the content to extract.
  4. Test agent
  5. HTTP request tool fails to retrieve the contents of the URL.

Expected behavior

With "Optimise Response" option enabled for HTML, I'd expect the HTTP request tool to return the body of HTML of the given URL.

Operating System

MacOS Sonoma

n8n Version

1.64.0

Node.js Version

???

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 3 hours ago

Hey @jimleuk,

We have created an internal ticket to look into this which we will be tracking as "GHC-342"