Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to log Flow callout requests and responses #634

Open
jongpie opened this issue Feb 13, 2024 Discussed in #632 · 2 comments
Open

Add the ability to log Flow callout requests and responses #634

jongpie opened this issue Feb 13, 2024 Discussed in #632 · 2 comments
Labels
enhancement New feature or request flow Items related to using Logger within Flow integrations logger engine Items related to the core logging engine

Comments

@jongpie
Copy link
Owner

jongpie commented Feb 13, 2024

Flows has the ability to make HTTP callouts with External Services, similar to the Apex classes HttpRequest, HttpResponse, and Http that can be used to make callouts.

Ideally, Nebula Logger should provide a way to log the Flow callout request and response, similar to the Apex instance methods LogEntryEventBuilder.setHttpRequestDetails() and LogEntryEventBuilder.setHttpResponseDetails() (see discussion #632). However, I haven't use this functionality in Flow, so I'm not sure how exactly this works in Flow, nor what the data types are of the Flow callout request & response. It might "just work", but it might require some changes to Nebula Logger's 3 invocable logging classes - FlowLogEntry, FlowLogRecordEntry, and FlowCollectionLogEntry - to support this.

@jongpie jongpie added enhancement New feature or request flow Items related to using Logger within Flow logger engine Items related to the core logging engine labels Feb 13, 2024
@jongpie jongpie changed the title Add the ability log callout requests and responses Flow Add the ability log Flow callout requests and responses Feb 13, 2024
@jongpie jongpie changed the title Add the ability log Flow callout requests and responses Add the ability to log Flow callout requests and responses Mar 5, 2024
@JMercie
Copy link
Contributor

JMercie commented Apr 21, 2024

Hi @jongpie !

I was reviewing this issue and setup a sample with the pokeapi just to test what we get as I haven't use Flows for callouts before.

Looks like we get access to a resource with three properties:

  • 2XX response: This is an object, which properties and structure is previously defined when you create your http action, so here we can access all the nodes of a successful response.
  • ResponseCode (number): straight forward, the response code from the callout.
  • defaultExc: Raw text with the error message the API returns.

I don't think any change is required, maybe support Apex-defined collections in case you want to log response body entirely, as we currently support only a string as the "message"

@jongpie
Copy link
Owner Author

jongpie commented Apr 26, 2024

@JMercie that's incredibly helpful, thanks so much for testing this out. I like the idea of maybe supporting Apex-defined object/collections, or simply some additional String properties on the current Flow actions - but I think let's hold off on this for now.

My thought is that at the moment, Nebula Logger's Flow actions already have several properties on them, so it's already a lot of fields for admins to fill out when configuring the invocable action. Before adding even more properties (to support storing Flow callout data), I want to first explore creating a custom property editor (CPE) LWC for the Flow actions to see if that would provide a better user experience for admins configuring the Flow actions. After that, then I'd like to revisit this issue to see if it does make sense to add some way to store the Flow callout data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request flow Items related to using Logger within Flow integrations logger engine Items related to the core logging engine
Projects
None yet
Development

No branches or pull requests

2 participants