---
id: SVC-CRM-ACT-tasks
title: Tasks Service Module
product_area: crm
module: activities-tasks
repository: services-crm
source_module: modules/tasks
revision: 1
status: draft
design_intent: proposed
implementation_evidence: observed
inference: []
source_sha:
  services-crm: a8d1364f1dd44b723bb5f9acba12f983e9ec8d69
  react-console: baf6dae382d6f41dce976c7f848667ccc37e076f
owns:
  - DOM-CRM-ACT-003
does_not_own:
  - >-
    Platform owns workflow execution and the external action adapters that call this task
    function.
  - >-
    Platform owns attention delivery, Home presentation and assignment of shared-work
    responsibility.
  - >-
    Platform owns user and role authority; stored references have no local database
    foreign keys.
  - 'Platform executes workspace task lists, counts and exports over registered datasets.'
  - Data Quality owns merges and changes task references through its shared policy.
operations:
  - operation_id: getTasksHealth
    intent: Expose deployment health and build information for the tasks function.
    access: public
    permission: 'none: public health route'
    realises: []
    published_to_submissions: 'not published: deployment monitoring accepts no business submission'
  - operation_id: createTask
    intent: >-
      Record unfinished work with its context and supported routing, allowing console
      recovery by the chosen creation identifier.
    access: console
    permission: crm.tasks.create
    realises:
      - CAP-CRM-ACT-010
      - CAP-CRM-ACT-012
      - CAP-CRM-ACT-013
      - CAP-CRM-ACT-014
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: getTask
    intent: 'Return one task, with an optional selected-field projection.'
    access: console
    permission: crm.tasks.read
    realises:
      - CAP-CRM-ACT-010
      - CAP-CRM-ACT-014
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: updateTask
    intent: >-
      Version-check an unfinished task replacement while preserving omitted work day,
      candidate role and workflow origin.
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-010
      - CAP-CRM-ACT-011
      - CAP-CRM-ACT-012
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: patchTask
    intent: Apply submitted unfinished-work changes after testing the read version.
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-010
      - CAP-CRM-ACT-011
      - CAP-CRM-ACT-012
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: deleteTask
    intent: >-
      Remove unlocked work and synchronize its overdue resolution when publishing is
      enabled.
    access: console
    permission: crm.tasks.delete
    realises:
      - CAP-CRM-ACT-010
      - CAP-CRM-ACT-019
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: assignTask
    intent: 'Change a holder or queue on unfinished work, with an optional read-version check.'
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-012
      - CAP-CRM-ACT-013
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: claimTask
    intent: >-
      Conditionally take available queued work or claim a role-only offer after current
      role authority is checked.
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-012
      - CAP-CRM-ACT-013
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: releaseTask
    intent: Clear the holder of shared work while retaining its queue arrival or candidate role.
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-012
      - CAP-CRM-ACT-013
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: completeTask
    intent: Finish work using its read version and capture the completing actor and instant.
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-011
      - CAP-CRM-ACT-015
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: reopenTask
    intent: Return closed work to Open using its read version and clear its closing stamps.
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-011
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: cancelTask
    intent: Stop work using its read version and capture the cancelling actor and instant.
    access: console
    permission: crm.tasks.update
    realises:
      - CAP-CRM-ACT-011
      - CAP-CRM-ACT-015
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: listOfferedTasks
    intent: >-
      Return oldest-first pages of unfinished, unheld, unqueued work offered to the
      caller’s listed roles.
    access: console
    permission: crm.tasks.read
    realises:
      - CAP-CRM-ACT-013
      - CAP-CRM-ACT-014
    published_to_submissions: >-
      not published: no binding for these staff operations is declared in the inspected
      CRM sources; external publication remains unverified
  - operation_id: runTaskServiceOperation
    intent: >-
      Dispatch workflow task creation, closing, routing, due-day changes or offered-work
      reads with each operation’s local repeat policy.
    access: service
    permission: >-
      crm.tasks.create and crm.tasks.update (service access by invoke grant; evaluated as
      all for a trusted service)
    realises:
      - CAP-CRM-ACT-017
      - CAP-CRM-ACT-013
    published_to_submissions: 'not published: the service-only function has no HTTP submission endpoint'
  - operation_id: createTaskType
    intent: >-
      Insert a locally named task category, placing it at the end unless a position is
      supplied.
    access: console
    permission: crm.task-types.create
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: listTaskTypes
    intent: Return display-ordered task category pages including retired entries.
    access: console
    permission: crm.task-types.read
    realises:
      - CAP-CRM-ACT-016
      - CAP-CRM-ACT-010
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: reorderTaskTypes
    intent: Save the complete task category order as one transaction.
    access: console
    permission: crm.task-types.update
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: getTaskType
    intent: Return one task category configuration record.
    access: console
    permission: crm.task-types.read
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: updateTaskType
    intent: >-
      Version-check a task category replacement, clearing an omitted description and
      preserving an omitted position.
    access: console
    permission: crm.task-types.update
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: patchTaskType
    intent: Version-check submitted task category configuration changes.
    access: console
    permission: crm.task-types.update
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: deleteTaskType
    intent: Remove a task category only when no task refers to it.
    access: console
    permission: crm.task-types.delete
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: createTaskQueue
    intent: >-
      Insert a locally named shared-work queue, placing it at the end unless a position is
      supplied.
    access: console
    permission: crm.task-queues.create
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: listTaskQueues
    intent: Return display-ordered shared-work queue pages including retired entries.
    access: console
    permission: crm.task-queues.read
    realises:
      - CAP-CRM-ACT-016
      - CAP-CRM-ACT-010
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: reorderTaskQueues
    intent: Save the complete shared-work queue order as one transaction.
    access: console
    permission: crm.task-queues.update
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: getTaskQueue
    intent: Return one shared-work queue configuration record.
    access: console
    permission: crm.task-queues.read
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: updateTaskQueue
    intent: >-
      Version-check a shared-work queue replacement, clearing an omitted description and
      preserving an omitted position.
    access: console
    permission: crm.task-queues.update
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: patchTaskQueue
    intent: Version-check submitted shared-work queue configuration changes.
    access: console
    permission: crm.task-queues.update
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
  - operation_id: deleteTaskQueue
    intent: Remove a shared-work queue only when no task refers to it.
    access: console
    permission: crm.task-queues.delete
    realises:
      - CAP-CRM-ACT-016
    published_to_submissions: 'not published: these local routes administer workspace configuration'
