EntryWorkflowStage

View as Markdown

EntryWorkflowStage

EntryWorkflowStage holds the workflow stage details that the SetWorkflow and SetWorkflowAsync methods of Entry send.

When to Use This Class: Use this class to move an entry to a workflow stage and assign it to users or roles.

Conceptual Role: Acts as the data model that the SDK sends under the workflow.workflow_stage key of a set entry workflow stage request.

Returns: EntryWorkflowStage. The workflow stage details of an entry.

Properties

NameTypeRequiredDefaultDescription
Uidstring?NonullUID of the target workflow stage. Sent as uid.
Commentstring?NonullComment for the assignees. Sent as comment.
DueDatestring?NonullDue date of the stage. Sent as due_date.
NotifyboolNotrueNotifies the assignees. Sent as notify.
AssignedToList<AssignToUser>?NonullUsers to assign. Sent as assigned_to.
AssignedByRolesList<AssignByRole>?NonullRoles to assign. Sent as assigned_by_roles.

Class-Level Notes

What the SDK sends.

  • The SDK sends every property that is not null. Notify is a bool, so the SDK always sends it, as true unless you set it to false.
  • The SDK does not check any property. The API rejects a stage UID that the workflow of the content type does not have.
  • Set Uid to the UID of the stage. The Content Management API (CMA) reference asks for the stage UID, a comment, a due date, the notification setting, and the assigned users. See Set entry workflow stage.

Assignees.

  • Each item of AssignedTo is an AssignToUser with the user's UID, name, and email.
  • Each item of AssignedByRoles is an AssignByRole with the role's UID and name.

Method Index

EntryWorkflowStage has no methods. Set its properties and pass it to the SetWorkflow method of Entry.

Class-Level Snippet

The snippet below moves an entry to a review stage, assigns one user and one role, and sets a due date.

using System;
using System.Collections.Generic;
using Contentstack.Management.Core;
using Contentstack.Management.Core.Exceptions;
using Contentstack.Management.Core.Models;

ContentstackClient client = new ContentstackClient("<AUTHTOKEN>");

EntryWorkflowStage stage = new EntryWorkflowStage
{
    Uid = "<WORKFLOW_STAGE_UID>",
    Comment = "Ready for review",
    DueDate = "2026-12-15",
    Notify = true,
    AssignedTo = new List<AssignToUser>
    {
        new AssignToUser { Uid = "<USER_UID>", Name = "Jane Doe", Email = "<EMAIL>" }
    },
    AssignedByRoles = new List<AssignByRole>
    {
        new AssignByRole { Uid = "<ROLE_UID>", Name = "Content Manager" }
    }
};

try
{
    ContentstackResponse response = client.Stack("<API_KEY>").ContentType("<CONTENT_TYPE_UID>").Entry("<ENTRY_UID>").SetWorkflow(stage);
    Console.WriteLine(response.OpenJsonObjectResponse()["notice"]);
}
catch (ContentstackErrorException e)
{
    // Thrown when the API rejects the request
    Console.WriteLine($"Request failed: {(int)e.StatusCode} {e.ErrorCode} {e.ErrorMessage}");
}