Precedence between data lookup, assignment, and business rules

  • Release version: Australia
  • Updated March 12, 2026
  • 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 Precedence between Data Lookup, Assignment, and Business Rules

    This content outlines the execution order of scripts, assignment rules, business rules, workflows, and other processes during database operations such as insert or update in ServiceNow. Understanding this precedence is crucial for effective configuration and troubleshooting in your ServiceNow instance.

    Show full answer Show less

    Key Features

    • Execution Order: The order of execution is critical, with specific scripts running before or after business rules depending on their configuration order.
    • Client-Side vs. Server-Side: Client-based code executes prior to server submission, ensuring immediate responsiveness in the user interface.
    • Async Business Rules: These run asynchronously after database operations, allowing for background processing without delaying the user experience.

    Key Outcomes

    By understanding the precedence of data lookup, assignment, and business rules, ServiceNow customers can:

    • Ensure correct execution of scripts and rules to meet business logic requirements.
    • Optimize performance and user experience by correctly timing operations.
    • Effectively troubleshoot issues related to data operations and rule execution.

    Scripts, assignment rules, business rules, workflows, escalations, and engines all take effect in relation to a database operation, such as insert or update. In many cases, the order of these events is important.

    Note:
    Client-based code that executes in the browser, using Ajax or running as JavaScript, will always execute before the form submission to the server.
    The order of execution is as follows:
    1. Before business rules: Scripts configured to execute before the database operation with an order less than 1000.
    2. Before engines. The following are not executed in any specific order:
      • Approval engine (for task and sys_approval_approver tables)
      • Assignment rules engine (for task tables)
      • Escalation engine
      • Data policy engine
      • Field normalization engine
      • Role engine - keeps role changes in sync with sys_user_has_role table (for sys_user, sys_user_group, sys_user_grmember, and sys_user_role tables)
      • Execution plan engine (for task tables)
      • Update version engine - creates version entry when sys_update_xml entry is written (for sys_update_xml table)
      • Data lookup engine inserts or updates
      • Workflow engine (for default workflows)
    3. Before business rules: Scripts configured to execute before the database operation with an order greater than or equal to 1000.
    4. The data base operation (insert, update, delete).
    5. After business rules: Scripts configured to execute after the database operation with an order less than 1000.
    6. After engines. The following are not executed in any specific order:
      • Label engine
      • Listener engine
      • Table notifications engine
      • Role engine - keeps role changes in sync with sys_user_has_role table (for sys_user, sys_user_group, sys_user_grmember and sys_user_role tables)
      • Text indexing engine
      • Update sync engine
      • Workflow engine (for deferred workflows)
      • Trigger engine (for all Workflow Studio flows)
    7. Email notifications. The following are executed based on the weight of the notification record:
      • Notifications sent on an insert, update, or delete
      • Event-based notifications
    8. After business rules (Only active records). Scripts configured to execute after the database operation with an order greater than or equal to 1000.
    Note:
    Like After business rules, Async business rules execute their logic after a database operation occurs. Unlike After business rules, Async business rules execute asynchronously, running in the background simultaneously with other processes. Async business rules run after the user submits the form and after the scheduler runs the scheduled job created from the business rule. The system creates a scheduled job from the business rule after the user submits the form but before any action is taken on the record in the database.