How-to guideApplies to: Unified engine deployments
Save reusable SQL without executing it. The workspace service must be enabled.
Save a reusable query
Save SQL as a workspace document, then read its recorded revision. Creating a document does not execute its SQL.
Replace the placeholders in your client. Keep returned IDs for later requests. Paths below use the native API prefix; adjust it for your deployment.
1. Save the query
From the response, keep document_id from /document/document_id.
Endpoint reference.
2. Read the saved query
Endpoint reference.
Creation returns the document ID and revision. The next request reads the same saved document. Verify its name, SQL, settings, and revision.
Edits need the current expected revision and a new submission identity. Deletion removes the saved document; it does not undo earlier SQL executions or delete source tables.
Use session operations to execute SQL. Saving a document and executing a query are separate actions.Last modified on November 4, 2026