Manus
Task System
Understanding the Manus AI Agent task workflow
Overview
The task system allows users to submit AI agent tasks to Manus and track their progress in real-time.
Task Lifecycle
Created → Queued → Processing → Completed
↘ FailedStatus Definitions
| Status | Description |
|---|---|
created | Task submitted, awaiting queue |
queued | In queue, waiting for processing |
processing | AI agent is working on the task |
completed | Task finished successfully |
failed | Task encountered an error |
Creating Tasks
Via API
// POST /api/manus/tasks/create
const response = await fetch('/api/manus/tasks/create', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
prompt: 'Your task description here',
type: 'general',
priority: 'normal',
}),
});
const { success, task } = await response.json();Task Types
| Type | Description | Credits |
|---|---|---|
general | General purpose tasks | 1 |
research | Research and analysis | 2 |
coding | Code generation | 3 |
creative | Creative content | 2 |
Task Schema
interface ManusTask {
id: string;
user_id: string;
account_id: string;
prompt: string;
type: string;
status: TaskStatus;
priority: 'low' | 'normal' | 'high';
credits_used: number;
result: object | null;
error: string | null;
started_at: Date | null;
completed_at: Date | null;
created_at: Date;
}Viewing Tasks
Task List
Access your tasks at /manus/tasks:
- Filter by status, type, or date
- Sort by creation time or priority
- View task details and results
Task History
View completed tasks at /manus/tasks/history:
- Full task execution logs
- Result download options
- Credit consumption history
Real-time Updates
Tasks support real-time status updates:
// Subscribe to task updates
const eventSource = new EventSource(`/api/manus/tasks/${taskId}/stream`);
eventSource.onmessage = (event) => {
const update = JSON.parse(event.data);
console.log('Task update:', update);
};Error Handling
Common Errors
| Error | Cause | Solution |
|---|---|---|
insufficient_credits | Not enough credits | Purchase more credits |
account_unavailable | No bound account | Claim or bind an account |
rate_limited | Too many requests | Wait and retry |
invalid_prompt | Empty or invalid input | Check prompt format |
Retry Logic
Failed tasks can be retried:
// POST /api/manus/tasks/{id}/retry
const response = await fetch(`/api/manus/tasks/${taskId}/retry`, {
method: 'POST',
});Best Practices
- Clear Prompts: Write specific, detailed prompts
- Monitor Credits: Track credit usage before submitting
- Handle Errors: Implement proper error handling
- Use Priorities: Set appropriate priority levels
- Check Status: Poll or use streaming for updates