Newer Version Available

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

Run, Schedule, and Sync Einstein Analytics Data with REST APIs

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

Start and Stop a Dataflow Job

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

Start a Dataflow Job

Use the /wave/dataflowjobs endpoint with a POST request to start a dataflow. In the POST request body, use the dataflowId parameter to specify the dataflow to start.

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

The POST request returns a DataflowJobRepresentation.

Note: When you run a dataflow 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

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

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

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 Analytics 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 after the Salesforce Local connection syncs. Set an event-based schedule if the dataflow extracts data from Salesforce objects that have to sync before the dataflow runs. The event-based schedule applies to dataflows only and is not currently available for recipes or data syncs.

For recipes, the recipe must be run once to create an associated dataflow. A recipe cannot have a schedule until the initial run in complete.

Schedule a Data Asset

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

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 are not supported for Recipes or 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/v48.0/wave/asset/02KS7000000xxxxxxx/schedule

The PUT response is empty unless there is 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 Analytics 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
Use the/wave/dataConnectors/<connectorIdOrApiName>/ingest endpoint with a POST request to start a data sync. 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/v48.0/wave/dataConnectors/0ItS0000000xxxxxxx/ingest

The POST request returns a RestoreDatasetVersionRepresentation.