State Management

  • Release version: Yokohama
  • Updated January 30, 2025
  • 2 minutes to read
  • Summarize
    Summarized using AI
    This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.

    Summary of State Management

    State Management in ServiceNow Yokohama release allows administrators to defineState ModelsandState Transitionsthat govern how records move through predefined states during their lifecycle. This functionality is active for all instances and is primarily used for tables extending the task table, enabling precise control over record workflows and state changes.

    Show full answer Show less

    State Models

    A State Model is a configured list of states representing an expected workflow for a record type. Administrators define these models in the State Model [sysstatemodel] table, specifying the target task table and conditions that determine when the model applies and how states transition. For example, a custom Reservation Request table could have states such as Held, Confirmed, Completed, and Canceled, with transitions defined accordingly.

    When enabled, the State field’s choice list is restricted to only valid states allowed by the state transitions, ensuring users select appropriate options consistent with the defined workflow.

    Note that ServiceNow provides example state models for change requests (normal, emergency, standard) which are disabled by default and meant only as templates. Customers should not enable or modify these examples for actual change request workflows to avoid disruption.

    State Transitions

    State Transitions specify the conditions required for entering or exiting each state within a state model, configured in the State Transitions [sysstatetransition] table using condition builders. These transitions enforce workflow rules by preventing any state changes that violate the defined conditions, regardless of whether the change is made through the user interface, scripts, or APIs such as REST or SOAP.

    For example, if the transition to the Completed state requires the record to be in the Confirmed state, then only records in Confirmed will show Completed as a selectable next state. This ensures compliance with the underlying process and maintains data integrity.

    Benefits for ServiceNow Customers

    • Enables standardized and controlled workflows across task-based records by defining allowed states and transitions.
    • Prevents invalid or out-of-sequence state changes, ensuring process compliance and reducing errors.
    • Supports customization for any task table, including custom applications, to enforce specific lifecycle flows.
    • Integrates with all forms of updates (UI, scripts, APIs) providing consistent enforcement of state rules.
    • Includes example models for reference to accelerate development of custom state models without impacting existing workflows.

    State Management enables an administrator to define State Models and State Transitions that control how a record is allowed to transition through a predefined list of states.

    An example of a state transition is when the State field in a facilities request is moved from the Assigned state to the Work In Progress state.

    State Management is active for all instances.

    What is a state model?

    A state model is a list of states that describe an expected record workflow through the lifecycle of the record. State models can be defined for any table that extends the task table. State models simplify defining the state transitions allowed for a specific task type.

    In the State Model [sys_state_model] table, define the name of the state model and which task table the state model is applied to. Use the condition builder to specify any conditions for applying the state model to records and any required condition for moving between states.

    For example, you could define a state model for a new custom application for airline reservations. The custom application has a Reservation Request [reservation_request] table with 4 states: Held, Confirmed, Completed, and Canceled. You could define the state model to target the Reservation Request table, and then define the state transitions for each of the 4 states. When you enable the state model, the choice list for the State field includes only the choices allowed by the conditions in the state transitions.

    Note:
    State Management includes example state models that are copies of the normal, emergency, and standard change request state models. By default, these examples are not enabled. Use them only as examples to develop a state model and transitions for a task table that does not have a state model. Do not enable these example state models for change requests and then make changes to them. Doing so breaks existing transitions for change requests.

    What is a state transition?

    State transitions are a list of conditions for entering or exiting each state defined for a table. In the State Transitions [sys_state_transition] table, use the condition builder to build a list of conditions required for entering or exiting each state.

    To prevent users from choosing an invalid state, any attempt to update a record’s state is denied if it violates the state transitions, whether the attempt is through user input, a script, a Web API such as REST or SOAP, or any other source.

    State transitions control the choice list for the State field on the target task table and prevent you from choosing any state value that does not adhere to the underlying process or does not meet the defined conditions for the transition.

    For example, if the enter condition for the Completed state is State is Confirmed, only records in the Confirmed state can transition to the Complete state. When a record is in the Confirmed state, the only choice in the State field choice list is Completed.