Check Webhook Triggers That Set responseCode Without wait

For the complete documentation index, see llms.txt. For a full content snapshot, see llms-full.txt. Append .md to any kestra.io/docs/* URL for plain Markdown.

Available on: Open Source EditionEnterprise EditionCloud

Kestra 2.1.0 applies the webhook response properties to every response, including the immediate response of a trigger that doesn’t set wait: true.

What changed

  • responseCode: in 2.0, a trigger without wait always responded 200 and ignored responseCode. In 2.1.0, the immediate response uses responseCode.
  • responseContentType: in 2.0, it only applied with returnOutputs: true. In 2.1.0, it applies to every response.
  • New properties: responseHeaders and responseBody are new in 2.1.0 and also apply with or without wait.

Without wait, the response is rendered as soon as the execution is created, before any task runs. An expression that reads outputs can’t be rendered then, so the webhook responds with 500 Internal server error. The execution is still created and runs.

Who is affected

Webhook triggers that set responseCode without wait: true:

  • A fixed code, such as responseCode: 202: callers now get that code instead of 200. This is usually what you intended, but check callers that only accept 200.
  • A code that reads outputs, such as responseCode: "{{ outputs.check.values.code }}": callers now get 500 on every request, although the execution runs.

Migrate

For a responseCode that reads outputs, either:

  • set wait: true, so the response is rendered after the execution finishes, or
  • remove responseCode, or replace it with a fixed value or an expression that only reads the trigger variables (trigger.body, trigger.headers, trigger.parameters) and execution.id.
triggers:
- id: webhook
type: io.kestra.plugin.core.trigger.Webhook
key: "{{ secret('WEBHOOK_KEY') }}"
wait: true # needed because responseCode reads outputs
responseCode: "{{ outputs.check.values.code }}"

Was this page helpful?