{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":4139,"path":"build-workflows/workflow-studio/exploring-decision-builder.md","title":"Decision tables workflow","bundle":null,"doc_type":null,"release":"australia","body":"\n# Decision tables workflow\n\nCreate and maintain decision tables in Workflow Studio for use in flows, subflows, playbooks,and anywhere on the ServiceNow AI Platform where you write code.\n\nDecision tables enable you to decouple decision logic from your code. This means that you can create a decision table in Workflow Studio with your application logic and then reference the decision table to execute the logic elsewhere, such as in a flow, playbook, or script. This decoupling enables you to create more efficient and maintainable flows and scripts and allows the decision logic to be managed directly by the relevant business subject matter expert.\n\n## Workflow for creating decision tables\n\nThe following illustration depicts the process for creating decision tables in Workflow Studio.\n\n\\[Omitted image \"db-workflow.png\"\\] Alt text: Infographic depicting the process of creating a decision table in Workflow Studio\n\nThe workflow for creating decision tables in Workflow Studio is as follows:\n\n1.  A developer writing a script or authoring a flow or subflow determines that a decision table is required. Decision tables are a more maintainable solution than hard-coded logic for the following scenarios:\n    -   The code contains a complex set of conditional, nested if/else or switch statements.\n    -   The logic powering the code might change frequently.\n    -   The application logic must be shared with non-developers in a readable format.\n    -   The application logic must be managed independently from where it is implemented.\n    -   Non-developers must manage the application logic.\n    -   The same logic must be applied in more than one flow, subflow, or script.\n    -   The developer must manage application or business logic separately from the code.\n2.  The developer creates the decision table in Workflow Studio and adds inputs and result columns \\(outputs for the decisions\\).\n3.  A developer or a business subject matter expert \\(SME\\) can perform the next steps.\n    1.  Add condition columns to structure the rules.\n    2.  Add decision rows to build conditional rules and corresponding results.\n    3.  Test the decision table.\n    4.  Publish the decision table.\n4.  The developer can use the decision table in a few ways.\n    -   They can create a code snippet of the decision table and insert it into their code.\n    -   They can add **Make a decision** logic in their flow or subflow and reference the decision table.\n    -   They can add a decision table to a playbook using the **Make a Decision - First Match** activity.\n5.  If the decision table must be updated to reflect updated logic, the developer or business SME can create a draft of the table. They can test the table using the updated logic and then publish the updated version. To create a decision table, see [Create decision tables in Workflow Studio](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/build-workflows/workflow-studio/create-decision-table-in-decision-designer.md).\n\n    **Note:** For any decision table that doesn't use draft authoring, any change the developer or business SME makes is automatically active.\n\n\n"}}