function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
venkat muthuvenkat muthu 

Hi All, I'm developing a App in salesforce using apex and visualforce the application has many algorithm to run that are in python now how can i integrate this two

Hi All,

I'm developing a App in salesforce using apex and visualforce, the application has algorithm but it is in python 
Now, how can i integrate python code in apex.
My idea is to have to make a webservice call from apex to my python code whether this method is correct or is there is any best method ?
If suppose i have to use a webservice call then where i have to host my code in my own server or salesforce provide facility for that?

Thanks,
Venkat
pbattissonpbattisson
Hi Venkat

You have a couple of options:
  1. Expose those Python algorithms as web services and call out them from Salesforce. You could use the RPC model to help track responses if the algorithm takes some time to run. Have a look at the RPC overview on wikipedia (https://en.wikipedia.org/wiki/Remote_procedure_call).
  2. Integrate using Heroku connect to enable the data to be stored on Herok from where you can directly act on it by deploying your ython code to Heroku.
Paul