Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Run workflow by making API call

craigja
10 - Fireball

Hi,

 

Im trying to trigger a workflow to run on the server - this is a very basic test, doesnt have any parameters or anything, all it actually does is send me an email saying 'Hello world'!  What Im wanting to eventually be able to do is make this call to the API via a button on a Microsoft PowerApp so that everything is kept in one place for my users, but for now I want to test the call with the download button so I know it all works.

I have managed to get an authorisation token etc but Im struggling with how to configure the download tool to make the API call - I believe I want to pass in 

POST /v1/workflows/{appId}/jobs/

But where do I set this?  And has anybody done this from Microsoft PowerApps as that will be the next challenge!  I dont even know how to go about authorising to the server from PowerApps

5 REPLIES 5
OllieClarke
15 - Aurora
15 - Aurora

Hi @craigja 

I'd recommend using the inbuilt API documentation. 
If you click the help icon, and then API documentation on your server
image.png

You can then authenticate and try these endpoints.

 

I used the v3 endpoint to run a workflow. You get the CURL command which is easy to translate into a download tool

curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'Authorization: Bearer <my token>' -d '{ \ 
   "workerTag": "", \ 
   "credentialId": "", \ 
   "questions": [], \ 
   "priority": "Default" \ 
 }' 'https://<serverurl>/webapi/v3/workflows/<workflowid>/jobs'


The endpoint has 2 requirements, the workflowid (which is in the URL) and also a contract (which is posted to the endpoint).
The setup I've shared above is for a bog standard run of a workflow with no interface tools (the empty array of questions), no specific workerTags, credentials or priority.


The setup of the download tool is like this:
Headers TabHeaders TabBasic TabBasic TabPayload TabPayload Tab

Here's the workflow - I've built everything out, so you can see how it works for powerApps; but the V3 server macro pack or the new Server API tool both make this a lot easier (in Alteryx)


image.png

Hope that helps,

 

Ollie

craigja
10 - Fireball

Brilliant!  Thanks for doing that for me, will be much easier to see whats going on and translate over to PowerAutomate

SPetrie
13 - Pulsar

Is your gallery accessible outside your work network? If you have to be on the VPN in order to access your gallery, you are going to run into some issues with getting PowerAutomate to talk with it. Its doable, but its more of an annoyance and requires a premium connector. I have PowerAutomate setup to make API calls to my gallery, but since I can only access while on VPN, I had to go with the more difficult route.

craigja
10 - Fireball

Good point!  Ours will only be visible inside our network, we do have PowerAutomate Gateways installed but our network is locked down, its probably not worth carrying on with this for now as the users have not requested this! I was just experimenting 

SPetrie
13 - Pulsar

If you have an on-premises data gateway, you can use it to get to the gallery server.

The HTTP With Microsoft Entra ID (Preauthorized) tool allows you to connect through the gateway to send your API commands. 

It requires premium licensing though. If you have both those things, them most of the annoying part is done. After that its a few workflows to get up and running. Someone asked a similar question on Reddit a while back and I gave a brief overview of how I went about solving it there. If you do decide to go that route, let me know and I can try to be of assistance.

Labels
Top Solution Authors