# Operation

Projects, tasks, teams, cycles, and delivery


Projects, tasks, teams, cycles, milestones, triage, and a GitHub issue integration.

Operation is the delivery-work plugin. Teams define statuses, cycles (sprints), and milestones; tasks carry assignees, priorities, estimate points, notes, and activity records. A per-team triage queue collects incoming work that converts into tasks. Tasks are a segment content type (`operation:task.tasks`), and other services can create tasks over tRPC: `frontline` calls `task.createFromSource` when a conversation converts into a task.

For workflow automation, see [Automations & Approvals](https://erxes.io/docs/core-automations-approvals). For converting inbox conversations into tasks, see [Frontline](https://erxes.io/docs/plugin-frontline).

## Enabling and ports

```dotenv
ENABLED_PLUGINS=operation
```

| Project | Role | Dev port |
| --- | --- | --- |
| `operation_api` | Federated GraphQL subgraph + tRPC, subscriptions, BullMQ workers | `3307` |
| `operation_ui` | Module Federation remote | `3006` |

[`main.ts`](https://github.com/erxes/erxes/blob/f91e8c6f4714c910a32c6b6e14fe085f6435c89e/backend/plugins/operation_api/src/main.ts) mounts GraphQL and the [tRPC app router](https://github.com/erxes/erxes/blob/f91e8c6f4714c910a32c6b6e14fe085f6435c89e/backend/plugins/operation_api/src/trpc/init-trpc.ts) (`task.*`, `fields.getFieldList`), plus an Express router for the GitHub integration endpoints (`/pl:operation/integrations/github/*`). It also registers permissions, automations, notifications, segments, properties, tags, and import/export.

## Module map

| Module | Purpose | Guide |
| --- | --- | --- |
| `task`, `status`, `activity`, `note`, triage | Tasks, per-team status sets, notes/activity, triage queue | [Tasks & Statuses](https://erxes.io/docs/operation-tasks) |
| `project`, `cycle`, `milestone` | Projects, sprints, milestone rollups | [Projects, Cycles & Milestones](https://erxes.io/docs/operation-projects-cycles) |
| `team`, `template`, `fields` | Teams, membership, estimate types, task templates, custom fields | [Teams & Templates](https://erxes.io/docs/operation-teams) |
| `githubIntegration`, `automations` | GitHub App config, issue sync, automation triggers/actions | [GitHub Integration & Automations](https://erxes.io/docs/operation-github-integration) |

Task ids are Mongo `ObjectId`s, not generated string ids. Keep this in mind when writing tRPC callers or segment producers.

## Platform integrations

- **Segments**: `operation:task.tasks` content type with filterable fields, member listing/counting, materialised `segmentIds`, and the `user.assignedTasks` / `user.createdTasks` relations.
- **Automations**: segment triggers for tasks and projects plus custom completion triggers; "Create task" and "Create project" actions. See [GitHub Integration & Automations](https://erxes.io/docs/operation-github-integration).
- **Import/export**: `operation:task.task` (import + export) and `operation:project.project` (export) producers.
- **Notifications**: `taskAssignee`, `taskStatus`, `projectAssignee`, `projectStatus` events.
- **Properties**: `task` and `project` property types with `systemFields` (`code`, `name`, `type`).
- **Subscriptions**: `operationTaskChanged`, `operationTaskListChanged`, `operationProjectChanged`, `operationProjectListChanged`, `operationActivityChanged`.
- **Scheduled worker**: `operations-daily-cycles-check` (hourly `0 * * * *` UTC) ends cycles that finished yesterday and starts cycles beginning today, per tenant timezone ([worker/index.ts](https://github.com/erxes/erxes/blob/f91e8c6f4714c910a32c6b6e14fe085f6435c89e/backend/plugins/operation_api/src/worker/index.ts)).

## Configuration

| Variable | Purpose |
| --- | --- |
| `GITHUB_APP_ID` / `GITHUB_PRIVATE_KEY` | GitHub App credentials for the issue integration |
| `GITHUB_WEBHOOK_SECRET` | HMAC-SHA256 verification on `/integrations/github/webhook` |
| `MONGO_URL` | Tenant MongoDB connection |
| `DOMAIN` | Builds task links (e.g. automation outputs) |
| `VERSION` | `saas` fans the daily cycle check out per organization |
| `NODE_ENV` | Selects the compiled subscription plugin path |
| `TIMEZONE` | Core config (not env): tenant timezone used by the cycle checker |

- [Tasks & Statuses](https://erxes.io/docs/operation-tasks): Tasks, statuses, activities, notes, and triage
- [Projects, Cycles & Milestones](https://erxes.io/docs/operation-projects-cycles): Group work into projects, time-box it with cycles, and track milestones
- [Teams & Templates](https://erxes.io/docs/operation-teams): Team membership, roles, and reusable task templates
- [GitHub Integration & Automations](https://erxes.io/docs/operation-github-integration): Link repositories and issues, and register operation triggers and actions

