Edit and manage workplans

Learn how to modify, update, and maintain your existing workplans.

Once you’ve created workplans, you may need to modify your workplans to improve or add new requirements to the analysis. This guide explains how to edit and manage your existing workplans.

Editing a workplan

You can modify an existing workplan using a text prompt that describes the changes you want to make. Note that modifying an existing workplan completely replaces the execution plan.

1import requests
2
3BASE_URL = "https://alfa.boosted.ai/client"
4API_KEY = "YOUR_API_KEY_HERE"
5
6headers = {"x-api-key": API_KEY, "Content-Type": "application/json"}
7
8def edit_workplan(workplan_id, prompt, args=None):
9 """Edit an existing workplan with a new prompt."""
10 url = f"{BASE_URL}/v2/workplans/{workplan_id}/edit"
11 payload = {"prompt": prompt}
12
13 response = requests.patch(url, headers=headers, json=payload)
14
15 if response.status_code == 200:
16 data = response.json()
17 success = data.get("success", False)
18 new_status = data.get("status")
19
20 if success:
21 print(f"Workplan {workplan_id} updated successfully")
22 print(f"New status: {new_status}")
23 else:
24 print("Workplan update failed")
25
26 return success
27 else:
28 print(f"Error: {response.status_code}, {response.text}")
29 return False
30
31# Edit a workplan with a refined prompt
32workplan_id = "your-workplan-id"
33new_prompt = "Analyze Apple's stock performance over the last 3 months, include earnings data, and show both price trends and volume analysis"
34success = edit_workplan(workplan_id, new_prompt)

Editing with document references

You can also update workplans to reference new or different documents.

1def edit_workplan_with_documents(workplan_id, prompt, document_ids):
2 """Edit a workplan to reference specific documents."""
3 args = {}
4
5 for i, doc_id in enumerate(document_ids):
6 args[f"doc{i+1}"] = {
7 "id": doc_id,
8 "type": "custom_document"
9 }
10
11 # Create a prompt that references the documents
12 document_prompt = prompt
13 for i in range(len(document_ids)):
14 document_prompt = document_prompt.replace(f"{{doc{i+1}}}", f"{{doc{i+1}}}")
15
16 return edit_workplan(workplan_id, document_prompt, args)
17
18# Edit workplan to use new quarterly reports
19new_docs = ["file_id_1", "file_id_2", "file_id_3"]
20new_prompt = "Analyze the quarterly reports in {doc1}, {doc2}, and {doc3}. Compare performance across quarters and identify trends."
21success = edit_workplan_with_documents(workplan_id, new_prompt, new_docs)

Monitoring workplan

Get comprehensive information about a workplan, including its current status and exucution plan.

1def get_workplan_details(workplan_id):
2 """Get detailed information about a workplan."""
3 url = f"{BASE_URL}/v2/workplans/{workplan_id}/view"
4
5 response = requests.get(url, headers=headers)
6
7 if response.status_code == 200:
8 data = response.json()
9
10 print(f"Workplan ID: {data.get('workplan_id')}")
11 print(f"Plan Status: {data.get('plan_status')}")
12
13 execution_plan = data.get("execution_plan")
14 if execution_plan:
15 nodes = execution_plan.get("nodes", [])
16 print(f"Execution Plan: {len(nodes)} nodes")
17
18 for i, node in enumerate(nodes):
19 tool_name = node.get("tool_name", "Unknown")
20 description = node.get("description", "No description")
21 print(f" Node {i+1}: {tool_name} - {description}")
22
23 return data
24 else:
25 print(f"Error: {response.status_code}, {response.text}")
26 return None
27
28# Get workplan details
29workplan_info = get_workplan_details(workplan_id)

Listing all workplans

View all your workplans to see which ones need updates or maintenance. Workplans are listed by creation date.

1def list_all_workplans():
2 """List all workplans with their current status."""
3 url = f"{BASE_URL}/v2/workplans"
4
5 response = requests.get(url, headers=headers)
6
7 if response.status_code == 200:
8 data = response.json()
9 workplans = data.get("workplans", [])
10
11 print(f"Total workplans: {len(workplans)}")
12
13 for workplan in workplans:
14 print(f"\nWorkplan {workplan["workplan_id"]}:")
15 print(f" Name: {workplan.get("workplan_name", "Unnamed")}")
16 print(f" Description: {workplan.get("workplan_description", "No description")}")
17 print(f" Status: {workplan.get("workplan_status", "Unknown")}")
18 print(f" Created: {created_at = workplan.get("created_at", "Unknown")}")
19
20 return workplans
21 else:
22 print(f"Error: {response.status_code}, {response.text}")
23 return None
24
25# List all workplans
26all_workplans = list_all_workplans()

Deleting workplans

If you no longer need a workplan, you can delete it permanently.

1def delete_workplan(workplan_id):
2 """Permanently delete a workplan."""
3 url = f"{BASE_URL}/v2/workplans/{workplan_id}/delete"
4
5 response = requests.delete(url, headers=headers)
6
7 if response.status_code == 200:
8 data = response.json()
9 success = data.get("success", False)
10
11 if success:
12 print(f"Workplan {workplan_id} deleted successfully")
13 else:
14 print("Workplan deletion failed")
15
16 return success
17 else:
18 print(f"Error: {response.status_code}, {response.text}")
19 return False
20
21# Delete a workplan (use with caution!)
22delete_workplan(workplan_id)

Deleting a workplan is permanent and cannot be undone.

Example: Finding workplans by pattern matching

1

Get all workplans

First, retrieve the list of all your workplans

2

Filter by criteria

Search for workplans that match certain patterns:

1# Get all available workplans
2all_workplans = list_all_workplans()
3
4# Filter workplans by name pattern
5earnings_workplans, recent_workplans = [], []
6if all_workplans:
7 earnings_workplans = [a for a in all_workplans if "earnings" in a["workplan_name"].lower()]
8 recent_workplans = [a for a in all_workplans if a["created_at"] > "2025-06-30"]
9
10# Display filtered results
11print(f"\nFound {len(earnings_workplans)} earnings-related workplans:")
12for workplan in earnings_workplans:
13 print(f"- {workplan['workplan_name']} (ID: {workplan['workplan_id']})")
14
15print(f"\nFound {len(recent_workplans)} workplans created since July 2025:")
16for workplan in recent_workplans:
17 print(f"- {workplan['workplan_name']} (created: {workplan['created_at']})")

Next steps

Now that you understand how to edit and manage workplans, you can:

Workplan editing is a powerful feature that allows you to continuously improve your analysis capabilities. Regular updates can lead to better results and more efficient token usage.