No Output for Message/Channel in OpenAI Intent Detection Node (Expressions Correct, No Error)

Hi everyone,

I´m e newby as far as n8n and am building rather an easy setup with a chatbot that ist embedded on the webpage which “speaks” 4 different languages answering questions via openai (http) with retrieval konwledge base.

I’m struggling with a persistent issue as far as the language detection and forwarding the “channel: webchat” in the workflow and would really appreciate your help - what am I missing here?

Workflow Context

  • n8n version: 1.101.1
  • Trigger: Webhook (incoming webchat message)
  • Webhook body:
{
  "body": {
    "message": "Some text here",
    "channel": "webchat"
  }
}

What I’m Doing

subflow: Webchat: webhook (incoming message) - > subflow (see below) → respond to webbhook

"when executed by another workflow:

  1. Edit Fields (Set) Node:
    I extract the values from the webhook body:
  • message: ={{$json["body"]["message"]}}
  • channel: ={{$json["body"]["channel"]}}Output example:
{
  "body": {
  "message": "Some text here",
  "channel": "webchat"
}
  1. Intent Detection (HTTP Request to OpenAI):
{
  "model": "gpt-3.5-turbo",
  "messages": [
    {
      "role": "system",
      "content": "Analyze the following message and return only the main intent as a single word: sommerdeal, terminbereit, reminder, upsell, crossselling, komplex, neugierig. ..."
    },
   
...
{
"role": "user",
"content": "Nachricht: {{$json["body"]["message"]}}\nchannel: {{$json["body"]["channel"]}}"
}
],
"max_tokens": 5,
"temperature": 0
}
  1. **Intent Detection (HTTP Request to OpenAI): does not have an output

The Problem

  • The intent is returned correctly from the OpenAI node, but the message and channel fields are missing from the output.
  • There are no error messages in the node output.
  • I have checked:
    • The Edit Fields node output contains both message and channel as expected.
    • The HTTP Request node is set to JSON body, with correct headers.
    • Expressions are correct and highlighted green in the UI.

What I’ve Tried

  • Using both {{$json.message}} and {{$json["message"]}} syntax.
  • Adding debug fields to check if values are passed (they are present in Edit Fields output).
  • Changing field names to all lowercase for consistency.
  • Testing with both OpenAI and other HTTP endpoints.

What am I missing?

  • Why are the message and channel fields not passed through the OpenAI HTTP Request node output, even though the intent is returned?
  • Is there a best practice for passing original input fields through OpenAI nodes in n8n?
  • Has anyone solved a similar issue?

Any help or pointers would be greatly appreciated!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.