Giter VIP home page Giter VIP logo

Comments (6)

douglascayers avatar douglascayers commented on June 5, 2024 3

Unfortunately, the error System.CalloutException: Callout loop not allowed is behaving as designed by Salesforce.

Per their documentation, the scenario occurs when a Salesforce org makes a callout to a Salesforce org, and then that Salesforce org makes a callout.

Salesforce A ----Callout----> Salesforce B ----Callout----> Webservice

With Mass Action Scheduler, the app invokes your process/flow via a callout to the REST API, so that's the Salesforce org makes a callout to a Salesforce org first part of the scenario. Your org makes a callout back to itself. Then, if your process/flow/apex makes another synchronous callout or uses external services, that is the and then that Salesforce org makes a callout second part of the scenario.

As a workaround, you might try having your invoked process/flow/apex perform its callout or use of external services asynchronously via batch or queueable apex.

There isn't anything I can change here for now until Salesforce provides a way for invocable processes and headless flows to be initiated from apex natively rather than having to go through the REST API. I have brought up this limitation to Salesforce product management and awaiting prioritization.

Note, in Spring 18 release, autolaunched flows can be started from apex natively, but the REST API that Mass Action Scheduler uses to know which flows/processes you want to invoke does not distinguish between invocable processes and autolaunched flows, and so the app cannot reliably know which code path to go down once you've made a a selection.

If/when apex supports starting invocable processes, then I'll revisit this feature request. Please consider submitting this idea on IdeaExchange too.

Thanks!

from sfdx-mass-action-scheduler.

bruceleestewart avatar bruceleestewart commented on June 5, 2024 2

from sfdx-mass-action-scheduler.

douglascayers avatar douglascayers commented on June 5, 2024 1

Thanks for the kind feedback @bruceleestewart.

Since this is blocked by Salesforce's architecture, and I'm not sure if that limitation will change, I'm going to close this issue for now. I've added to the FAQ.

Thanks

from sfdx-mass-action-scheduler.

douglascayers avatar douglascayers commented on June 5, 2024

This may be a limitation in how Mass Action Scheduler works. The app uses the Salesforce REST API to invoke the chosen action (flow). So what I understand in that help article is that the callout from the flow itself is being blocked because apex code already made a callout.

For grins to see if this workaround helps, could you try adding a flow Wait element before the flow calls the external service? That might cause a new apex transaction to occur and so reset the http callout limit. I’m not saying that is or isn’t a good thing to do, but something to try.

from sfdx-mass-action-scheduler.

douglascayers avatar douglascayers commented on June 5, 2024

@bruceleestewart I'm going to escalate to the Apex and Flow teams to see if this is "by design" or "fixable".

from sfdx-mass-action-scheduler.

douglascayers avatar douglascayers commented on June 5, 2024

Hi @bruceleestewart, could you please share a simple code sample for invoking the External Service I could use to build a reproduction of your issue? Thanks

from sfdx-mass-action-scheduler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.