> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gorules.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulate decision

> Simulates a decision graph evaluation without persisting changes, useful for testing decision logic.



## OpenAPI

````yaml /openapi/brms.json post /api/projects/{projectId}/decisions/simulate
openapi: 3.0.3
info:
  title: GoRules BRMS
  version: local
servers: []
security: []
tags:
  - name: AI
    description: >-
      AI-powered assistant for interactive conversations and decision logic
      generation
  - name: Audit log
    description: Track and export organisation activity logs for compliance and monitoring
  - name: Branches
    description: >-
      Manage feature branches for collaborative decision development with
      commits and merging
  - name: Change requests
    description: Review and approve changes before merging or deploying to environments
  - name: Cloud
    description: Cloud-specific endpoints for organisation and client management
  - name: Decision
    description: Evaluate and simulate decision graphs with trace and performance data
  - name: Deployment workflows
    description: Manage deployment workflow runs and job approvals
  - name: Deployments
    description: Configure cloud storage providers for release deployments
  - name: Document
    description: Manage decision documents, versions, and file operations within projects
  - name: Environment
    description: >-
      Configure deployment environments with approval workflows and access
      tokens
  - name: Group
    description: Manage permission groups for project-level access control
  - name: Infrastructure
    description: Health check and infrastructure status endpoints
  - name: Integration
    description: Configure external integrations for HTTP requests and data sources
  - name: Invitation
    description: Manage organisation invitations for new members
  - name: Member
    description: Manage project membership and group assignments
  - name: Organisation
    description: Manage organisation settings, preferences, and licensing
  - name: Personal access token
    description: Create and manage personal access tokens for API authentication
  - name: Profile
    description: Manage current user profile settings
  - name: Project
    description: Create and manage projects with approval workflows
  - name: Release
    description: >-
      Package, version, and deploy decision documents. Learn more about
      [Releases](https://gorules.io/developers/brms/multi-environment)
  - name: Roles
    description: Define custom roles with permissions for organisation-wide access control
  - name: Security
    description: Manage project access tokens for API authentication
  - name: Templates
    description: Browse and apply project templates for quick onboarding
  - name: Test events
    description: Manage test events for decision evaluation and testing
  - name: User
    description: Manage organisation users, invitations, and service accounts
paths:
  /api/projects/{projectId}/decisions/simulate:
    post:
      tags:
        - Decision
      summary: Simulate decision
      description: >-
        Simulates a decision graph evaluation without persisting changes, useful
        for testing decision logic.
      operationId: simulateDecision
      parameters:
        - schema:
            type: string
            format: uuid
          in: path
          name: projectId
          required: true
          description: Unique identifier of the project
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                published:
                  type: boolean
                  default: true
                  description: >-
                    Indicates if simulation should use published decisions or
                    draft
                releaseId:
                  type: string
                  nullable: true
                  description: Optional release ID to use for loading dependent decisions
                context:
                  type: object
                  nullable: true
                  additionalProperties: true
                  default: {}
                  description: Evaluation context
                  example:
                    cart:
                      total: 1500
                    customer:
                      country: US
                      tier: gold
                graph:
                  description: Decision graph
                  example:
                    edges:
                      - id: 1dfbc57d-ad1f-4cf8-978a-e43241856fc8
                        type: edge
                        sourceId: be0a5c2d-538d-4e50-9843-91b274e1b9d8
                        targetId: 7c07550a-07bc-4ee4-80d6-9ad900e3d6c9
                      - id: 5e2dc187-3b82-4f21-94f5-9c3fd16e12d4
                        type: edge
                        sourceId: 7c07550a-07bc-4ee4-80d6-9ad900e3d6c9
                        targetId: 72d52cfc-e866-4c11-bf79-6be9f750e4d7
                    nodes:
                      - id: be0a5c2d-538d-4e50-9843-91b274e1b9d8
                        name: Request
                        type: inputNode
                        position:
                          x: 180
                          'y': 280
                      - id: 7c07550a-07bc-4ee4-80d6-9ad900e3d6c9
                        name: Fees
                        type: decisionTableNode
                        content:
                          rules:
                            - _id: vCqrZGdWjA
                              DA3Ybo-shA: '"US"'
                              FD4qBBPv2G: '> 1000'
                              JuUcECFGe1: '2'
                              jrsT5Wg9F8: '"gold"'
                              qA7iYc3Wle: ''
                            - _id: CpXx-s78FH
                              DA3Ybo-shA: '"US"'
                              FD4qBBPv2G: '> 1000'
                              JuUcECFGe1: '3'
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: ''
                            - _id: zH-PuRB2aQ
                              DA3Ybo-shA: '"US"'
                              FD4qBBPv2G: ''
                              JuUcECFGe1: ''
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: '25'
                            - _id: HjEp-eQhAP
                              DA3Ybo-shA: '"CA","MX"'
                              FD4qBBPv2G: '> 1000'
                              JuUcECFGe1: '5'
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: ''
                            - _id: nq40hJ1nXy
                              DA3Ybo-shA: '"CA","MX"'
                              FD4qBBPv2G: ''
                              JuUcECFGe1: ''
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: '50'
                            - _id: G64ltgrVgV
                              DA3Ybo-shA: '"IE","UK","FR","DE"'
                              FD4qBBPv2G: '> 1000'
                              JuUcECFGe1: '10'
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: ''
                            - _id: PD3oYgtiDa
                              DA3Ybo-shA: '"IE","UK","FR","DE"'
                              FD4qBBPv2G: ''
                              JuUcECFGe1: ''
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: '100'
                            - _id: 1BY7iMFoDw
                              DA3Ybo-shA: ''
                              FD4qBBPv2G: '> 1000'
                              JuUcECFGe1: '15'
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: ''
                            - _id: dlwJlbW7ZH
                              DA3Ybo-shA: ''
                              FD4qBBPv2G: ''
                              JuUcECFGe1: ''
                              jrsT5Wg9F8: ''
                              qA7iYc3Wle: '150'
                          inputs:
                            - id: FD4qBBPv2G
                              name: Cart Total
                              type: expression
                              field: cart.total
                            - id: DA3Ybo-shA
                              name: Customer Country
                              type: expression
                              field: customer.country
                            - id: jrsT5Wg9F8
                              name: Customer Tier
                              type: expression
                              field: customer.tier
                          outputs:
                            - id: qA7iYc3Wle
                              name: Fees Flat ($)
                              type: expression
                              field: fees.flat
                            - id: JuUcECFGe1
                              name: Fees Percent
                              type: expression
                              field: fees.percent
                          hitPolicy: first
                        position:
                          x: 420
                          'y': 280
                      - id: 72d52cfc-e866-4c11-bf79-6be9f750e4d7
                        name: Response
                        type: outputNode
                        position:
                          x: 670
                          'y': 280
      responses:
        '200':
          description: Successful simulation result with trace data
          content:
            application/json:
              schema:
                type: object
                properties:
                  result:
                    description: The computed result from the decision evaluation
                  performance:
                    type: string
                    description: Total execution time of the decision
                  trace:
                    type: object
                    additionalProperties:
                      type: object
                      properties:
                        id:
                          type: string
                          description: Unique identifier of the trace node
                        name:
                          type: string
                          description: Name of the decision node
                        input:
                          description: Input data passed to this node
                        output:
                          description: Output data produced by this node
                        traceData:
                          description: Additional trace metadata for the node
                        performance:
                          type: string
                          description: Execution time for this node
                      required:
                        - id
                        - name
                    description: >-
                      Detailed trace of each node execution when trace is
                      enabled
                additionalProperties: true
                description: Successful simulation result with trace data
        '400':
          description: Simulation failed due to invalid input or decision logic error
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    description: Error message describing the simulation failure
                  data:
                    description: Additional error details from the decision engine
                description: Simulation failed due to invalid input or decision logic error
      security:
        - personalAccessToken: []
        - internalAuth: []
components:
  securitySchemes:
    personalAccessToken:
      type: http
      scheme: bearer
      description: Personal access token is obtained through your profile
    internalAuth:
      type: http
      scheme: internal
      description: Cannot be used directly

````