Dev Space

Customize and extend the power of Alteryx with SDKs, APIs, custom tools, and more.

Does Anyone know how to cache the Oauth Tokens for Alteryx API using Js

10 - Fireball

Hello I am Building an app called 'Gallery Runner' .Using HTML GUI SDK & Alteryx Server API. 


Intro about this app : This Tool (I call it Gallery Runner tool /Connector )let's you run multiple workflows in a Chained fashion , the workflows/Apps that got uploaded to gallery can be run in series or in parallel like this in image below .In below Image I uploaded 5 Diffent workflows in to Gallery and then use create a 6th workflow using this Tool/Connector to point all other 5 workflows . Which means you can run all 5 workflows in series or parallel based on how you configure ,if they success or failure etc..This uses Gallery serve API to run those 5 workflows . 


Issue : But the Tool takes time to load once configured ,from the debug found that the fact it login's everytime to Alteryx gallery API and generated Oauth Tokens . 


Looking : Do we have any examples that saves the ClientID and Client Credentails of gallery API that gets saved in to cache after login in to 1st workflow then re-use it for other ones ? 


I am using this attached GalleryRunnerAPI.js file to configure Gallery API and other app.js to configure login and GUI . 


Also there is one more issue . In Alteryx Desktop there is ''options-->user settings-->Advanced Tab --> check box for 'Diasable Auto Configure' this is causing issue , when this is unchecked the app loads okay ,if its checked the app takes much longer to open . Any IDea ?





Does Anyone know how to cache the Oauth Tokens for Alteryx API using Js  ? 




Please help. @NeilF  @tlarsen7572  @Coxta45  @SeanAdams  @StephenR 

11 - Bolide
11 - Bolide

First off, neat tool!  I like this idea a lot.


I know of no easy way to cache anything that can be used across multiple instances of a tool.  It might be possible to build something using temporary files.  It would be complicated and I couldn't comment on the security concerns, so I will suggest a different option before you try it.


What SDK have you used to build your engine?


What is happening here is that each time a tool configuration changes, Alteryx Designer runs the entire workflow using an 'UpdateOnly' mode that is meant to hydrate the workflow with field metadata.  I assume that, even in this update-only mode, your tools are actually connecting to the Gallery.  I also assume that the fields your tool generates are always going to be the same.


So I would recommend that when the workflow is being run in 'UpdateOnly' mode, your tools just send the known field info downstream and don't even try to connect to the Gallery.  Only when the workflow is being run 'for real' does it actually connect.  This should greatly speed up Designer.


Once we know what SDK you have used to build your engine, we can advise how to check when the workflow is being run in UpdateOnly mode.

10 - Fireball

@tlarsen7572  it’s html GUI sdk . The output is the tool is Alteryx api workflow run status .for example: success or fail etc ...

Alteryx Alumni (Retired)

@joeGade  are you still experiencing issues?



10 - Fireball

@TashaA  Yes Still looking for a solution . 

Alteryx Alumni (Retired)

It sounds like you want to authenticate in the first tool and then pass that auth token to the subsequent workflows. 


I look at this type of problem as where can I add that piece of data (the token) to a tool. Each tool has its own instance of javascript and cannot really share variables amongst each other. 


One idea that I have:  

  • Pass the token as output of the tool 
    • This would be optional output, you could even use a separate anchor 
    • You would have to add logic to your tool to check for the presence of the token from an upstream tool, and use that instead of performing the authentication action
    • You would also need to adjust the logic to pass the token (if present) as output of the tool