Save Workbook
Saves the workbook currently open in Tableau Studio. Omit filePath to write it in place at the path it already has, or pass an absolute .twb or .twbx path to save a copy there. A workbook that has never been saved has no path, so omitting filePath then opens the Save As dialog and blocks until a person responds — pass filePath to save it headlessly.
This tool is not read-only, but it is idempotent. It writes the open workbook to disk in the live Tableau Studio session; repeating the call after a successful save is a no-op.
APIs called
This tool acts on the workbook open in the running Tableau Studio instance, not on the Tableau Cloud or Tableau Server REST API. Under the hood these are calls to the local Tableau Studio External Client API — a REST API the running Tableau Studio instance serves at http://127.0.0.1:<port>/v<x>, where <x> is the latest API version. There are no OAuth scopes: each call is authorized by the running Tableau Studio instance's per-session bearer token over the loopback interface.
- Settles on which Tableau Studio session to target before anything is sent. Resolved in-process (not an API call).
- Asks Tableau Studio to save the open workbook. When
filePathis omitted the request body is an empty JSON object, which saves in place at the workbook's current path; whenfilePathis supplied the body is{ "filePath": "..." }, which writes a copy there. Requires a connected Tableau Studio session with an open workbook; authorized by that session's loopback bearer token.POST /v<x>/workbook:save— save the open workbook in place, or save a copy tofilePath. API reference
- After a save that has finished, reads whether the workbook still has unsaved changes. A finished save can still be a no-op — for example when the Save As dialog was dismissed — so the tool confirms the write this way rather than trusting the save status alone. This read is skipped when the save is still being applied. Requires a connected Tableau Studio session; authorized by that session's loopback bearer token.
GET /v<x>/workbook— read the open workbook's metadata, including whether it still has unsaved changes. API reference
Optional arguments
session
Identifier of the target Tableau Studio session. When omitted, the session is resolved automatically (for example, when exactly one Tableau Studio instance is connected).
Example
"studio-1"
With no session given and no Tableau Studio instance running, or more than one running, the tool reports an error rather than picking one; the multiple-instance error lists the session IDs to choose from. A session that names an instance which is not among the running ones is refused the same way.
filePath
Absolute path to save a copy of the open workbook to. Type: string. Minimum length: 1. The path must end in .twb or .twbx; Tableau Studio writes workbook content as-is without converting, so any other extension is rejected rather than writing a mislabeled file. Omit this argument to save in place at the workbook's current path.
Example
"/Users/me/Copy.twbx"
A workbook that has never been saved has no current path. Omitting filePath in that case leaves nowhere to write, so Tableau Studio opens its native Save As dialog and the call blocks until a person responds. Pass filePath to save that workbook headlessly.
If the person dismisses the dialog without choosing a path, Tableau Studio can still report the save as complete. The tool then reads whether the workbook still has unsaved changes; when it does, the result says the workbook was not saved rather than claiming success.
Notes and caveats
- A request that has been accepted but not finished is reported as such. When Tableau Studio answers before the save has settled, the result says saving was requested and is still being applied instead of claiming it completed.
Example results
Saved in place (filePath omitted)
{ "message": "Saved the open workbook." }
Saved a copy (filePath supplied)
{ "message": "Saved a copy to \"/Users/me/Copy.twbx\"." }
Accepted, still being applied
{ "message": "Requested saving the workbook; Desktop is still applying it." }
Save As dismissed (unsaved changes remain)
{ "message": "Tableau reported the save as complete, but the workbook still has unsaved changes, so it was not saved (the Save As dialog was likely dismissed)." }
Related
open-file— opens a local workbook or datasource file in Tableau Studio.workbook-export-as— writes a PDF, PowerPoint, packaged, or prior-version copy without changing the open document.undo-redo-workbook— reverses the most recent change to the open workbook.