Sandbox Automation in Qntrl | Configure Pre and Post Deployment Scripts | Sandbox Online Help | Qntrl Online Help

Sandbox Automation: Pre and Post Deployment Triggers

Sandbox allows users to configure automated actions before and after key deployment events - Project Association, Project Sync, and Project Deployment. These automations are implemented using Server Scripts that enable users to perform validations, enforce policies, or trigger additional actions automatically.

Automation Types   

Sandbox actions supports two types of script triggers:
  • Pre-Deployment Automations
    • Executed before an action occurs.
    • Ideal for validations or blocking incorrect actions.
  • Post-Deployment Automations
    • Executed after successful completion of an action.
    • Useful for syncing data, notifying external systems, or performing clean-up activities.

Example: Suppose you're deploying a project from Production to a Sandbox instance:
  • Pre-deployment: Validate that the right source and target environments are selected and halt the deployment if not.
  • Post-deployment: Once the deployment completes, it syncs metadata tables and notifies external systems.
 

Execution Flow   

When any sandbox trigger is initiated:
  1. Pre-action script (if configured) is executed first.
  2. The system then performs the main action: project association, sync, or deployment.
  3. After successful completion and import into the instance, the Post-action script (if configured) is triggered.
This sequence ensures critical checks are performed before deployment, and necessary follow-up actions happen after.

 

Configuring Pre-Deployment Automation 

  1. Click the settings gear icon   at the left pane.
  2. Navigate to Advanced >> Sandbox and click Pre Deployment Automation.
  3. By default, automation is disabled and cannot be toggled on immediately.
  4. To activate automation, under Script Tabs, select one or more Trigger Events:
    • Pre Project Association: Triggered before associating or changing a project.
    • Pre Project Sync: Triggered before syncing changes from one tier to another (e.g., Production → Staging).
    • Pre Deployment: Triggered after changes are queued for deployment but before the actual deployment begins.
  1. In the Script Editor, write your automation using the CodeX SDK.
  2. Click Publish Script to save the script.
  3. Once the first script is published, the automation toggle becomes available. You can now enable or disable it as needed.



Configuring Post-Deployment Automation   

  1. Click the settings gear icon   at the left pane.
  2. Navigate to Advanced >> Sandbox >> Post Deployment Automation.
  3. Similar to pre-deployment, the automation toggle will initially be inactive.
  4. To activate post-deployment automation, under Script Tabs, choose your Trigger Events:
    • Post Project Association: Triggered after associating or changing a project.
    • Post Project Sync: Triggered after syncing changes from one tier to another (e.g., Production → Staging).
    • Post Deployment: Triggered after the deployment.
  1. Write your automation logic in the Script Editor.
  2. Click Publish Script to save the configuration.
  3. After the first script is published, the automation toggle becomes available for future enabling/disabling.


Managing Scripts   

Edit Automation

  1. If only trigger locations are changed, Update Script Location will get visible and click that button.
  2. If the script code or both code and location are updated, click Publish Script to publish or Save Script as Draft to save the script as draft and publish it later.

Script Versions

  1. Switch between Draft and Published views using the toggle buttons below the editor.

Execution Logs   

Navigate to the Execution Logs tab to view:
  • Triggered event name
  • Execution status (Success/Failure)
  • Time taken to execute the script
  • Number of Codex SDK calls made
This helps track automation performance and troubleshoot any issues.







    • Related Articles

    • Build and Share Circuit Templates with Qntrl Studio

      Early Access Circuit Templates in Qntrl Studio is not enabled for all users. If you’d like to try it out, please email our support team for early access. Qntrl enables you to create pre-configured, ready-to-use Circuit templates that can be installed ...
    • Custom Function: Post_Messages_to_Zoho_Cliq_Channel

      This custom function can be used to post predefined messages to existing Zoho Cliq channels. Prerequisites Sign up for Zoho Cliq and create a channel with the required users. Only the members of this channel will receive messages. Business Scenario ...
    • Using Sandbox in Qntrl: A Step-by-Step Guide

      Early Access Sandbox is not enabled for all users. If you'd like to try it out, please email our support team for early access. Key Terms to Understand Sandbox A testing clone of your live environment. Environments A container for one or more ...
    • Other Setting options in Sandbox

      View Saved Changes in Repository The configuration changes are saved in the repository(only the configuration data not the real user data). The changes between the current version and previous version can only be saved. To view the saved ...
    • Projects (Testing environment) - An Overview

      Early Access This feature is not enabled for all users. If you'd like to try it out, please email our support team for early access. Running a business can become complex as it grows. Bringing in new changes and enhancements is likely in any business ...

    You are currently viewing the help articles of Qntrl 3.0. If you are still using our older version and require guidance with it, Click here.