Conversation Initiation Client Data Webhook n8n example

Describe the problem/error/question

Hi, I have the problem with initiating ElevenLabs dynamic variables with Conversation Initialization Client Data Webhook.

What is the error message (if any)?

The error message on the ElevenLabs side is always the same: This conversation failed with the following reason: Missing required dynamic variables in first message: {‘user_first_name’}

Please share your workflow

Share the output returned by the last node

<[
  {
    "statusCode": 200,
    "body": {
      "type": "conversation_initiation_client_data",
      "user_id": "222210295",
      "dynamic_variables": {
        "user_first_name": "Robert"
      }
    }
  }
]

Information on your n8n setup

  • **n8n version:**1.123.5
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Your payload is correct.

Your delivery mechanism is wrong.

ElevenLabs is not receiving:

{
  "type": "conversation_initiation_client_data",
  "user_id": "222210295",
  "dynamic_variables": {
    "user_first_name": "Robert"
  }
}

It is receiving:

{
  "statusCode": 200,
  "body": {
    "type": "conversation_initiation_client_data",
    "user_id": "222210295",
    "dynamic_variables": {
      "user_first_name": "Robert"
    }
  }
}

That wrapper breaks ElevenLabs’ parser.

They expect the raw JSON as the HTTP response body, not an n8n-style structured response.


Root Cause

You are using Respond to Webhook in “Response Mode: Last Node” style output.

n8n is wrapping your data.

ElevenLabs reads only the top-level body → doesn’t see dynamic_variables → throws:

Missing required dynamic variables in first message

Fix (Do This Exactly)

In your Respond to Webhook node:

Set:

Response Mode → On Received

OR

Response Data → First Entry JSON

AND most importantly:

Response Body:

Use expression:

{{$json}}

NOT manual object.

Also Check This (Critical)

Make sure your Function node outputs:

return [
  {
    json: {
      type: "conversation_initiation_client_data",
      user_id: "222210295",
      dynamic_variables: {
        user_first_name: "Robert"
      }
    }
  }
];

NOT:

return [
  {
    statusCode: 200,
    body: {...}
  }
];


Final Expected HTTP Response (What ElevenLabs Must Receive)

Raw response:

{
  "type": "conversation_initiation_client_data",
  "user_id": "222210295",
  "dynamic_variables": {
    "user_first_name": "Robert"
  }
}

No wrapper.
No statusCode.
No body key.

Why This Happens

ElevenLabs Conversation Init webhook is strict.

It does not unwrap platform envelopes like:

  • n8n

  • Zapier

  • Make

It expects a direct payload.


If it still fails

Then the issue becomes timing (first message race condition).
But fix the response structure first — right now it’s definitely wrong.

Update this and test again.

Hi, thank you very much, I will give it a try in a moment. I think I have tried already without status: 200.

It works now, thank you so much. I wouldnt figure it own myself.

My pleasure

Apologies for bothering but now the widget stopped working because data are not initialized through webhook when using widget. So I seems I have provided the data like below:

<elevenlabs-convai agent-id=“my-id-here” dynamic-variables=‘{“user_first_name”: “”, “user_last_name”: “”, “user_phone_number”: “”, “user_email”: “”, “visit_subject”: “”, “meeting_agenda”: “”, “issue_subject”: “”, “issue_content”: “”, “issue_number”: “”, “issue_updated”: “”, “resp_message”: “”, “visit_available_slots”: “”, “visit_pref_date”: “”, “visit_pref_time”: “”}’

Bot the agent still complains from missing data. Are empty data not allowed or is there any other reason?