Activities

Manage activities. Create new activities, update and delete them.

Activities are the tasks that need to be done in a project, by an agent, who is a member of the project.

Activities inherit from nodes, and can be connected to each other to form a workflow.

Data structure stored in each activities is related to the project definition and the activity type.

Endpoints


get/api/v3/workflow/activities

Return a paginated list of workflow/activities

Input Schema

object
page?:
object
The page number, default to 1
number?: integer
The number of items per page, default to 1000
size?: integer
The sort order, comma separated list of fields. See sorting section for more details
sort?: string
Set to true to return the total number of items in the collection
count?: boolean
filter?:
object
id?: unknown
assigned_account_id?: unknown
name?: unknown
status?: unknown
started_at?: unknown
completed_at?: unknown
try_resolve_at?: unknown
actor_roles?: unknown
whitelisted_ids?: unknown
blacklisted_ids?: unknown
working_seconds?: unknown
live_seconds?: unknown
pipeline_seconds?: unknown
project_id?: unknown
data?: unknown
output?: unknown
indicators?: unknown
created_at?: unknown
work_unit_id?: unknown
name?: unknown
work_unit_id?: unknown
name__in?: unknown
actor_roles__contains?: unknown
assigned_account_id__in?: unknown
status__in?: unknown
completed_at__gte?: unknown
completed_at__lte?: unknown
id__in?: unknown
The related resources to include in the response. Allowed resources are:
- `project`
- `work_unit`
- `node`
included?:
array
Elements: string
The fields to include in the response.
The key is the resource type and the value is an array of fields.
fields?:
dictionary
Values: array

Typescript

type InputSchema = {
  page?: {
    // The page number, default to 1
    number?: number;
    // The number of items per page, default to 1000
    size?: number;
  };
  // The sort order, comma separated list of fields. See sorting section for more details
  sort?: string;
  // Set to true to return the total number of items in the collection
  count?: boolean;
  filter?: {
    id?: any;
    assigned_account_id?: any;
    name?: any;
    status?: any;
    started_at?: any;
    completed_at?: any;
    try_resolve_at?: any;
    actor_roles?: any;
    whitelisted_ids?: any;
    blacklisted_ids?: any;
    working_seconds?: any;
    live_seconds?: any;
    pipeline_seconds?: any;
    project_id?: any;
    data?: any;
    output?: any;
    indicators?: any;
    created_at?: any;
    work_unit_id?: any;
    name?: any;
    work_unit_id?: any;
    name__in?: any;
    actor_roles__contains?: any;
    assigned_account_id__in?: any;
    status__in?: any;
    completed_at__gte?: any;
    completed_at__lte?: any;
    id__in?: any;
  };
  // The related resources to include in the response. Allowed resources are:
  // - `project`
  // - `work_unit`
  // - `node`
  included?: Array<string>;
  // The fields to include in the response.
  // The key is the resource type and the value is an array of fields.
  fields?: { [key: string]: Array<any> };
};

Output Schema

object
data:
array
Elements:
object
type: string
id?: string
attributes?:
object
id?: string
assigned_account_id?: integer
name?: string
status?: string
started_at?: datetime
completed_at?: datetime
try_resolve_at?: datetime
actor_roles?: array
whitelisted_ids?: array
blacklisted_ids?: array
working_seconds?: number
live_seconds?: number
pipeline_seconds?: number
data?: open struct
output?: open struct
indicators?: open struct
created_at?: datetime
relationships?: open struct
included?:
array
Elements: open struct

Typescript

type OutputSchema = {
  data: Array<{
    type: string;
    id?: string;
    attributes?: {
      id?: string;
      assigned_account_id?: number;
      name?: string;
      status?: string;
      started_at?: Date;
      completed_at?: Date;
      try_resolve_at?: Date;
      actor_roles?: Array<any>;
      whitelisted_ids?: Array<any>;
      blacklisted_ids?: Array<any>;
      working_seconds?: number;
      live_seconds?: number;
      pipeline_seconds?: number;
      data?: Record<string, any>;
      output?: Record<string, any>;
      indicators?: Record<string, any>;
      created_at?: Date;
    };
    relationships?: Record<string, any>;
  }>;
  included?: Array<Record<string, any>>;
};


