AnsweredAssumed Answered

Passing Output Parameter from REST call to WF

Question asked by Christopher Smith on Jul 31, 2020
Latest reply on Aug 26, 2020 by Christopher Smith


I am looking for advice on how to pass an output parameter from a REST call to a workflow variable, to be used in a different REST call.

I know in order to pass a variable from the workflow to the second call, I will need to use an AFXCUSTOM variable, however I can not seem to get the output parameter from the first call to pass the variable to the workflow.


The reason this setup is required is due to how we retrieve the OAUTH 2.0 token.  First, the base URL for the OAUTH 2.0 is different than the base URL to perform any of the API capabilities.  Second, the OAUTH 2.0 token retrieval does not use a ClientID and a ClientSecret so i can not use the built in OAUTH 2.0 as described in the Generic Rest Connector documents.


I have a dummy application, Apigee Login, and a connector, Apigee Login Connector, configured.  I have the Apigee Login connector assigned to the Apigee Login application.  I have successfully setup the "Login" command on the Apigee Login connector to successfully retrieve my token and pass it to the SessionToken output parameter.  I have also tried configuring a second output parameter outside of the default, in an attempt to pass the custom parameter.


I have my real application, Apigee, and a connector, Apigee Connector, configured.  I have the "Add Approle to Account" command configured to add an existing role in Apigee to an existing user account.


My idea was to create a workflow where the first node, is a provisioning node that calls the "Login" command from my Apigee Login Connector.  This then passes the output "sessiontoken" to the workflow.  I then use this value to set a variable AFXCUSTOM_SESSIONTOKEN.  The second node would be a provisioning (or eventually AFX handler) node to carry out the requested command, in my example, to "Add Approle to Account".


I can successfully execute the initial "Login" provisioning node, per the workflow and per the AFX logs, however I am unable to see either default or custom session token parameters passed to the workflow variables.


Has anyone been successfully able to pass a returned value from a REST call to the workflow?  Or experience with 2 different URL as stated above?


Thank you,