---
title: "Set the task due date rule"
method: PUT
path: "/workflows/{workflowId}/revisions/{revisionId}/tasks/{taskId}/due-date-rule"
tags: ["Workflow Task Due Date Rules"]
---

# Set the task due date rule

`PUT /workflows/{workflowId}/revisions/{revisionId}/tasks/{taskId}/due-date-rule`

Sets the single due date rule for a task on a draft workflow revision, replacing any existing rule. Send `rule: null` (or omit the field) to clear the existing rule. Due date rules cannot be **set** on headings, AI tasks, or Code tasks — but clearing is always permitted so stale rules left over from prior task edits can be removed. `sourceWidgetId` is required when `sourceType` is `FormFieldValue` and must reference a Date form field widget in the same revision. `sourceTaskId` is required when `sourceType` is `TaskCompletedDate` or `TaskDueDate`; it must reference a task earlier than the target task in the same revision and cannot be the target task itself. Returns the resulting rule.

## Path parameters

- `workflowId` string, required
- `revisionId` string, required
- `taskId` string, required

## Request body

- UpdateTaskDueDateRuleRequest
  - `rule` object — The rule to set; omit or send `null` to clear the existing rule.
    - `sourceType` 'FormFieldValue' | 'TaskCompletedDate' | 'PreviousTaskCompletedDate' | 'TaskDueDate' | 'ChecklistStartDate' | 'ChecklistDueDate', required — How the task's due date is derived. `ChecklistStartDate` / `ChecklistDueDate` — relative to the workflow run's start or due date. `TaskCompletedDate` / `TaskDueDate` — relative to a specific source task (requires `sourceTaskId`). `PreviousTaskCompletedDate` — relative to the task immediately before this one. `FormFieldValue` — relative to a Date form field value (requires `sourceWidgetId`).
    - `sourceWidgetId` string — For `sourceType=FormField`: the ID of the Members form field whose value drives the rule's assignees at runtime. Absent for `sourceType=ChecklistInitiator`.
    - `sourceTaskId` string
    - `offsetDirection` 'Before' | 'After', required — Whether the offset applies before or after the source date.
    - `dueOffset` string, required — ISO-8601 duration (e.g. `P7D`, `PT4H30M`).
    - `businessDaysHandlingMode` 'AllDays' | 'BusinessDaysOnly' | 'ShiftToNextBusinessDay', required — How non-business days are handled when calculating the due date. `AllDays` counts every day. `BusinessDaysOnly` counts only Monday–Friday. `ShiftToNextBusinessDay` calculates using all days then moves a Saturday/Sunday result to the next Monday.

## Response `200`

- GetTaskDueDateRuleResponseResponse
  - `data` object, required — The resource returned by this request.
    - `rule` object — The task's due date rule, or `null` if none is set.
      - `sourceType` 'FormFieldValue' | 'TaskCompletedDate' | 'PreviousTaskCompletedDate' | 'TaskDueDate' | 'ChecklistStartDate' | 'ChecklistDueDate', required — How the task's due date is derived. `ChecklistStartDate` / `ChecklistDueDate` — relative to the workflow run's start or due date. `TaskCompletedDate` / `TaskDueDate` — relative to a specific source task (requires `sourceTaskId`). `PreviousTaskCompletedDate` — relative to the task immediately before this one. `FormFieldValue` — relative to a Date form field value (requires `sourceWidgetId`).
      - `sourceWidgetId` string — For `sourceType=FormField`: the ID of the Members form field whose value drives the rule's assignees at runtime. Absent for `sourceType=ChecklistInitiator`.
      - `sourceTaskId` string
      - `offsetDirection` 'Before' | 'After', required — Whether the offset applies before or after the source date.
      - `dueOffset` string, required — ISO-8601 duration (e.g. `P7D`, `PT4H30M`).
      - `businessDaysHandlingMode` 'AllDays' | 'BusinessDaysOnly' | 'ShiftToNextBusinessDay', required — How non-business days are handled when calculating the due date. `AllDays` counts every day. `BusinessDaysOnly` counts only Monday–Friday. `ShiftToNextBusinessDay` calculates using all days then moves a Saturday/Sunday result to the next Monday.
  - `links` object[] — Pagination links. When the result has more pages, look for an entry with `name: "next"` — its `href` is the URL to fetch the next page. Absence of `next` means there are no more pages. For single-resource responses this array is typically empty.
    - `name` string, required — Standard link relation name (RFC 5988) indicating this link's role. Common values include `self`, `edit`, `related`, `previous`, `next`.
    - `href` string, required — URL of the linked resource.
    - `rel` 'Approval Task' | 'Approvals' | 'Assignees' | 'Comment' | 'Data Set Records' | 'Data Sets' | 'Form Field Values' | 'Subject Task' | 'Task' | 'Tasks' | 'Users' | 'Webhook' | 'Workflow' | 'Workflow Run' — Optional. The kind of resource this link points to (e.g. `Workflow`, `Task`, `Comment`).
    - `type` 'Api' | 'App', required — Whether this link targets an API endpoint or a Process Street app URL. `Api` — a callable API endpoint you can fetch directly. `App` — a browser-facing URL in the Process Street UI.

## Other responses

- `400` — Invalid value for: body
- `default`

---

[API](https://skmtc.net/process/apis/process-street-public-api.md) · [All operations](https://skmtc.net/process/apis/process-street-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/process/process-street-public-api/revisions/6199a9464227/schema)
