Skip to content

Troubleshooting & FAQ

Find your symptom below; each entry says what causes it and links to the page that explains the rule. For the basic flow, start with Getting Started.

Never forget the x-huat-platform: customer header

Section titled “Never forget the x-huat-platform: customer header”

Symptom: every request answers Platform is not specified! (extensions.code FORBIDDEN, HTTP 200) even with a valid credential.

Fix: send x-huat-platform: customer on every request, next to the credential, and in connectionParams of every subscription. See The header every request needs.

Symptom: extensions.code is BAD_REQUEST and you cannot tell which field is wrong.

Fix: read errors[0].message: it lists the failed constraints (for example name should not be empty). Match your code on extensions.code, never on the message text. See GraphQL errors.

I get HTTP 415 UNSUPPORTED_CONTENT_ENCODING

Section titled “I get HTTP 415 UNSUPPORTED_CONTENT_ENCODING”

Cause: something in your path compresses the request body (Content-Encoding: gzip, deflate or br), and Wetel accepts only plain bodies. Fix: switch off request compression for calls to Wetel. See Compressed request bodies: HTTP 415.

Invalid or expired avatar token in a long conversation

Section titled “Invalid or expired avatar token in a long conversation”

Cause: the session token from sdkStart lasts about an hour. Fix: do not start a new session. Call refreshAvatarToken with the token you have (it is still accepted up to 10 minutes after it expires), retry with the new one, and reopen the sessionEvents WebSocket with it, because an open socket keeps its old token and stops delivering replies without an error. See Refreshing the session token.

Cause: a rate limit. Most limits are counted per client IP, so a backend serving many users shares one budget. See Rate limits and Rate-limit refusals.

Don’t put your API key in client-side code

Section titled “Don’t put your API key in client-side code”

Anyone holding your X-Api-Key can start conversations and run workflow tasks for your workspace until you revoke it. Keep it on your server: call sdkStart there and hand only sessionId and the session token (avatarToken) to the browser. See Authentication.

The agent answers every message with the same apology

Section titled “The agent answers every message with the same apology”

Cause: the agent’s workflow was never published, or a node fails on every turn. Fix: check isPublished on the workflow and publish it (Publishing); if it is published, read the failed run (see Debugging a failed workflow run).

Don’t forget the union-fragment selection on the events subscription

Section titled “Don’t forget the union-fragment selection on the events subscription”

Symptom: some events never arrive, with no error. Cause: sessionEvents returns a union, and a member you do not select with ... on TypeName is dropped. Select every type you handle; sessionId is ID! here, unlike everywhere else:

subscription SessionEvents($sessionId: ID!) {
sessionEvents(sessionId: $sessionId) {
__typename
... on AiResponseEvent {
text
mood
isFinal
turnComplete
}
... on NodeExecutingEvent {
workflowRunId
nodeId
nodeType
}
... on NodeFailedEvent {
workflowRunId
nodeId
nodeType
error
}
... on SessionWillEndEvent {
type
}
... on SessionEndedEvent {
durationSeconds
}
}
}

My UI stops listening after the first line

Section titled “My UI stops listening after the first line”

Cause: you end the turn on isFinal. A workflow can send several messages in one turn, and each has isFinal: true. Fix: treat the turn as over when turnComplete is true, and skip events with empty text. See isFinal vs turnComplete.

Fix: reopen the subscription with sinceMessageId set to the id of the last model message you have; stored replies after it are replayed before live events. See Reconnecting without losing a reply.

SessionWillEndEvent is not the end of the session

Section titled “SessionWillEndEvent is not the end of the session”

It is sent only for an agent without a workflow, when the user’s message or the agent’s reply sounds like a goodbye. The session stays active: show an “end the conversation?” prompt and call sdkEndSession if the user agrees. The session is over only at SessionEndedEvent. A workflow’s end_session confirmation arrives as an ordinary reply instead.

sdkEndSession evaluates before it returns; evaluation is null when the conversation had fewer than two messages or the evaluation failed (the session is still ended). The dashboard’s endSession and an end_session node evaluate in the background, so evaluation(sessionId) stays null until that job finishes, and an end_session node evaluates only with runEvaluation: true. See Evaluation and Export.

Workflows that will not publish or call out

Section titled “Workflows that will not publish or call out”

publishWorkflow names the problem:

MessageFix
Workflow must have a START node before publishingAdd one node of type start. Types are lowercase; "START" is refused with BAD_USER_INPUT.
Workflow must have exactly one START nodeRemove the extra start nodes.
Edge "<id>" has unknown source node (or target node)An edge points at a node that is not in nodes, often one you deleted.
Duplicate node idGive each node a unique id.
Node "<id>" is unreachable from STARTConnect the node or remove it.
A node config error, such as missing required field: promptTemplateFix that node; its page under Nodes lists the required fields.

Loops are allowed; bound them with maxVisits. The full list of checks is in What publishing checks.

My ACTION/WEBHOOK URL worked before and now fails

Section titled “My ACTION/WEBHOOK URL worked before and now fails”

Outbound calls from action, webhook and tool nodes, MCP connectors and externalSyncUrl do not follow redirects and refuse a hostname that does not resolve publicly.

  1. Redirect: point the URL at the final destination (an http:// URL upgraded to https:// and a trailing-slash rewrite are the usual causes). The node’s error names the redirect.
  2. Hostname: a name that resolves only on your internal network is refused when you save the agent or publish the workflow, with an error naming it.
  3. Details: the node’s row in the run’s nodeTrace has the error and, for these nodes, the renderedRequest that was sent.

A webhook, action or MCP call fails with a content-encoding error

Section titled “A webhook, action or MCP call fails with a content-encoding error”

Your endpoint compressed its response: webhook and action calls accept no encoded response, and MCP, sync and URL-ingestion calls refuse Brotli. Switch compression (or Brotli) off for that endpoint. See Responses Wetel cannot read.

listMcpTools asks your server live every time; nothing is cached. When it cannot reach or read your server it answers BAD_GATEWAY with The MCP server could not list its tools: and the reason (Refused URLs and an unreachable MCP server). Check in this order:

  1. Your server lists the tool when you call it directly:
Terminal window
curl -s -X POST 'https://<your-mcp-server-url>' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}' | jq '.result.tools[].name'
  1. The connector’s serverUrl is exactly that URL (tunnel URLs change):
query CheckConnector($id: Int!) {
mcpConnector(id: $id) {
id
name
serverUrl
}
}
  1. listMcpTools(connectorId: <id>) { name } returns the same list. If it still differs, look for a credential your server refuses.

Before building an MCP server around an existing REST API, consider a custom action, which needs no MCP: see MCP connector vs. custom action.

  1. Reproduce by hand in the GraphQL console with the same headers as your client. Name every mutation that returns a plain Boolean; an anonymous one can fail with syntax error: invalid number.
  2. Find the run. workflowRuns(sessionId) lists a session’s runs, newest first; NodeExecutingEvent and NodeFailedEvent also carry workflowRunId live. Both queries need a dashboard login.
  3. Read the trace, below.
query DebugRun($id: Int!) {
workflowRun(id: $id) {
id
status
errorMessage
context
nodeTrace
}
}

nodeTrace has one row per node the run visited, in order, with its status, error, outputValue and, for tool, action and webhook nodes, the renderedRequest that was sent. Secret-looking values are masked on a best-effort basis, so keep secrets out of templates. Every field and status is described in Observability: per run; how to branch on run outcomes is in Workflow run failures.

See also: Configuring an Agent, Workflows Overview, Events and Subscriptions, Error handling.