---
title: "Links a workflow to a project."
method: POST
path: "/projects/{projectId}/linkworkflow"
tags: ["workflows"]
---

# Links a workflow to a project.

`POST /projects/{projectId}/linkworkflow`

Links the specified workflow to the project, migrating existing statuses
            using the provided mapping. If the project has no existing statuses,
            workflow statuses are automatically assigned.
            If the project is already linked to a workflow, switching to a new workflow
            is supported when proper status mappings are provided.
            <Check title="Required Permissions" icon="key">To link a workflow to a project the user must have `project-master-data:write` permissions on the specified project or be the project creator.</Check>

## Path parameters

- `projectId` string, uuid, required

## Headers

- `Authorization` string, required

## Request body

- LinkWorkflowForm — The form for linking a workflow to a project or project template.
  - `workflowId` string, uuid, required — The Id of the workflow to link.
  - `projectStatusMapping` ProjectStatusMappingEntry[], nullable — Maps existing project status Ids to workflow project status Ids. Required if the project/template has existing project statuses.
    - `oldProjectStatusId` string, uuid, required — The Id of the existing project status to replace.
    - `newProjectStatusId` string, uuid, required — The Id of the workflow project status to use instead.
  - `taskStatusMapping` TaskStatusMappingEntry[], nullable — Maps existing task status Ids to workflow task status Ids. Required if the project/template has existing task statuses.
    - `oldTaskStatusId` string, uuid, required — The Id of the existing task status to replace.
    - `newTaskStatusId` string, uuid, required — The Id of the workflow task status to use instead.
  - `keepCustomFields` boolean, nullable — Whether to keep existing non-workflow custom fields when linking the workflow. If false, existing non-workflow task custom fields will be deleted. Default: true (keep custom fields).
  - `keepCustomAutomations` boolean, nullable — Whether to keep existing non-workflow automations when linking the workflow. If false, custom automations will be deleted. Default: true (keep custom automations).

## Response `200`

OK

