Can anyone tell me what is the use of calling a shared flow inside another shared flow?

  1. I really didn't find any use of nested sharedflow. If anyone knows the significant pls tell me
0 3 295
3 REPLIES 3

One use case is with Flowhooks. You may only attach 1 shared flow to a flow hook so a workaround would be creating a single shared flow and attaching nested shared flows.

Example,

- create a shared flow called `SF-pre-proxy-flowhook`
- Add additional shared flows into your new shared flow.

pre-proxy flowhook

> SF-pre-proxy-flowhook

> SF-logging-frontend-policies

> SF-security-frontend-policies

See this question for more info
https://www.googlecloudcommunity.com/gc/Apigee/Flowhooks-can-I-add-only-1-SharedFlow-to-a-flowhook/m...

We use nested shared flows extensively. Nice way to build up a well structured hierarchy of functionality. An example:

  • Base shared flows to retrieves and caches JWKS,
  • Shared flow that retrieves public key from such JWKS based on key-id,
  • Shared flow that verifies JWT token leveraging public key from JWKS

Thank you @ouialex  & @guycrets for sharing your knowledge. Both answers make sense🙂