3

I'm trying to invoke a custom flow (built via process builder) via REST API.

The process begins with a contact record,

This process starts when another process invokes it.

Select an object to associate with the process:

Contact

The unique API name of the process is my_process.

I am trying to post a contact record into this custom action, like so:

url = instance_url +'/services/data/v33.0/actions/custom/flow/my_process'

headers = {
    'Authorization': 'Bearer ' + access_token,
    'Content-Type' : 'application/json'
}

payload = {
    'inputs': [{
        'sObjectId': '0034F000005RUTOQG5' 
    }]
}

The response is:

[
   {
      "actionName":"my_process",
      "errors":[
         {
            "statusCode":"UNKNOWN_EXCEPTION",
            "message":"The flow doesn't have a variable with the name sObjectId, or the variable doesn't allow input access.",
            "fields":[

            ]
         }
      ],
      "isSuccess":false,
      "outputValues":null
   }
]

I did check that the flow is available, via GET request to:

/services/data/v33.0/actions/custom/flow

and it did show my_process.

How can I supply the contact value to the flow via the REST api?

Thank you!

For reference:

https://developer.salesforce.com/docs/atlas.en-us.api_action.meta/api_action/actions_obj_flow.htm

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_actions_invocable_custom.htm

EDIT: tried changing the key to 'recordId'

'inputs': [{
        'recordId': '0034F000005RUTOQG5' 
    }]

based on:

https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_distribute_internal_action.htm

same error...

3

Oh man... of course, it was a case issue.

here is the proper casing for the post payload:

payload = {
    'inputs': [{
        'SObjectId': '0034F000005RUTOQG5' 
    }]
}

SObjectId vs sObjectId

(╯°□°)╯︵ ┻━┻

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.