- Project — /// This class contains all information to handle projects.
  - `name` string, required — The name of the Project. Max allowed length: 1000 characters.
  - `isPrivate` boolean — Whether this is a private project only visible to members and the creator. Defaults to false. Can only be changed from public to private if no times have been tracked on this project. Can always be made public.
  - `description` string, nullable — The project description. Max allowed length: 25000 characters.
  - `startDate` string, date-time, nullable — The start date of the project.
  - `dueDate` string, date-time, nullable — The due date of the project.
  - `companyId` string, uuid, nullable — The id of the company.
  - `timeBudget` integer, nullable — The time budget the project has, in seconds.
  - `isBillableByDefault` boolean, nullable — Whether project times should be billable by default.
  - `projectTypeId` string, uuid, nullable — The id of the project type of this project.
  - `color` string, nullable — The color of the project for display purposes in awork. The supported colors are defined by the awork frontend. Can be null when no color assigned.
  - `deductNonBillableHours` boolean — Whether to deduct non-billable hours from project budgets.
  - `isProjectKeyVisible` boolean, nullable — Whether project key should be visible for this project. If null, it will use the workspace default setting.
  - `projectStatusId` string, uuid — The id of the project status.
  - `projectTemplateId` string, uuid, nullable — The id of the template which is used to create the project.
  - `publicProjectTemplateId` string, uuid, nullable — The id of the public template which is used to create the project.
  - `workflowId` string, uuid, nullable — The id of the workflow to link to the project. Cannot be specified if ProjectTemplateId is set.
  - `id` string, uuid — Id of the project.
  - `projectKey` string, nullable — The unique project key within the workspace (e.g., "NIKE"). Maximum 32 characters, uppercase letters, numbers, and dashes only.
  - `hasImage` boolean — Whether the project has an image.
  - `createdOn` string, date-time — The date this entity was created.
  - `createdBy` string, uuid — The id of the user who created this entity.
  - `updatedOn` string, date-time — The date this entity was last modified.
  - `updatedBy` string, uuid — The id of the user who last modified this entity.
  - `closedOn` string, date-time, nullable — The date the project was set to closed.
  - `closedBy` string, uuid, nullable — The user who closed the project.
  - `createdByProjectTemplateId` string, uuid, nullable — The id of the template the project was created from.
  - `projectType` NestedTypeModel
    - `id` string, uuid — Gets or sets the id of the nested model.
    - `name` string, nullable — The name of the entity.
    - `icon` string, nullable — The icon of the type.
    - `isArchived` boolean — Whether the type is archived.
  - `projectStatus` ExtendedProjectStatusModel
    - `id` string, uuid — Gets or sets the id of the nested model.
    - `name` string, nullable — The name of the entity.
    - `description` string, nullable — The description of the type.
    - `type` string, nullable — The type of the status.
    - `isArchived` boolean — Whether the type is archived.
    - `typeOrder` integer — The order of the status type.
    - `isExternal` boolean — True if this entity is coming from an external workspace (awork Connect).
  - `company` NestedCompanyModelForProjects
    - `id` string, uuid — Gets or sets the id of the nested model.
    - `name` string, nullable — The name of the entity.
    - `hasImage` boolean — Whether the company has a profile image.
    - `description` string, nullable — The description of the company.
    - `tags` DefaultTagModel[], nullable — The tags of the company.
      - `id` string, uuid — The Id of the tag.
      - `name` string, nullable — The name of the tag.
      - `color` string, nullable — The color of the tag.
      - `entityId` string, uuid — The id of the entity the tag is related to.
  - `tags` ProjectTagModel[], nullable — The tags for this project.
    - `id` string, uuid
    - `name` string, nullable — The name of the tag.
    - `color` string, nullable — The color of the tag.
  - `plannedDuration` integer, nullable — The total planned time of the project, in seconds. The time is calculated as te sum of the planned duration by all project tasks.
  - `totalPlannedDurationWithHierarchy` integer, nullable — The total planned duration of the project with hierarchy, in seconds. Calculated based on the planned durations of tasks and task lists of the project. Sum of Sum(TotalPlannedDurationWithHierarchy of all task lists) and Sum(TotalPlannedDurationWithHierarchy of all parent tasks without list)
  - `tasksCount` integer, nullable — The number of all tasks related to the project.
  - `tasksDoneCount` integer, nullable — The number of all tasks in status 'done' related to the project.
  - `members` ProjectMember[], nullable — The members of this project.
    - `id` string, uuid — The id of the project member entity.
    - `userId` string, uuid — The id of the user who is this project member.
    - `firstName` string, nullable — The first name of the user.
    - `lastName` string, nullable — The last name of the user.
    - `hasImage` boolean, nullable — Whether the user has an image.
    - `projectRoleId` string, uuid — The project role of the project member.
    - `projectRoleName` string, nullable — The project role name of the project member.
    - `isResponsible` boolean — Whether the user is responsible for this project.
    - `isDeactivated` boolean — Whether the user is deactivated.
    - `isExternal` boolean — True if this entity is coming from an external workspace (awork Connect).
  - `trackedDuration` integer, nullable — The summed up duration of all time trackings for this project.
  - `customFields` CustomField[], nullable — Custom fields of the project.
    - `customFieldDefinitionId` string, uuid — The custom field definition id.
    - `userIdValue` string, uuid, nullable — The the user id value.
    - `clientIdValue` string, uuid, nullable — The client id value.
    - `numberValue` number, double, nullable — The number value.
    - `selectionOptionIdValue` string, uuid, nullable — The selection option id value.
    - `selectionOption` CustomFieldSelectionOption
      - `id` string, uuid — The id of the custom field selection option.
      - `value` string, required — The selection value which can be later used in a select custom field.
      - `color` 'red' | 'orange' | 'yellow' | 'green' | 'cyan' | 'blue' | 'indigo' | 'purple' | 'steel' — The color of the selection option.
      - `order` number, double — The order of the custom field selection option.
    - `textValue` string, nullable — The text value.
    - `dateValue` string, date-time, nullable — The date value.
    - `booleanValue` boolean, nullable — The boolean value.
  - `resourceVersion` integer — The version of the entity, updated on every modification, to the ticks in UTC. Not identical to UpdatedOn.
  - `teams` TeamModel[], nullable — The teams the project is associated to.
    - `id` string, uuid — The id of the team.
    - `name` string, nullable — The name of the team.
    - `icon` string, nullable — The icon which is assigned to the team.
    - `color` string, nullable — The color of the team.
  - `isExternal` boolean — True if this entity is coming from an external workspace (awork Connect).
  - `isRetainer` boolean — Whether the project is a retainer project. Retainer projects have at least one retainer with budgets.
  - `isMultiAssignmentAllowed` boolean — Indicates whether multi-assignment is allowed for tasks in this project's workspace.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found

---

[API](https://skmtc.net/awork-io/apis/api-v1-reference.md) · [All operations](https://skmtc.net/awork-io/apis/api-v1-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/awork-io/api-v1-reference/versions/f784a53f60df/schema)