events:
  - name: crm.tasks_overdue attention item (behind the attention publishing switch)
    direction: produced
    when: >-
      Enabled persistence publishes unfinished work past its due day and resolves changed
      work that ceases qualifying; reconciliation separately publishes its selected
      overdue pages.
    payload_summary: >-
      Identify the task, scope it to queue or workspace, select holder, queue
      responsibility or administrator audience, and supply title, due day, priority and
      available contact name. The deadline is the due day’s end in the workspace calendar.
jobs:
  - >-
    The shared daily attention function runs the overdue-task definition and skips before
    reading when publication is disabled.
integrations:
  - system: Platform Workflow Action Engine
    direction: inbound
    contract: >-
      Accept the declared workflow operation set through a directly invoked service
      function with an allowed principal and workspace context.
  - system: Platform security (role holders)
    direction: outbound
    contract: >-
      Check role-only claims through the role-holder function and read security
      assignments directly for offered-work listing.
  - system: Platform attention and responsibilities
    direction: outbound
    contract: >-
      Synchronize overdue publication inside task transactions and declare queue-scoped or
      workspace-wide shared-work responsibility.
  - system: Platform query engine
    direction: outbound
    contract: >-
      Register task, category and queue datasets plus their shipped list recipes for
      permission-controlled queries.
  - system: Platform workspace lifecycle
    direction: inbound
    contract: >-
      Declare the task lifecycle participant with five initial categories and its
      provision, verify, inventory, reset and purge operations.
consistency:
  - rule: >-
      Database checks and persistence policy keep lifecycle, closing stamps, holder
      attribution and queue arrival internally consistent.
    kind: transactional
    compensation: No compensating record write is required.
  - rule: >-
      Enabled persistence and its own overdue attention changes commit or roll back
      together.
    kind: transactional
    compensation: No compensating record write is required.
  - rule: >-
      Daily reconciliation attempts to supply missed publication and remove older unseen
      items, but concurrent changes can leave stale results.
    kind: eventual
    compensation: >-
      A later write or successful pass can repair details without an established repair
      deadline.
  - rule: >-
      A retained workflow creation reference admits at most one live task in its
      workspace.
    kind: transactional
    compensation: The unique reference resolves concurrent creation without a compensating write.
evidence:
  - >-
    services-crm at a8d1364f: modules/tasks/aws/api/tasks.routes.ts (tasksRoutes,
    transitionRoutes, tasksModuleRoutes); task-configurations.routes.ts;
    task-types.routes.ts; task-queues.routes.ts; tasks-service.routes.ts;
    tasks-service.schemas.ts; tasks.module.ts; aws/crm.service-functions.ts;
    aws/crm.service.ts (TasksPermissions, TaskTypesPermissions, TaskQueuesPermissions);
    aws/crm.attention.ts; aws/crm.attention-sweeps.ts; aws/crm.responsibilities.ts;
    attention/tasks-overdue.attention.ts; queries/*; metadata/*;
    @rhythmsoftware/macroservice-http health-route (getTasksHealth).
controls: [TC-AZ-001, TC-AZ-002, TC-AZ-003, TC-AZ-004, TC-AZ-005, TC-AZ-006, TC-DAT-001, TC-DAT-002, TC-DAT-003, TC-DAT-004, TC-DAT-005, TC-IAM-001, TC-IAM-005, TC-IAM-006, TC-LOG-001, TC-LOG-002, TC-LOG-003, TC-LOG-004, TC-LOG-005, TC-MON-001, TC-MON-002, TC-PI-001, TC-PI-002, TC-PI-003, TC-PI-004, TC-PI-005, TC-PRV-001, TC-PRV-002, TC-TEN-001, TC-TEN-002, TC-TEN-003, TC-TEN-004]
---

# Tasks Service Module

## What This Service Is For

The tasks module maintains outstanding work, its routing and closing attribution, and its category and queue configuration. It also exposes the service operation set used by workflow callers.

## Boundary

Activities delegates follow-up creation here and reads task rows for record timelines. Data Quality directly transfers related references. Platform supplies workflow execution, attention delivery, role authority, responsibility assignment and workspace query execution.

## Operations in Words

Work recording covers creation, reading, replacement, partial editing and removal. Dedicated lifecycle commands complete, cancel and reopen work. Routing commands assign, claim and release work and read role offers. The directly invoked service dispatcher supplies the workflow operation set. Category and queue administration each provides creation, ordered reads, replacement, patching, complete-list ordering and protected removal.

The structured operation rows map each request to its declared access, permission and planning capabilities, including the public health route. No Submissions binding is declared locally; external publication confirmation remains open.

## Events and Jobs

Tasks have no registered change stream or revision history. Their overdue attention definition is published conditionally and reconciled by the shared daily function. Shared-work responsibility supplies audiences for unheld queue work.

## Consistency Guarantees

Persistence maintains task routing and lifecycle stamp pairs transactionally. Conditional claims admit at most one committed winner. Enabled attention changes share their task transaction, whereas separately read reconciliation pages can publish older details and provide no bounded repair guarantee.
