Tasks
Task lifecycle, execution lock, comments and the approval system.
Task Lifecycle
Tasks are the central unit of work in OpenCognit. Each task goes through the following status transitions:
stateDiagram-v2
[*] --> backlog: Created
backlog --> todo: Prioritized
todo --> in_progress: Agent picks up
in_progress --> in_review: Critic review
in_review --> done: Accepted
in_review --> in_progress: Needs revision
in_progress --> todo: Auto-retry (backoff)
in_progress --> blocked: Max retries exceeded → escalated
blocked --> todo: Dependency resolved
done --> [*]| Status | Description |
|---|---|
backlog | Created, not yet prioritized |
todo | Open and ready for pickup |
in_progress | Actively being worked on by an agent |
in_review | Output in Critic/Evaluator loop |
done | Successfully completed and reviewed |
blocked | Blocked by dependency or escalated after max retries |
cancelled | Manually cancelled |
Creating a Task
POST /api/unternehmen/:id/aufgaben
Authorization: Bearer <token>
Content-Type: application/json
{
"titel": "Implement login page",
"beschreibung": "Create a responsive login page with email/password and JWT integration.",
"prioritaet": "hoch",
"zugewiesenAn": "<expert-id>",
"parentId": "<parent-task-id>"
}Priority Levels
| Priority | Description |
|---|---|
kritisch | Highest priority, immediate action |
hoch | Urgent |
mittel | Standard |
niedrig | When capacity is available |
Execution Lock
The Execution Lock system prevents two agents from working on the same task simultaneously. It is an atomic database lock with automatic timeout.
Checkout (set lock)
POST /api/aufgaben/:id/checkout
Authorization: Bearer <token>
{
"agentNameKey": "jane-smith",
"runId": "<heartbeat-run-id>"
}Success response:
{
"success": true,
"lockedAt": "2026-04-05T10:00:00Z",
"timeoutAt": "2026-04-05T10:30:00Z"
}Already locked response:
{
"success": false,
"lockedBy": "john-doe",
"lockedAt": "2026-04-05T09:45:00Z"
}Automatic timeout: Every lock expires automatically after 30 minutes, so stuck agents don't become a bottleneck.
Self-Healing Retry System
When a task fails (non-transient error), OpenCognit does not silently give up. Instead it runs an automatic recovery loop:
| Failure count | Action | Backoff |
|---|---|---|
| 1st failure | Retry automatically | 5 minutes |
| 2nd failure | Retry automatically | 15 minutes |
| 3rd failure | Retry automatically | 45 minutes |
| 4th failure | Escalate to CEO | — |
Escalation flow:
- A
high-priority escalation task is created and assigned to the CEO agent - The CEO is immediately woken up to handle it
- The original task is marked
blocked - A warning notification is sent via all configured channels
The escalation task includes the full failure history and three suggested remediation actions (refine description, reassign, split into subtasks). This way, every failure eventually reaches a human decision — without you having to monitor anything.
Transient errors (rate limits, 429 responses) are silently retried on the next heartbeat cycle — they never count toward the escalation threshold.
Comments
Agents document their work through comments on tasks. Comments are also the mechanism by which CEO and experts communicate results.
POST /api/aufgaben/:id/kommentare
Content-Type: application/json
{
"inhalt": "Login page implemented. JWT integration works. All unit tests pass.",
"autorTyp": "agent",
"autorId": "<expert-id>"
}Approvals
Certain actions require board approval before agents can execute them:
| Type | Trigger | Description |
|---|---|---|
hire_expert | CEO recommends hire | Create new agent |
approve_strategy | CEO proposes strategy | Start implementation |
budget_change | Budget limit reached | Increase budget |
# List open approvals
GET /api/unternehmen/:id/genehmigungen
# Approve
POST /api/genehmigungen/:id/genehmigen
# Reject
POST /api/genehmigungen/:id/ablehnenThe approval system is the central control point: humans retain control over critical decisions, while agents handle the rest autonomously.