Many times it's important to be notified of events that happen on your Tableau Server. Perhaps an extract has succeeded and you want to trigger another workflow to start. Or perhaps you're interested to see what new workbooks get added to a certain project. You could of course manually check now and then to check for changes but that would be tedious. Or you could try polling your Tableau Server multiple times an hour and then track the changes to see if there are any updates. But that also doesn't seem like a good use of resources. Instead, you can leverage webhooks! Webhooks work in Tableau Server and Tableau Online and let you send out a POST request to a REST endpoint when certain events happen. To find a list of the types of events you can use with webhooks, look at the developer documentation. As of the writing of this post, they include events for data sources, workbooks, refreshes, and users.
In this tutorial, I'll show you how to set up a webhook that will send you a text message whenever an extract refresh fails. You won't need to write any code to get it set up and you can even use or try all the tools for free! Once complete, whenever an extract refresh fails your Tableau Server will send a message to a Pipedream workflow that will then send you a text message using Twilio.
Before we can create the webhook in Tableau Server we need to have an endpoint that we want the webhook messages to be sent to. This will be our middleman between Tableau Server and Twilio. Once you've signed up for a Pipedream account start by creating a new workflow.
https://123abc33e328fd43d6c5464e668.m.pipedream.net
. Make note of the endpoint as we'll need it in the next step.Now that we have somewhere to send our webhook messages let's set up the webhook in Tableau Server. To make this easy you can use the webhooks Postman collection provided in the Tableau webhooks documentation. Download the collection as well as the environment then follow the next steps to set it up.
server
variable. Make sure if you are using Tableau Online you include the pod, for example: https://10ax.online.tableau.com/
.username
and password
or a pat-name
and pat-secret
. You can set up a PAT (Personal Access Token) on your "My Account Settings" page within Tableau. Make sure to store it somewhere as you are not able to see it again once created.content-url
, this is the name you see for your site in the URL: https://10ax.online.tableau.com/#/site/myawesomesite/home
. So for example, your site name might be "My Awesome Site" but the content URL would be "myawesomesite".webhook-name
. Next, set your webhook-event
variable to DatasourceRefreshFailed
. (List of webhook events). And finally set the webhook-url
to the Pipedream endpoint you created previously. Remember it should look something like https://123abc33e328fd43d6c5464e668.m.pipedream.net
.Now that we are all set with the environment variables in Postman we can use the Tableau Webhooks Requests collection to easily set up the webhook.
webhook-id
. Save the environment then go back to the collections tab. Choose the "Test a webhook" request and click "Send". If it was sent and received successfully you should see "success" in the body and a 200 status. (Note: This may be different if you changed the default options of the Pipedream trigger.)Sid
, Secret
, and AccountSid
. Follow the Twilio instructions to create a new key, a Standard key is enough for this tutorial. Once you've obtained the key you can add the Sid
and Secret
inputs. Make sure to store the secret somewhere as you are not able to see it again once created. You can find your AccountSid
on your main Twilio dashboard. Once you have that entered select "Save".false
for each property you want to use in your message. For example: Uh oh! The data source failed to refresh at !
. You can see all the properties of a webhook message in the documentation.At this point, you can either resend the "Test a webhook" request in Postman to receive a message or you can set an extract refresh to fail (perhaps by changing the password in the connection settings to something incorrect) and then select "Run Now" in Tableau Server. Once you've done this you should receive a text message with information about the extract refresh failure!
Note: If you are running an earlier version of Tableau Server your test message may not include the properties as displayed here in this tutorial. You should test your setup by inducing a real extract failure instead of just the "Test a webhook" request
I hope you were able to use this tutorial to get started with webhooks and tools like Pipedream, Postman, and Twilio! This of course is the most basic notification you can set up with Pipedream. However, Pipedream allows you to customize the code for your pre-built action nodes or create your own custom code with Node.js to build out more complex flows. Some things you could do to expand on this tutorial would be to write code that sends a message only for certain data sources or changes the destination phone number based on the data source that failed. Let me know in the comments if you'd like to see more of these types of tutorials and if you were able to successfully set up your webhook!
Learned something new? Subscribe and never miss a new post!
Sign up to never miss a post!
Sign up to never miss a post!
Want me to cover a specific topic? Let me know!
Leave a comment