Skip to main content
How-to guideApplies to: Unified engine deployments
Create an inline SQL notebook, open its SQL kernel session, execute a cell, read outputs, and close the session. The notebook service and SQL kernel must be enabled.

Run an inline SQL notebook

Create a saved notebook, open a SQL session, run its cell, inspect outputs, then close its session. 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. Create a SQL notebook

From the response, keep notebook_id from /notebook/notebook_id, notebook_revision from /notebook/revision. Endpoint reference.

2. Open the SQL kernel

From the response, keep notebook_session from /session/session_id. Endpoint reference.

3. Run the notebook

From the response, keep notebook_run from /run/run_id. Endpoint reference.

4. Follow cell execution

From the response, keep execution_id from /run/cells/0/execution_id. Repeat this read until /run/status reaches a terminal state: Succeeded, Failed, Cancelled, OutcomeUnknown, Skipped. Endpoint reference.

5. Read cell outputs

Endpoint reference.

6. Close the notebook session

Endpoint reference. The document follows the notebook JSON format. Creation returns a notebook identity and revision. Session creation returns a notebook session identity, which is different from an interactive SQL session ID. Follow the notebook run. Read the returned cell execution IDs before requesting cell outputs or events; a document cell ID is not an execution ID. The sample query should return three category totals: Books 60, Games 45, and Garden 35. Close the notebook session after execution finishes. Keep or delete the saved notebook using its current revision. If you export it, choose whether outputs should be included; retained outputs can make the export much larger.
Last modified on November 4, 2026