Newer Version Available

This content describes an older version of this product. View Latest

Run, Schedule, and Sync Tableau CRM Data with REST APIs

You can use the Tableau CRM REST API to automate features, like running and scheduling data syncs, dataflows and recipes.

Start and Stop a Dataflow Job or Recipe

You can use REST APIs to automate the start of a dataflow job or recipe to load data into datasets. This API is the equivalent of the "Run Now" functionality in the Data Manager. You can also stop the job while it’s running. Dataflow jobs include dataflows defined in wave/dataflows and recipes defined in wave/recipes.

You can use the Lightning Web Component lightning/analyticsWaveApi module to access wire adapters and functions to bring this functionality into Salesforce, without proxying the REST APIs directly. For more information, see the reference section for lightning/analyticsWaveApi Wire Adapters and Functions .

Note

Start a Dataflow Job or Recipe

To start a dataflow or recipe, use the /wave/dataflowjobs endpoint with a POST request. In the POST request body, use the dataflowId parameter to specify the dataflow to start. For a recipe, use the targetDataflowId value for the dataflowId.

1{
2  "dataflowId": "02KS700000004G3eMAE",
3  "command" : "start"
4}

The POST request returns a DataflowJobRepresentation.

Note: When you run a dataflow or recipe using this method, the data sync of associated objects runs automatically, if the sync has not previously run or has been updated since the last run.

Stop a Dataflow Job or Recipe

To stop a specific dataflow job, use the /wave/dataflowjobs/<dataflowjobId> endpoint with a PATCH request. The PATCH request uses the dataflowjobId request parameter to specify the dataflow job to stop.

1{
2  "command" : "stop"
3}

Explore Dataflow Job Nodes

You can use REST APIs to describe and explore each node of a dataflow job. This includes nodes for standard dataflows and for recipes.

View All Dataflow Job Nodes

To list the nodes for the dataflow job, use the /wave/dataflowjobs/<dataflowJobId>/nodes endpoint with a GET request.

The GET request returns a DataflowJobNodeCollectionRepresentation.

Note: This request only works for dataflow jobs with ids starting with 030, 03C, or 0eP. If the dataflow job id starts with 030, the result is an empty collection.

View a Single Dataflow Job Node

To view the details of a single dataflow job node, use the /wave/dataflowjobs/<dataflowJobId>/nodes/<nodeId> endpoint with a GET request.

The GET request returns a DataflowJobNodeRepresentation.

Schedule Dataflows, Recipes, and Data Syncs

You can automate dataflows, recipes, and data syncs to run on a time-based schedule by hour, week, or month, on specific days of the week, or dates in the month via the Tableau CRM REST API. For example, schedule a dataflow to ensure that the data is available by a particular time or to run the job during non-business hours. Use the assetId request parameter to specify the data asset type to schedule.

You can also set an event-based schedule to run a dataflow or recipe after the Salesforce Local connection syncs. Set an event-based schedule if the dataflow or recipe extracts data from Salesforce objects that have to sync before the dataflow or recipe runs. The event-based schedule applies to dataflows and recipes only and isn’t currently available for data syncs.

Schedule a Data Asset

To schedule a data asset, use the /wave/asset/<assetId>/schedule endpoint with a PUT request. The following are examples for the different types of schedules that can be set in the request body.

Set Hourly Schedule - request body example

This request body sets a time-based schedule that runs hourly every day from 2:30am America/Los Angeles, every 3 hours, and stops queuing at 8:00pm.

1{
2  "daysOfWeek" : [
3    "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
4  ],
5  "lastHour" : 20,
6  "hourlyInterval" : 3,
7  "time" : {
8    "hour" : 2,
9    "minute" : 30,
10    "timezone" : "America/Los_Angeles"
11  },
12  "frequency" : "hourly"
13}

Set Weekly Schedule - request body example

This request body sets a time-based schedule that runs weekly on Mondays and Thursdays at 12:45am America/Los Angeles.

1{
2  "daysOfWeek" : [
3    "Monday", "Thursday"
4  ],
5  "time" : {
6    "hour" : 0,
7    "minute" : 45,
8    "timezone" : "America/Los_Angeles"
9  },
10  "frequency" : "weekly"
11}

Set Monthly Specific Schedule - request body example

This request body sets a time-based schedule that runs monthly on the 1st, 15th, and 31st at 12:00am America/Los Angeles.

1{
2  "daysOfMonth" : [
3    1, 31, 15
4  ],
5  "time" : {
6    "hour" : 0,
7    "minute" : 0,
8    "timezone" : "America/Los_Angeles"
9  },
10  "frequency" : "monthly"
11}

Set Monthly Relative Schedule - request body example

This request body sets a time-based schedule that runs every month on the last Sunday at 12:00am America/Los Angeles.

1{
2  "weekInMonth": "Last",
3  "dayInWeek": "Sunday"
4  "time" : {
5    "hour" : 0,
6    "minute" : 0,
7    "timezone" : "America/Los_Angeles"
8  },
9  "frequency" : "monthlyrelative"
10}

Set Event-Based Schedule - request body example

This request body sets an event-based schedule that runs a dataflow after the Salesforce Local connection syncs. Event-based schedules aren’t supported for Data Connections.

1{
2  "triggerRule" : "$ALL_SALESFORCE_OBJECTS",
3  "frequency" : "eventdriven"
4}

The PUT request uses the assetId request parameter to specify the dataflow, recipe, or data sync to schedule.

1/services/data/v/wave/asset/02KS7000000xxxxxxx/schedule

The PUT response is empty unless there’s an API error.

The DELETE request uses the assetId request parameter to specify the dataflow, recipe, or data sync schedule to delete.

Sync Data Connections

Use the Tableau CRM REST API to automate syncing connected data from your local Salesforce org or external data sources. Synced data is stored as objects that can be used in dataflows and recipes. This API is the equivalent of the "Run Now" functionality in the Data Manager.

Data Sync Run Now
To start a data sync, use the/wave/dataConnectors/<connectorIdOrApiName>/ingest endpoint with a POST request. Execute the POST to the URL with an empty request body.
1{}

The POST request uses the connectorIdOrApiName request parameter to specify the data sync to run.

1/services/data/v/wave/dataConnectors/0ItS0000000xxxxxxx/ingest

The POST request returns a RestoreDatasetVersionRepresentation.