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.mdto anykestra.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 withoutwaitalways responded200and ignoredresponseCode. In 2.1.0, the immediate response usesresponseCode.responseContentType: in 2.0, it only applied withreturnOutputs: true. In 2.1.0, it applies to every response.- New properties:
responseHeadersandresponseBodyare new in 2.1.0 and also apply with or withoutwait.
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 of200. This is usually what you intended, but check callers that only accept200. - A code that reads outputs, such as
responseCode: "{{ outputs.check.values.code }}": callers now get500on 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) andexecution.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 }}"Related
Was this page helpful?