We call this the Alteryx Server API Connector macro. This macro enables us to run applications and workflows that are already hosted on Alteryx Server. All you need to know are the application/workflow id and the questions that are passed to the application (if applicable).
To find the app/workflow ID, navigate to the app you want to run on Alteryx Server. The string after the last backslash in the URL, is the ID.
Another way to do this is by navigating to the Alteryx Server API Docs. Reference this link, https://help.alteryx.com/developer-help/gallery-api-overview, for more information on how to reach the API Docs.
Navigate to the ‘Subscription’ tab and enter your API Key and Shared Secret:
Once this is done select GET /v1/workflows/subscription/ and then select ‘Try it out!’. In the ‘Response Body’ you can search for the workflow you want to run using this macro and isolate its ID value.
Once you have this ID, you are ready to gather the question information about that app/workflow! Select GET /v1/workflows/{appId}/questions/, enter the app ID into the text box, and hit ‘Try it out!’
Copy the text returned in the ‘Response Body’ and save it for later use. To format the returned response body to correctly pass into the app follow the below example.
Step 1: Example of returned response body
[
{
"name": "Drop Down (17)",
"type": "QuestionListBox",
"description": "APPROVER NAME:",
"items": [
{
"key": "[None]",
"value": ""
},
{
"key": "joe.smith",
"value": "joe.smith"
},
{
"key": "ted.fred",
"value": "ted.fred"
}
],
"multiple": "False"
}
]
Step 2: To run this app in Designer with the selected drop down value of ‘joe.smith’ you need to format your string to look like the below response.
[{
"questions": [
{
"name": "Drop Down (17)",
"value": "joe.smith"
}
]
}]
Now open the attached workflow! In the provided textbox you can enter your App Id & modified question values that you want to send to the app.
Select the macro and click on the ‘Questions’ tab in the Configuration window. Enter your API Key, API Secret, and Alteryx Server URL. To construct the needed Alteryx Server URL use this schema: {serverBaseAddress}/api/{endpoint version}. An example of this is “https://gallery.alteryx.com/api/v1/”
That’s it! Hit ‘Run’ and you will see the app running on your Alteryx Server instance! Our team uses this, often in place of chained apps, to kick of different apps after certain conditions in the workflow are met.
An example for our team of this is in use is our Alteryx Server hosted request system (see reference diagram below). After a request is approved by the appropriate party, we automatically action the specific request type by kicking it off with this Alteryx Server API Connector macro.