Skip to main content

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


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


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


Set Draft Queue

Set a queue of draft prompts for task creation.

Stream Project Drafts

Stream real-time updates of project drafts via WebSocket.
Example:

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:

Include Context in Retries

Clean Up Old Drafts


Next Steps

Attempts API

Task attempt execution

WebSockets

Real-time draft updates

Tasks API

Create tasks from drafts

Workflows

Draft-based workflows