In case you missed the announcement: Alteryx One is here, and so is the Spring Release! Learn more about these new and exciting releases here!
Free Trial

Alteryx Server Discussions

Find answers, ask questions, and share expertise about Alteryx Server.
SOLVED

Alteryx Gallery API - Running Work flow under another user

subiemf
5 - Atom

Greetings everyone,

 

i wonder if there way i can run workflow using API under the user utilizing the API

 

i can figure it his name and email for the user before invoking the API and am using windows auth,

 

the problem running these workflow from API it goes under my admin account where it should be under the user running it.

 

my goal i want to pass the userid somehow to run the workflow under that user  job execution queue not the admin API

 

any idea how to achieve this?

 

 

post /v3/workflows/{workflowId}/jobs Creates a new job and adds it to the job execution queue

 

 

4 REPLIES 4
KGT
12 - Quasar

I don't have a gallery to screenshot, but you can select run options on the workflow, as to how that workflow is intended to execute. When you call it via the API you can specify some of those conditions.

subiemf
5 - Atom

Hi KGT,

 

ty for your reply ,

 

in the api call there is body request no of these related to userid 

the below are the run options :

 

{
"workerTag": "string",
"credentialId": "string",
"questions": [
{
"name": "string",
"value": "string"
}
],
"priority": "Default"
}

gawa
16 - Nebula
16 - Nebula

@subiemf If you want to run WF on the Server via API with specific user account(say User-A), you can use "credentialId". To do so, you need to do some steps:

(1) In Gallery admin menu, go to Credential and add credential of User-A. It requires password of User-A so let User-A operate it from remote via online call or something.

(2) For the added Credential of User-A, share it to your account so that you are eligible to use Credential of User-A

(3) When calling Server API post /v3/workflows/{workflowId}/jobs, specify id of Credential of User-A in "credentialId".

 

Please note that:

- Sharing credential of user accounts to others is not good practice in terms of governance. Consider to create system account instead, and apply the above step replacing User-A with system account.

- In general, WFs on the Server is callable only when the owner of WF and the owner of API key is the same. In other word, we cannot execute WFs by others via API, even if those are shared in the Collection.

subiemf
5 - Atom

Thank you so much gawa !