patch/api/v3/workflow/activities/:id

Save the activity but do not mark it as completed. Useful to store temporary data and long running activities.

Input Schema

object
id: string
The data to save the activity with. Related to activity type.
data: open struct

Typescript

type InputSchema = {
  id: string;
  // The data to save the activity with. Related to activity type.
  data: Record<string, any>;
};


patch/api/v3/workflow/activities/:id/assign

Assign the activity to one member

Input Schema

object
id: string
The account id to assign the activity to. Must be a member of the project
account_id?: integer
Whether to start working on the activity
start_working: boolean
Whether this is self-assigning. Default is false.
self_assigning?: boolean

Typescript

type InputSchema = {
  id: string;
  // The account id to assign the activity to. Must be a member of the project
  account_id?: number;
  // Whether to start working on the activity
  start_working: boolean;
  // Whether this is self-assigning. Default is false.
  self_assigning?: boolean;
};


post/api/v3/workflow/activities/:id/cancel

Cancel the activity.

Input Schema

object
id: string

Typescript

type InputSchema = { id: string };


patch/api/v3/workflow/activities/:id/complete

Complete the activity

Input Schema

object
id: string
The data to complete the activity with. Related to activity type.
data: open struct

Typescript

type InputSchema = {
  id: string;
  // The data to complete the activity with. Related to activity type.
  data: Record<string, any>;
};


post/api/v3/workflow/activities/:id/error

Mark the activity as errored.

Input Schema

object
id: string
data?:
object
comment: string

Typescript

type InputSchema = { id: string; data?: { comment: string } };


patch/api/v3/workflow/activities/:id/process

Start or resume the current work done. Throw error if already paused or the agent is not on this task.

Input Schema

object
id: string

Typescript

type InputSchema = { id: string };


patch/api/v3/workflow/activities/:id/reassign

Reassign the activity to another user

Input Schema

object
id: string
account_id: integer

Typescript

type InputSchema = { id: string; account_id: number };


patch/api/v3/workflow/activities/:id/unassign

Unassign activity from one user

Input Schema

object
id: string

Typescript

type InputSchema = { id: string };


get/api/v3/workflow/activities/:resource_id

Show a specific workflow/activities

Input Schema

object
resource_id: string
included?:
array
Elements: string
fields?:
dictionary
Values: array

Typescript

type InputSchema = {
  resource_id: string;
  included?: Array<string>;
  fields?: { [key: string]: Array<any> };
};

Output Schema

object
data:
object
type: string
id?: string
attributes?:
object
id?: string
assigned_account_id?: integer
name?: string
status?: string
started_at?: datetime
completed_at?: datetime
try_resolve_at?: datetime
actor_roles?: array
whitelisted_ids?: array
blacklisted_ids?: array
working_seconds?: number
live_seconds?: number
pipeline_seconds?: number
data?: open struct
output?: open struct
indicators?: open struct
created_at?: datetime
relationships?: open struct
included?:
array
Elements: open struct

Typescript

type OutputSchema = {
  data: {
    type: string;
    id?: string;
    attributes?: {
      id?: string;
      assigned_account_id?: number;
      name?: string;
      status?: string;
      started_at?: Date;
      completed_at?: Date;
      try_resolve_at?: Date;
      actor_roles?: Array<any>;
      whitelisted_ids?: Array<any>;
      blacklisted_ids?: Array<any>;
      working_seconds?: number;
      live_seconds?: number;
      pipeline_seconds?: number;
      data?: Record<string, any>;
      output?: Record<string, any>;
      indicators?: Record<string, any>;
      created_at?: Date;
    };
    relationships?: Record<string, any>;
  };
  included?: Array<Record<string, any>>;
};