Possible to HTTP callout in a Salesforce job?

Has anyone been able to use an HTTP callout in a Salesforce job successfully? We are investigating the utility of a tool called what3words (www.what3words.com) and I was hoping to be able to make a callout to their API to convert GPS coordinates to the three-word location. I think this is the next frontier for us being able to truly pull together a network of various APIs with Salesforce as our central hub (FOREX rates, locations, etc.) and also being able to provide that information back to the field via CommCare.

Ideally, the flow would look something like this:

  1. CommCare survey is completed and captures the GPS coordinates 8.9631703,38.7081048.
  2. CommCare sends the survey JSON to OpenFN.
  3. OpenFN job kicks off and makes the HTTP callout to the W3W API to convert 8.9631703,38.7081048 to a three-words location.
  4. W3W returns “divided.required.wasps” to OpenFN.
  5. OpenFN pushes divided.required.wasps into a field into Salesforce.
    Any experience with this?

You could currently accomplish it using 2 jobs:

  1. First, an HTTP job is triggered by the inbound CommCare message. This job calls out to W3W to convert the GPS coordinates and then posts the original CommCare data with the converted coordinates back to OpenFn.
  2. Second, a Salesforce job is triggered by the inbound W3W-enhanced message. This job loads records into Salesforce.
    This is a pretty typical flow on OpenFn. For bonus points, you may be able to include “language-http” as a dependency in “language-salesforce” and make http calls before making your create. Off the top of my head, I’m not sure how this would interact with the Salesforce connection that wraps up all the other language-salesforce calls, but you’d be welcome to propose an enhancement and submit a pull request!

TD

Thanks, Taylor! I figured it had been done before.

kz

You got it!