Overview
The Drafts API allows you to save, manage, and queue prompts for task attempts. Useful for preparing follow-up instructions or retry strategies before execution. Base URL:http://localhost:8887/api/task-attempts/:id/drafts
Save Draft
Save a draft prompt for a task attempt.Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
content | string | ✅ | Draft prompt content |
type | enum | ✅ | Draft type: follow_up, retry, initial |
metadata | object | ⚠️ | Additional metadata |
Get Draft
Retrieve a saved draft.Delete Draft
Delete a saved draft.Save Follow-Up Draft
Save a draft for follow-up instructions to a running task.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
prompt | string | - | Follow-up instruction |
autoSend | boolean | false | Automatically send when ready |
sendAfter | string | null | Schedule send time |
Save Retry Follow-Up Draft
Save a draft for retry attempts with modified prompts.Delete Retry Follow-Up Draft
Delete a retry follow-up draft.Set Follow-Up Queue
Set a queue of follow-up prompts to be executed in sequence.Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
queue | array | - | Ordered list of follow-up prompts |
queue[].prompt | string | - | Follow-up instruction |
queue[].order | integer | - | Execution order |
autoExecute | boolean | false | Auto-execute queue |
Set Draft Queue
Set a queue of draft prompts for task creation.Stream Project Drafts
Stream real-time updates of project drafts via WebSocket.Use Cases
Batch Follow-Ups
Queue multiple follow-up instructions for sequential execution:Scheduled Follow-Ups
Schedule follow-up instructions for later:Retry Strategy
Save retry prompts with improved instructions:SDK Examples
JavaScript/TypeScript
Python
Best Practices
Order Follow-Ups Logically
Use Auto-Execute Carefully
Only auto-execute follow-ups when you’re confident they won’t require review:

