From 01c02d78076071ffe9892e3bfc41f054bed7b313 Mon Sep 17 00:00:00 2001 From: Gayathri Vijayan <66356931+grvijayan@users.noreply.github.com> Date: Thu, 31 Jul 2025 10:50:17 +0200 Subject: [PATCH] docs: fix the example docs related to set execution api (actions) (#10359) # Which Problems Are Solved Fix docs related to Actions V2 SetExecution API [endpoint](https://zitadel.com/docs/apis/resources/action_service_v2/action-service-set-execution) # How the Problems Are Solved The examples are updated # Additional Changes N/A # Additional Context - Closes #10320 --- .../guides/integrate/actions/testing-event.md | 4 +-- .../actions/testing-function-manipulation.md | 4 +-- .../integrate/actions/testing-function.md | 4 +-- .../actions/testing-request-manipulation.md | 4 +-- .../actions/testing-request-signature.md | 4 +-- .../integrate/actions/testing-request.md | 4 +-- .../actions/testing-response-manipulation.md | 4 +-- .../integrate/actions/testing-response.md | 4 +-- docs/docs/guides/integrate/actions/usage.md | 31 +++++-------------- .../action/v2beta/action_service.proto | 2 +- 10 files changed, 17 insertions(+), 48 deletions(-) diff --git a/docs/docs/guides/integrate/actions/testing-event.md b/docs/docs/guides/integrate/actions/testing-event.md index 8b4502703b..7c8bdd8c2b 100644 --- a/docs/docs/guides/integrate/actions/testing-event.md +++ b/docs/docs/guides/integrate/actions/testing-event.md @@ -103,9 +103,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/testing-function-manipulation.md b/docs/docs/guides/integrate/actions/testing-function-manipulation.md index 8f5e2fc968..e82f0b8c18 100644 --- a/docs/docs/guides/integrate/actions/testing-function-manipulation.md +++ b/docs/docs/guides/integrate/actions/testing-function-manipulation.md @@ -129,9 +129,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/testing-function.md b/docs/docs/guides/integrate/actions/testing-function.md index f14f20b69d..a2faa5e709 100644 --- a/docs/docs/guides/integrate/actions/testing-function.md +++ b/docs/docs/guides/integrate/actions/testing-function.md @@ -107,9 +107,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/testing-request-manipulation.md b/docs/docs/guides/integrate/actions/testing-request-manipulation.md index 1cb4f1776a..b10c32d372 100644 --- a/docs/docs/guides/integrate/actions/testing-request-manipulation.md +++ b/docs/docs/guides/integrate/actions/testing-request-manipulation.md @@ -154,9 +154,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/testing-request-signature.md b/docs/docs/guides/integrate/actions/testing-request-signature.md index c1932a7d5b..b3a9f0fa5d 100644 --- a/docs/docs/guides/integrate/actions/testing-request-signature.md +++ b/docs/docs/guides/integrate/actions/testing-request-signature.md @@ -114,9 +114,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/testing-request.md b/docs/docs/guides/integrate/actions/testing-request.md index b2413e606e..c99e16cd2f 100644 --- a/docs/docs/guides/integrate/actions/testing-request.md +++ b/docs/docs/guides/integrate/actions/testing-request.md @@ -107,9 +107,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/testing-response-manipulation.md b/docs/docs/guides/integrate/actions/testing-response-manipulation.md index 9d95479b05..2bec3e0acd 100644 --- a/docs/docs/guides/integrate/actions/testing-response-manipulation.md +++ b/docs/docs/guides/integrate/actions/testing-response-manipulation.md @@ -173,9 +173,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/testing-response.md b/docs/docs/guides/integrate/actions/testing-response.md index a2ab736505..aea6ac732f 100644 --- a/docs/docs/guides/integrate/actions/testing-response.md +++ b/docs/docs/guides/integrate/actions/testing-response.md @@ -107,9 +107,7 @@ curl -L -X PUT 'https://$CUSTOM-DOMAIN/v2beta/actions/executions' \ } }, "targets": [ - { - "target": "" - } + "" ] }' ``` diff --git a/docs/docs/guides/integrate/actions/usage.md b/docs/docs/guides/integrate/actions/usage.md index e21fb4935d..643c9a3995 100644 --- a/docs/docs/guides/integrate/actions/usage.md +++ b/docs/docs/guides/integrate/actions/usage.md @@ -406,17 +406,11 @@ If you then have a call on `/zitadel.user.v2.UserService/UpdateHumanUser` the fo And if you use a different service, for example `zitadel.session.v2.SessionService`, then the `all` Execution would still be used. -### Targets and Includes +### Targets -:::info -Includes are limited to 3 levels, which mean that include1->include2->include3 is the maximum for now. -If you have feedback to the include logic, or a reason why 3 levels are not enough, please open [an issue on github](https://github.com/zitadel/zitadel/issues) or [start a discussion on github](https://github.com/zitadel/zitadel/discussions)/[start a topic on discord](https://zitadel.com/chat) -::: +An execution can contain only a list of Targets, and Targets are comma separated string values. -An execution can not only contain a list of Targets, but also Includes. -The Includes can be defined in the Execution directly, which means you include all defined Targets by a before set Execution. - -If you define 2 Executions as follows: +Here's an example of a Target defined on a service (e.g. `zitadel.user.v2.UserService`) ```json { @@ -426,13 +420,12 @@ If you define 2 Executions as follows: } }, "targets": [ - { - "target": "" - } + "" ] } ``` +Here's an example of a Target defined on a method (e.g. `/zitadel.user.v2.UserService/AddHumanUser`) ```json { "condition": { @@ -441,21 +434,13 @@ If you define 2 Executions as follows: } }, "targets": [ - { - "target": "" - }, - { - "include": { - "request": { - "service": "zitadel.user.v2.UserService" - } - } - } + "", + "" ] } ``` -The called Targets on "/zitadel.user.v2.UserService/AddHumanUser" would be, in order: +The called Targets on `/zitadel.user.v2.UserService/AddHumanUser` would be, in order: 1. `` 2. `` diff --git a/proto/zitadel/action/v2beta/action_service.proto b/proto/zitadel/action/v2beta/action_service.proto index c040eb9a1d..1cf5c210ee 100644 --- a/proto/zitadel/action/v2beta/action_service.proto +++ b/proto/zitadel/action/v2beta/action_service.proto @@ -675,7 +675,7 @@ message SetExecutionRequest { // Ordered list of targets called during the execution. repeated string targets = 2; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_schema) = { - example: "{\"condition\":{\"request\":{\"method\":\"zitadel.session.v2.SessionService/ListSessions\"}},\"targets\":[{\"target\":\"69629026806489455\"}]}"; + example: "{\"condition\":{\"request\":{\"method\":\"zitadel.session.v2.SessionService/ListSessions\"}},\"targets\":[\"69629026806489455\"]}"; }; }