Sana’s code execution feature brings powerful data analysis and visualization directly into your workspace. Whether you’re working with spreadsheets or other structured data, Sana automatically handles the technical steps so you can focus on getting insights, no external tools or coding expertise required.
How to use Code Execution
No special mode required: Simply upload a spreadsheet, attach a relevant file, or reference data from your integrations.
Ask in natural language: Describe what you want (e.g., “Show yearly sales totals” or “Plot deals per region”).
Automatic analysis: Sana will determine if code execution is needed to respond to your query, securely run the analysis in the background, and present the results, such as tables, summaries, or visualizations, directly in your chat.
Follow the process: As the agent works, you can follow its train of thought and see each step it takes by pressing on the messages that are streamed in real time. Once the task is complete, you’ll see a “Done” indicator. Clicking it lets you review the agent’s reasoning process and view the exact code that was executed. You can copy this code for your reference or further use.
Export & share results: Plots generated during code execution can be downloaded as image files. Additionally, you can put your results into a doc, which you can edit, share, download, or export to Google Docs or Microsoft Word (more information here).
Example Use Cases
Summarize and visualize spreadsheet data (totals, averages, trends).
Generate charts and graphs for business metrics.
Analyze CRM exports, sales pipelines, or operational reports.
Process data from integrations like Google Drive or internal databases.
Chain together search and analysis (e.g., “Find this file, then plot deal size by year”).
These are just starting points, Sana’s code execution is designed to be flexible and powerful. We encourage you to experiment and find your own workflows and use cases.
Frequently Asked Questions
Q: Do I need to write code or select a tool?
A: No—just upload your data or ask your question. Sana automatically handles the technical details .
Q: Can I see or reuse the code that was run?
A: Yes. At the end of each analysis, you can press “Done” to view and copy the generated code from the agent’s thinking process.
Q: Can I download the results?
A: You can download generated plots as images. For other results, you can create a doc for editing, downloading, or exporting to Google Docs or Word.
Q: Is my data secure?
A: Yes. Each code execution runs in a secure, isolated environment unique to your workspace .
Q: What kinds of data does it support?
A: Currently, code execution works best with structured data like spreadsheets (CSV, Excel) and data from integrations. More formats will be supported over time.
If you have questions or need help, contact [email protected].