ExternalCallout - Calling from FlowCallout

Hi,

I am trying out the ExternalCallout, I spun up a node sever with GRPC and the external_callout.proto.

Since ExternalCallout cannot be called from PostClientFlow, I tried calling it from a SharedFlow that I hooked up through a FlowCallout.  It doesn't work.

Am I doing something wrong or it's just not supported?

When I call the ExternalCallout from PostProxy Response flow It's all working.

The reason I am want it in the PostClientFlow is that I don't want the GRPC transaction to slow down the response to the client. I don't want it inline.

Thanks.

Solved Solved
0 4 163
1 ACCEPTED SOLUTION

The main use cases enabled by the ExternalCallout policy is to implement custom processing behavior based on the flow variables. Very common during the Authentication/Authorization phases, as implemented in these examples. Also, as stated in the docs, the PostClientFlow only allows some specific policies to run - the ExternalCallout is not one of them, so your approach won't work unfortunately.

A PostClientFlow can include the following policies only. No other policies can be used in a PostClientFlow:

FlowCallout policy*

MessageLogging policy

ServiceCallout policy

* The FlowCallout policy can only call shared flows which themselves meet the criteria for being in the PostClientFlow (ie, only contain compatible policies).


View solution in original post

4 REPLIES 4

The main use cases enabled by the ExternalCallout policy is to implement custom processing behavior based on the flow variables. Very common during the Authentication/Authorization phases, as implemented in these examples. Also, as stated in the docs, the PostClientFlow only allows some specific policies to run - the ExternalCallout is not one of them, so your approach won't work unfortunately.

A PostClientFlow can include the following policies only. No other policies can be used in a PostClientFlow:

FlowCallout policy*

MessageLogging policy

ServiceCallout policy

* The FlowCallout policy can only call shared flows which themselves meet the criteria for being in the PostClientFlow (ie, only contain compatible policies).


@pablosan, thanks for detailed response.


I understand.  I can see benefits of extending the ExternalCallout functionality to allow async and FlowHook usage.  Leveraging the built in GRPC client to send data in a binary format to an external service would be very nice.

I would also like to see some batching options though if an async option was made available. (wishful I know...)

I can't believe I missed that FlowCallout policy * asterisk note. Doh.

One way to maybe get what you want is to use ServiceCallout to a second API proxy, which itself uses ExternalCallout.  You would have to transfer all of the context necessary to that second proxy.  If you like, You can make the ServiceCallout in the PostClientFlow in the first proxy, behave asynchronously.  This is almost superfluous, because it is in the PostClientFlow anyway. Still.

Thanks Dino! Will keep that in mind.