Notebook Manager Tools
Notes in Genbots act as modular building blocks for workflows. They encapsulate tasks such as querying databases, performing data transformations, or running advanced analytics, making processes reusable, maintainable, and scalable.
Overview
Tool Name
Purpose
This tool allows genbots to manage notebooks by creating, updating, or deleting notes and configurations. It is essential for organizing structured documentation, workflows, and operational instructions.
Functions Available
-
_manage_notebook
: Create, list, update, or delete notes or process configurations -
create_note
: Creates a new note with detailed content and parameters. -
update_note
: Modifies the content, configuration, or metadata of an existing note. -
delete_note
: Permanently deletes a note from the system. -
list_notes
: Lists all available notes, including details like type and identifiers. -
get_note_details
: Retrieves the full content and metadata of a specific note by its ID. -
execute_note
: Runs the embedded SQL, Python logic, or processes stored in a specified note.
Key Features
Note Creation
Create new notes with detailed content tailored to specific processes or workflows.
Note Configuration
Update and manage existing notes for maintaining relevant and accurate documentation.
List All Notes For Genbot Workflows
List and delete notes to optimize notebooks for active workflows.
Input Parameters
_manage_notebook | Manage Notebook | |
---|---|---|
Input Parameters | Definition | Format |
Action | Defines the operation to be performed. | String ("CREATE" , "UPDATE" , "DELETE" , "LIST" ) |
"CREATE" | Creates a new note. | - |
"UPDATE" | Updates an existing note with revised content. | - |
"DELETE" | Deletes an existing note from the notebook. | - |
"LIST" | Lists all currently available notes and configurations. | - |
note_id | (Required for updates and deletions) A unique identifier for the note. | String |
note_name | A meaningful name for the note (e.g., “Monthly Report Process”). | String |
note_type | Defines the note’s type. | String ("process" , "sql" , "snowpark_python" ) |
note_content | The actual content of the note, including instructions or configurations. | String |
note_params (Optional) | Parameters associated with the note for custom execution. | String |
create_note | Create a Note For Genbot Use |
---|---|
Input Parameters | Definition |
note_id | Unique ID for the note (e.g., note-abcdef123 ). |
note_name | Human-readable name for the note (e.g., Database Query Guide ). |
note_type | The type of note, such as process , snowpark_python , or sql . |
note_content | The text content of the note (e.g., SQL query or process description). |
note_params | (Optional): Parameters required by the note, provided as key-value pairs. |
update_note | Update Note Instructions |
---|---|
Input Parameters | Definition |
note_id | Unique ID of the note to update. |
update_details | Fields to modify, such as content, name, or parameters. |
delete_note | Note Deletion |
---|---|
Input Parameters | Definition |
note_id | Unique string identifier for the note being deleted. |
list_notes | List All Available Notes |
---|---|
Input Parameters | Definition |
N/A | No parameters required; retrieves all types of notes stored in the system. |
get_note_details | Update Note Instructions |
---|---|
Input Parameters | Definition |
note_id | Specifies the note to retrieve in full. |
execute_note | Genbot Note Use |
---|---|
Input Parameters | Definition |
note_id | Specifies the unique identifier of the note to execute. |
Genbot Tip
Validate note parameters for compatibility with their intended use case, such as SQL or Python snippets.
How It Works
Users create, update, or delete notes within a notebook structure. Notes act as modular building blocks for workflows. They encapsulate tasks such as querying databases, performing data transformations, or running advanced analytics, making processes reusable, maintainable, and scalable.
Reminder
Deleted notes cannot be retrieved unless backed up elsewhere.
Structure of the Note
-
Note ID: Each note is assigned a unique identifier for execution.
-
Note Name: A human-readable title, such as ” XYZ Report Results”, is used to make the purpose clear.
-
Note Type:
sql
,snowpark_python
- Select SQL for querying databases or Snowpark Python for calculations and programmatically processing the data.
-
Note Content: For SQL: Ensure the query fetches all necessary fields, applies appropriate conditions and filters, and uses proper joins (if needed). For Snowpark Python: Structure the logic in reusable functions for calculations or data wrangling.
-
Parameters (if any): Allows flexibility for input values to modify or tailor queries dynamically.
Step-by-Step: How to Create a Note Using Notebook Tools
The example we will be using will be creating the note used in the “Autonomous Actionable Data Analysis” example.
Step 1: Start By Asking To Create A New Note
Step 2: Provide The Note Details
We provided the above because:
1. Uses a consistent naming convention that highlights the objective. Upon note creation, the note ID will be automatically populated following a naming convention such as <bot_id>_<task_name>_<random_id>
2. we selected SQL as the note type for querying databases.
3. we ensured the query fetches all necessary fields, applies appropriate conditions and filters, and uses proper joins (if needed).
4. If variability is needed, create placeholders for values such as QUARTER
or CAMPAIGN_ID
using Genbots parameter variables.
Example:
-
Parameterized SQL:
WHERE QUARTER = ${quarter}
-
Parameter:
quarter = 2024Q2
Note: For this specific note we want to create a static reusable SQL query that the Genbot can’t change when processing.
- Upon creation of the note, we can now choose to also include it within an autonomous process if needed. To learn more about creating an autonomous process refer to the “How To Use Process Runner Tools” section.
Step 3: Testing The Created Note
Now that the note has been successfully created, you can test the note by simply asking the Genbot to run the note name or note id.