You are viewing limited content. For full access, please sign in.

Question

Question

Custom Query in Cloud

asked on May 14, 2020

Hi,

I can see that I can query a remote SQl server (SELECT, INSERT, etc) however, I have an on-prem WF which uses the Custom Query action to run a Stored Procedure to add data to a SQL database.  Is there a work around to this in Cloud?  I don't just want to do an INSERT query.

Thanks

1 0

Replies

replied on May 14, 2020

Hi Anthony,

 

There is not currently a way to execute a stored procedure from Cloud. Adding support for stored procedures is in our backlog. Could you expand on your use case for using the stored procedure as opposed to an Insert?

0 0
replied on May 14, 2020

My stored procedure does a number of other things.  All I have to do is pass 1 piece of data to my SP and the rest gets completed.  Is there no way to fire off a WF residing on an on-prem WF server from cloud (just a thought)?

Anthony 

0 0
replied on May 14, 2020

There is actually - on-prem WF has a web service API. You could invoke a workflow using a Cloud Web Request through a Remote Agent on-prem. Pass your "1 piece of data" as an input param to the on-prem workflow that then runs your SP.

--------------------

The Workflow Web Services REST API is fairly easy to use.

I've attached a simple demo with two workflows bundled in a .wfi file. The first makes a web service call to invoke the other and pass an input parameter. Had to tack a .txt on the .wfi to get around file extension upload restrictions, so remove that after downloading. Import to any on-prem Workflow server and run the "[Web Service] Invoking WF" manually to see the demo in action.

You can view the actual Workflow REST API reference by going to the following address on a Workflow server with Workflow Web Services configured:
http://localhost/Workflow/api/help

Documentation root:

Invoking instances:

Hope that's helpful for now!

1 0
replied on May 15, 2020

That's great news.  I have been messing around with this in cloud.  Do you have an example of how this would be setup in Cloud WF?

Anthony

0 0
replied on May 15, 2020

To set this up in the cloud you can do the following;

1) Set up a Remote Agent Worker on the machine running the workflow server. Ensure that you add the "Remote Web Service Plugin" to your Remote Agent's Queue;

 2) Set up a Web Service Connection (on the Integrations page in PA below Remote Agents tab) using the remote agent you configured, with the Base URL http://localhost/Workflow/api/ . When you click "test" you should get a 200 response code back;

 

3) Create the web request to start the workflow (Rules > Web Request). I made this simple one below that starts the workflow named "wf123" without passing any additional data, but you can include whatever information you need in the body

When you test you should get an instance ID back. Note that this will actually run the workflow..

4) Add the "Run Web Request Rule" activity to your cloud workflow and that will trigger the self hosted workflow to run

2 0
replied on May 18, 2020

My server response is 401.  I have tired "No Authentication" and "Authenticated" methods.

0 0
replied on May 18, 2020 Show version history

Are you able to access http://localhost/Workflow/api directly from a browser when you are logged into the machine where you installed the remote agent?

0 0
replied on May 18, 2020

Yes I can.

 

0 0
replied on May 18, 2020

Hmm, do you have other Workers for the same Remote Agent installed on a different machine?

0 0
replied on May 19, 2020 Show version history

No.  I have 1 Remote Agent running on this server with 2 queues (LF Remote Data Source and Remote Web Service)

No other Remote Agent is currently installed on any other server.

We can't use "Anonymous Authentication" as this server is also our Web Access front end website.  The authentication I am using is Windows Authentication.  My credentials are correct but I still get the 401 error.

0 0
replied on May 19, 2020

When you are adding credentials to the Web Service Connection those are the credentials that will be used to access the web service. You should not need to add credentials here because the remote agent is connecting directly from the local machine.

That said, adding credentials to your Web Service Connection in this case shouldn't prevent you from being able to connect successfully.

Can you open up a support case so that we can look at the specifics of your setup?

1 0
replied on May 20, 2020

Thanks.  I have opened a Support Case

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.