---
title: "Updates the workflow definition for an envelope."
method: PUT
path: "/v2.1/accounts/{accountId}/envelopes/{envelopeId}/workflow"
tags: ["EnvelopeWorkflowDefinition"]
---

# Updates the workflow definition for an envelope.

`PUT /v2.1/accounts/{accountId}/envelopes/{envelopeId}/workflow`

Updates the specified envelope's workflow.

You can use this endpoint to add scheduled sending to a draft envelope. You can also update the scheduled sending for a sent envelope if the scheduled sending countdown is in progress. In that case, the envelope will be reset to a draft state.

You can also add delayed routing to a draft envelope or a sent envelope that has not started workflow processing.

## Path parameters

- `accountId` string, required
- `envelopeId` string, required

## Request body

- Workflow — Describes the workflow for an envelope.
  - `currentWorkflowStepId` string — The `workflowStepId` of the current step. This is not an index into the `workflowSteps` array in this object. See the `workflowStep` object.
  - `resumeDate` string — The ISO 8601 timestamp of when the envelope is scheduled to be sent, if applicable. Its value is the maximum of the `resumeDate` property on `scheduledSending` and the `resumeDate` property on the current `workflowStep`. This property is read-only.
  - `scheduledSending` ScheduledSending — A complex element that specifies the scheduled sending settings for the envelope.
    - `bulkListId` string — The ID of the bulk list. Set this optional value to use scheduled sending with a bulk send operation.
    - `resumeDate` string — The timestamp of when the envelope is scheduled to be sent in ISO 8601 format. This property is read-only.
    - `rules` EnvelopeDelayRule[] — User-specified rules indicating how and when the envelope should be scheduled for sending. Only one rule may be specified.
      - `delay` string — A string timespan representing the duration of the sending delay. The timespan is in the format `d.hh:mm:ss` where `d` is the number of days, `hh` is the number of hours (measured on a 24-hour clock), `mm` is minutes, and `ss` is seconds. The maximum delay is 30 days.
      - `resumeDate` string — An ISO 8601 formatted datetime string indicating the date and time that the envelope will be sent. The specified datetime must occur in the future. It must not exceed 30 days from the time that the request is made.
    - `status` string — Status of the scheduled sending job. Valid values: * `pending`: The envelope has not yet been sent and the scheduled sending delay has not been initiated. * `started`: The sender has initiated the sending process. The delay has not elapsed, so the envelope has not yet been sent to the first recipient. * `completed`: The delay has elapsed and the envelope has been sent to the first recipient. This property is read-only.
  - `workflowStatus` string — The status of the workflow: - `paused` if the workflow is paused - `in_progress` if the workflow is in progress
  - `workflowSteps` WorkflowStep[] — An array of workflow steps.
    - `action` string — Indicates the action to perform. Valid values: - `pause_before`: The workflow should pause before the trigger described by `triggerOnItem` is reached.
    - `completedDate` string — The timestamp of when the workflow step transitioned to `completed` status. This property is read-only.
    - `delayedRouting` DelayedRouting — A complex element that specifies the delayed routing settings for the workflow step.
      - `resumeDate` string — The ISO 8601 timestamp of when the envelope is scheduled to be sent to the recipients associated with the workflow step. This property is `null` if the workflow step has not been initiated. This property is read-only.
      - `rules` EnvelopeDelayRule[] — User-specified rules indicating how and when the envelope should sent for the workflow step and its associated recipients. Only one rule may be specified.
        - `delay` string — A string timespan representing the duration of the sending delay. The timespan is in the format `d.hh:mm:ss` where `d` is the number of days, `hh` is the number of hours (measured on a 24-hour clock), `mm` is minutes, and `ss` is seconds. The maximum delay is 30 days.
        - `resumeDate` string — An ISO 8601 formatted datetime string indicating the date and time that the envelope will be sent. The specified datetime must occur in the future. It must not exceed 30 days from the time that the request is made.
      - `status` string — Status of the delayed routing step. Valid values: * `pending`: The workflow step has not been reached and the delay has not been initiated. * `started`: The workflow step has begun and the delay is in progress. The envelope has not yet been sent to the workflow step's recipients. * `completed`: The delay has elapsed and the envelope has been sent to the workflow step's recipients. This property is read-only.
    - `itemId` string — The unique ID of the item being triggered.
    - `recipientRouting` RecipientRouting — Describes the recipient routing rules.
      - `rules` RecipientRules
        - `conditionalRecipients` ConditionalRecipientRule[]
          - `conditions` ConditionalRecipientRuleCondition[] — An array of conditions that define when the recipients will be used.
            - `filters` ConditionalRecipientRuleFilter[]
              - …
            - `order` string — An integer that specifies the order in which rules are processed. Lower values are processed before higher values.
            - `recipientLabel` string — An identifier for the recipient. After assigning this value in a `recipient` object, you can reference it in the `conditions` object to set the recipient as a conditional recipient. For an example, see [How to use conditional recipients](/docs/esign-rest-api/how-to/use-conditional-recipients/).
          - `order` string — An integer that specifies the order in which rules are processed. Lower values are processed before higher values.
          - `recipientGroup` RecipientGroup — Describes a group of recipients.
            - `groupMessage` string — The group message, typically a description of the group.
            - `groupName` string — The name of the group.
            - `recipients` RecipientOption[] — An array of recipient objects that provides details about the recipients of the envelope.
              - …
          - `recipientId` string — The ID of the recipient to whom the condition will be applied. This value should match the `recipientId` defined in the recipient object.
    - `status` string — The status of the step. Valid values: - `inactive` - `in_progress` - `paused` - `pending` - `completed` This property is read-only.
    - `triggeredDate` string — The timestamp of when the workflow step transitioned to `in_progress` status. This property is read-only.
    - `triggerOnItem` string — The type of item that triggers this workflow step. Valid values: * `routing_order`
    - `workflowStepId` string — A unique identifier for this workflow step. This property is read-only.

## Response `200`

Successful response.

## Other responses

- `400` — Error encountered.

---

[API](https://skmtc.net/docusign/apis/docusign-esignature-rest-api.md) · [All operations](https://skmtc.net/docusign/apis/docusign-esignature-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/docusign/docusign-esignature-rest-api/versions/77f1998c313d/schema)
