API Docs / Operations / Task Workflows / Set Task Workflow

Set Task Workflow

POST /api/tenants/{tenant}/tasks/{taskCode}/workflow

Initializes workflow step instances for a TaskItem based on a workflow template.

Creates progress tracking records for each step in the specified workflow:

  • Creates TaskItemWorkflowStep instances for all workflow steps
  • Sets initial assignments based on workflow template rules
  • Resets progress counters and status to starting values
  • Clears any existing workflow progress

Warning: This operation clears all existing workflow progress.
Any completed steps will be lost and the workflow will restart from the beginning.

Use this endpoint to:

  • Assign a workflow to a task for the first time
  • Change the workflow assigned to a task
  • Reset workflow progress to start over
  • Set up workflow tracking for imported tasks

The workflow template defines:

  • Which steps are created
  • Initial step assignments
  • Step dependencies and ordering
  • Default completion requirements

Example Request:
{
"workflowCode": "CLIENT-ONBOARDING"
}

Parameters

NameTypeDescription
tenant* path string

The Tenant.Code

The Tenant.Code

taskCode* path string

The task code from the URL

The task code from the URL

The workflow initialization request

{
  "workflowCode": "string"
}

Responses

200 OK
401 Unauthorized - Invalid or missing API key