From 86951da6b1f8fa98c7b115f67d33bb80d23b61f9 Mon Sep 17 00:00:00 2001 From: AJ Emerich Date: Fri, 9 Oct 2026 16:37:12 +0200 Subject: [PATCH] docs: remove misleading example Part of https://github.com/kestra-io/kestra/issues/19706 Rest in 2.1 --- .../07.triggers/03.webhook-trigger/index.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/contents/docs/05.workflow-components/07.triggers/03.webhook-trigger/index.md b/src/contents/docs/05.workflow-components/07.triggers/03.webhook-trigger/index.md index 19a04d8392..58b9ae6682 100644 --- a/src/contents/docs/05.workflow-components/07.triggers/03.webhook-trigger/index.md +++ b/src/contents/docs/05.workflow-components/07.triggers/03.webhook-trigger/index.md @@ -193,7 +193,7 @@ triggers: ## Webhook response -By default, the trigger responds immediately with JSON. When the caller needs to wait for the result — for example, a validation handshake that requires `text/plain` — enable `wait` and set `responseContentType`. +By default, the trigger responds immediately without waiting for the flow to finish. Set `wait: true` to hold the HTTP connection open until the execution completes (or the trigger's timeout is reached), and `returnOutputs: true` to include the flow outputs as a JSON object in the response body. ```yaml triggers: @@ -202,7 +202,6 @@ triggers: key: "{{ secret('WEBHOOK_KEY') }}" wait: true returnOutputs: true - responseContentType: text/plain # optional, defaults to application/json ``` - `wait: true` keeps the HTTP connection open until the flow finishes or the trigger's timeout is reached. @@ -232,12 +231,12 @@ triggers: key: "{{ secret('WEBHOOK_KEY') }}" wait: true returnOutputs: true - # optional: responseContentType: "text/plain" + responseContentType: application/json # sets the Content-Type header only; body is always the JSON outputs map ``` - Call the webhook URL with a query parameter (for example `?name=Alice`). The execution runs synchronously because `wait: true` is set. -- The HTTP response body contains the flow outputs (JSON by default). With the example above, the response includes `"greeting": "Hello Alice!"`. -- Set `responseContentType: "text/plain"` when you want the response body to be plain text (ensure the flow returns a single string output, such as from the `Return` task). +- The HTTP response body contains the flow outputs as a JSON object. With the example above, the response includes `"greeting": "Hello Alice!"`. +- `responseContentType` sets the `Content-Type` header on the response. It does not change how the body is serialized — the body is always the JSON-serialized outputs map when `returnOutputs: true` is set. ## Test a webhook trigger