Pull a result with SQL, then ask Claude to write the Python cell that charts or joins it, referencing the prior cell's output directly.
No credit card. 14 days. Cancel in one click.
Quick answer: In a Flow Books notebook, focus a cell and click Ask (or ⌘L), then describe what that cell should do. Claude writes SQL or Python depending on the cell type, and can reference outputs from cells that already ran in the same session, so a chart cell can use a SQL cell's result by name with no export step in between.
You'll need a Flow Books notebook open against a connection, and an API key added in Settings if you want Claude to write cells rather than typing them by hand.
Pull a result with a SQL cell against a Redshift connection:
SELECT date_trunc('week', event_date) AS week,
count(*) AS signups
FROM public.signups
GROUP BY 1
ORDER BY 1;
Then, on a Python cell, ask Claude to chart the signups-by-week result as a line plot. It writes a pandas/matplotlib cell using that result, so you're not exporting to a CSV and reimporting it into a separate notebook just to plot one number.
Run the cell. If the chart reflects the real numbers from the SQL cell above it rather than placeholder data, it picked up the right result. If it can't find what you're referring to, mention the prior cell more specifically, by what it queried, not just "the last result."
| If you see | Fix |
|---|---|
| The cell references data that doesn't match the prior query | Be specific about which cell's result you mean, especially in a notebook with several SQL cells. |
| A chart with the wrong columns plotted | Say which column you meant explicitly instead of accepting the default guess. |
| Python cell fails on a missing package | Flow Books ships common data packages by default; an unusual one may need a roadmap request. |
| The generated SQL cell uses the wrong table | Check the explorer for the exact table name and mention it directly in your question. |
Quick joins between a SQL result and something else, a CSV, a second query, a hand-typed list, without leaving the notebook. It's not meant to replace a full data science environment; it's meant to remove the export-and-reimport step between a query and a chart or a quick calculation.
Flow Books and the SQL editor's Ask panel use the same underlying model and key, they're two surfaces for the same feature. Use the editor for a single query and its answer; use Flow Books when the next step is Python, a chart, a join with a file, or a few queries chained together in one document.
Say you have a SQL cell pulling customer IDs and lifetime value from Postgres, and a separate CSV of account managers by customer ID that isn't in the database at all. Load the CSV as a connection, then ask a Python cell to join the two on customer ID and show the top account manager by total lifetime value. Claude writes the pandas merge using both sources, something you'd otherwise do by exporting one side to a spreadsheet and doing the lookup by hand.
Since each cell's code is visible and editable, a notebook Claude helped write isn't a black box, anyone opening it later can read exactly what ran, adjust a filter, and re-run it. That matters more the longer a notebook sticks around as a working reference rather than a one-off scratchpad.
It can reference a prior cell's result when you mention it in your question, the same schema and result context the Ask panel uses elsewhere in QueryFlow carries into Flow Books.
Yes, matching whichever cell type you're working in, SQL grounded in the connection's schema, Python using standard pandas patterns.
Flow Books is part of Studio and above, the same tier as the SQL editor and Ask panel.
Yes, a CSV or Excel file added as a connection works the same as any other source inside a Flow Books notebook.
Describe the correction directly rather than rewriting from scratch, the same follow-up pattern as the Ask panel in the SQL editor.
14-day free trial, no card. Open Flow Books and try your first cell.
No credit card. 14 days. Cancel in one click.