From Tableau REST¶
Move scripts that call Tableau REST flow-run, flow-task, linked-task or flow-schedule endpoints to the Flow Scheduler API.
The Flow Scheduler API does not follow Tableau's URI or XML shape, so you rewrite each call; you do not re-point the script at a new host.
Before you begin¶
- The Flow Scheduler is switched on and running, and the environment is enabled for it (see Allowed Environments).
- You have an API client token for the script (see Manage API Clients). For a non-admin client, bind a Tableau user (
tableauUsername) that may run the flows. - You know the MetaMiner environment id or name, the Tableau site LUID and the flow LUIDs.
- The tasks, chains and schedules the script refers to exist in the Flow Scheduler. Their ids are Flow Scheduler ids (see Import Tasks from Tableau).
Steps¶
- Replace the Tableau sign-in call. The Flow Scheduler API has none: send
Authorization: Bearer <token>on every call tohttps://<mms-host>:<port>. - Replace each Tableau call with its Flow Scheduler call from the table below.
- Move the site from the URI into the request:
sitein the body ofrunflow, orsite=on task and chain calls. Addenvto every run, task, chain and schedule call; onGET /fss/v1/runs/{runId}and cancel it is optional. - Rename the body fields:
flowParameterSpecsbecomesparameters,flowOutputStepIdsbecomesoutputSteps,flowRunModebecomesrunMode. - Replace Tableau ids with Flow Scheduler ids for tasks, chains, schedules and runs. Flow LUIDs and site LUIDs stay Tableau's.
- Read JSON instead of XML, and map the run status values (see Flow Scheduler API).
| Tableau REST call | Flow Scheduler API call |
|---|---|
POST flows/{id}/run (flowParameterSpecs, flowOutputStepIds, flowRunMode) |
POST /fss/v1/runflow (parameters, outputSteps, runMode) |
POST tasks/runFlow/{id}/runNow |
POST /fss/v1/runtask with {"taskId": N} (Flow Scheduler task id) |
POST tasks/linked/{id}/runNow |
POST /fss/v1/runtask with {"linkedTaskId": N} |
GET flows/runs/{id}, GET jobs/{id} |
GET /fss/v1/runs/{runId} |
GET flows/runs?filter=... |
GET /fss/v1/runs?env=...&status=...&startedAfter=... |
PUT flows/runs/{id} (cancel) |
POST /fss/v1/runs/{runId}/cancel |
GET tasks/runFlow, GET tasks/runFlow/{id} |
GET /fss/v1/tasks |
PUT schedules/{id}/flows (add a flow task) |
POST /fss/v1/tasks |
GET tasks/linked, GET tasks/linked/{id} |
GET /fss/v1/linkedtasks, GET /fss/v1/linkedtasks/{id} |
GET, POST, PUT, DELETE schedules (type Flow) |
/fss/v1/schedules |
PUT schedules?state=Active or Suspended (batch) |
POST /fss/v1/schedules/enabled |
tabcmd runschedule "<schedule>" |
POST /fss/v1/schedules/{id}/runnow |
# Tableau: POST /api/<version>/sites/<site-luid>/flows/<flow-luid>/run
curl -sS -X POST "https://<mms-host>:<port>/fss/v1/runflow" \
-H "Authorization: Bearer <token>" -H "Content-Type: application/json" \
-d '{"env": "<envId>", "site": "<site-luid>", "flowLuid": "<flow-luid>",
"parameters": [{"name": "Region", "value": "East"}], "runMode": "full"}'
# Tableau: POST /api/<version>/sites/<site-luid>/flows/<flow-luid>/run
$body = @{ env = "<envId>"; site = "<site-luid>"; flowLuid = "<flow-luid>"
parameters = @(@{ name = "Region"; value = "East" }); runMode = "full" } | ConvertTo-Json -Depth 4
Invoke-RestMethod -Method Post -Uri "https://<mms-host>:<port>/fss/v1/runflow" `
-Headers @{ Authorization = "Bearer <token>" } -ContentType "application/json" -Body $body
Known differences¶
| Topic | Flow Scheduler API |
|---|---|
| Sign-in | No sign-in call: an API client bearer token on every call |
| Format | JSON only, no XML |
| Site | site in the body or query, not in the URI |
| Ids | Flow Scheduler numeric ids for runs, tasks, chains and schedules; a run also reports Tableau's tableauJobId and tableauFlowRunId |
| Who runs the flow | The environment's service account. A non-admin client's bound Tableau user must be allowed to run the flow; the audit records the API client. |
| Run history | Runs the Flow Scheduler started; runs started elsewhere in Tableau are not listed |
| Permission changes | A Tableau permission change can take up to a minute to reach the run-permission check |
Verify¶
- Call
GET /fss/v1/infowith the script's token:200. - Run one flow with
"wait": trueon a test environment:200withstatussuccess. - Find the run with
GET /fss/v1/runs?env=<envId>&triggeredBy=<client-name>.
Troubleshooting¶
403 RUN_FORBIDDEN
The client is not an admin client and its bound Tableau user may not run the flow, or no Tableau user is bound, or trusted authentication is not set up on Tableau Server. Bind a user with run permission, or use an admin client.
404 ENV_NOT_FOUND
The env value is not an environment enabled for the Flow Scheduler. Check the id or name and Allowed Environments.
409 NOT_LEADER
The call reached the standby node of a high-availability pair. Send it through the load balancer or to the leader named in leader.
More codes: Status Codes and Errors.