Skip to main content

Task Flow

Hitler uses a human-in-the-loop task creation flow:
Natural Language → AI Parsing → Draft → Confirmation → Task
This ensures the AI never creates tasks autonomously.

Task Drafts

When a task is created (via bot or API), it starts as a draft:
  1. POST /api/tasks/drafts - Create a draft
  2. POST /api/tasks/drafts/:id/confirm - Confirm → becomes real task
  3. DELETE /api/tasks/drafts/:id - Reject → discarded

Task Lifecycle

Task Properties

PropertyTypeDescription
idUUIDUnique identifier
titlestringTask title (max 200 chars)
descriptionstringDetailed description (optional, max 2000 chars)
priorityinteger1 (highest) to 5 (lowest), default 3
statusenumopen, in_progress, completed, cancelled
dueDatedatetimeOptional deadline
rawInputstringOriginal natural language (for AI learning)
userIdUUIDTask owner
organizationIdUUIDOrganization
createdAtdatetimeCreation timestamp
updatedAtdatetimeLast update timestamp

Task Logs

Every task change is recorded:
{
  "id": "log-uuid",
  "taskId": "task-uuid",
  "action": "status_changed",
  "changes": {
    "status": { "from": "open", "to": "in_progress" }
  },
  "actorId": "user-uuid",
  "createdAt": "2024-01-15T10:30:00.000Z"
}

Endpoints

MethodEndpointDescription
POST/tasks/draftsCreate task draft
GET/tasks/draftsList my pending drafts
GET/tasks/drafts/:idGet draft by ID
POST/tasks/drafts/:id/confirmConfirm draft → create task
DELETE/tasks/drafts/:idReject draft
GET/tasksList my tasks
GET/tasks/organizationList org tasks (managers)
GET/tasks/statsGet my statistics
GET/tasks/:idGet task by ID
PATCH/tasks/:idUpdate task
GET/tasks/:id/logsGet task event logs