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
- patch /api/v3/workflow/activities/:id
- patch /api/v3/workflow/activities/:id/assign
- post /api/v3/workflow/activities/:id/cancel
- patch /api/v3/workflow/activities/:id/complete
- post /api/v3/workflow/activities/:id/error
- patch /api/v3/workflow/activities/:id/process
- patch /api/v3/workflow/activities/:id/reassign
- patch /api/v3/workflow/activities/:id/unassign
- get /api/v3/workflow/activities/:resource_id
get/api/v3/workflow/activities
Return a paginated list of workflow/activities
Input Schema
object
object
object
- `project`
- `work_unit`
- `node`
array
The key is the resource type and the value is an array of fields.
dictionary
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
array
object
object
array
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
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
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
Typescript
type InputSchema = { id: string };
patch/api/v3/workflow/activities/:id/complete
Complete the activity
Input Schema
object
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
object
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
Typescript
type InputSchema = { id: string };
patch/api/v3/workflow/activities/:id/reassign
Reassign the activity to another user
Input Schema
object
Typescript
type InputSchema = { id: string; account_id: number };
patch/api/v3/workflow/activities/:id/unassign
Unassign activity from one user
Input Schema
object
Typescript
type InputSchema = { id: string };
get/api/v3/workflow/activities/:resource_id
Show a specific workflow/activities
Input Schema
object
array
dictionary
Typescript
type InputSchema = {
resource_id: string;
included?: Array<string>;
fields?: { [key: string]: Array<any> };
};
Output Schema
object
object
object
array
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>>;
};