About task

A task is the result of your agent's execution. It represents the output and status of your agent's execution

class Task {
  id             String     
  name           String       
  agentId        String
  userId         String

  createdAt      Datetime

  logs           Array<String>                
  output         Dict<String, String>        
  status         Status        // enum of running, complete, error

  callback       String?

  agent          Agent         
  user           User  
}

logs (Array<String>)
A list of log data for the agent

output (JSON of Dict<String, Object>)
Maps to the output field of the agent's return node specifications

status (String, enum)
Represents the current task status. Status is represented as an enum of running, complete, error

callback (String URL)
The callback URL provided by the user when running a task. This is used to call webhook notifications

agent (class Agent)
The agent responsible for this task

user (class User)
The user this task belongs to


List all Tasks

Retrieves all the session user's workflow outputs, and progress report.

GET /api/v1/task

header {
    "apikey": "apikey123"
}

Response

200 Returns an array of all Tasks

[
    {
        "id": "fbc5f047-dde3-4ec9-b8bc-e1cd4ec4a6d7",
        "logs": [
            "Sypnosis: Running",
            ...
        ],
        "output": {},
        "status": "complete"
        "callback": "https://myapp.com/api/v1/callback/2100aaa"
    },
    ...
]

401 Unauthorized. API key is invalid


Retrieve a task

Retrieves the relevant user's workflow outputs, and progress report.

GET /api/v1/task/taskid123

header {
    "apikey": "apikey123"
}

taskId (String, required | Url params)
The task's id.

apikey (String, required | Header)
The API key for running this operation.

Response

200 Returns the relevant task object.

{
    "id": "fbc5f047-dde3-4ec9-b8bc-e1cd4ec4a6d7",
    "logs": [
        "Sypnosis: Running",
        ...
    ],
    "output": "",
    "status": "complete"
    "callback": "https://myapp.com/api/v1/callback/2100aaa"
}

401 Unauthorized. API key is invalid

404 Task's ID is not found.


Delete a Task

Deletes a task record from the database

Caution

This action is DESTRUCTIVE and irreversible.
DELETE /api/v1/task/{taskId}

header {
    "apikey": "apikey123"
}

Response

200 Task object deleted successfully

{
    "id": "fbc5f047-dde3-4ec9-b8bc-e1cd4ec4a6d7",
    "logs": [
        "Sypnosis: Running",
        ...
    ],
    "output": "",
    "status": "complete"
    "callback": "https://myapp.com/api/v1/callback/2100aaa"
}

401 Unauthorized. API key is invalid

404 Task's ID not found