How it Works: The Asynchronous Job Lifecycle
When you schedule a script, you create a Scheduled Script job within the SDX platform. This job progresses through a series of states, and its payload is delivered to target devices via our secure, poll-based communication model. This ensures commands are delivered reliably, even to devices on unstable connections.1. Creation & Authorization
You create a script and define its targets. The job begins in an
unauthorized state. An approver must then authorize it, moving it to scheduled. This two-step process provides a critical control gate for all network changes.2. Launch & Execution
At the scheduled
launch_at time, the job’s status changes to launched. For each target site, a unique Outcome record is created to track its individual progress.The Script Management Toolset
Our platform provides a complete ecosystem for the entire script lifecycle, from creation to execution.Scheduled Scripts
The core execution engine. Define a RouterOS script, select your target sites, and schedule it to run. Includes built-in safety features like pre-flight backups and a mandatory authorization workflow.
Script Templates
Build a library of reusable, standardized scripts. Templates can be private to your organization or designated as Global (read-only and available to all users), enforcing consistency and best practices.
Community Scripts
Don’t reinvent the wheel. Browse and import from a curated library of public scripts for common MikroTik tasks, sourced directly from the community on GitHub.Submit a Community Script
AI Script Generation
Your expert co-pilot. Describe your intent in plain English (e.g., “Block all traffic from this IP address”), and our AI will generate a functional and safe RouterOS script for you.Generate Script from Prompt
The Scripting Workflow: A Focus on Safety
Our workflow is designed with safety and control as top priorities, ensuring changes are tested, approved, and auditable.1. Create a Scheduled Script
- Navigate to Automation → Script Management and click Create Scheduled Script.
- Configuration:
- Description: Give the job a clear, auditable name (e.g., “Q4-2025: Nightly Guest WiFi Disable”).
- Script Content: Write your RouterOS script, or load it from a Template.
- Targets: Select the Site(s) where the script will run.
- Schedule: Set the Launch At time for the execution.
- Safety Options:
- Make Backup: (Highly Recommended) If enabled, the platform automatically prepends a command to your script that performs a secure configuration backup via SFTP before your script content is executed. This creates an immediate rollback point for every device.
- Test Site: Designate one of your target sites as a test site. This allows you to run a one-off test before scheduling the full deployment.
- Click Save. The script is now in an
unauthorizedstate.
2. Test the Script (Recommended)
Before deploying to your entire fleet, validate the script’s behavior on your designated test site.
- Find your newly created script in the list.
- Click the Run Test button.
- A test job is dispatched immediately only to the test site. Monitor the Orchestration Log for that site to verify the outcome and check for any errors.
3. Authorize the Execution
For security and compliance, a scheduled script must be explicitly authorized before it can run. This creates a clear, auditable approval record for all network changes.
- Once you are confident in your script, click the Request Authorization button.
- This triggers a notification (via Email and WhatsApp) to the designated approvers in your team, containing a unique, secure link to approve the script’s execution.
- An authorized user reviews the script details and approves it, moving its status to
Scheduled.
4. Monitor the Launch
At the scheduled
launch_at time, the job begins. You can monitor its progress in real-time from the Script Management dashboard, which shows the status of each target site: pending, completed, or failed. For detailed output from a specific device, consult its Orchestration Log.AI Script Generation
Leverage our generative AI to accelerate your scripting process and translate your operational intent into RouterOS code.- From the script editor, click on the AI Generate tab.
- In the prompt box, write a clear, concise description of the task you want to accomplish. For best results, state your goal and provide context (e.g., “I need to create a firewall rule to block access to our internal server at 10.1.1.5 from the guest VLAN”).
- Click Generate. The AI will produce a script based on your request.
Best Practices
Test Before You Deploy
Always use the Run Test feature on a non-critical site. This is the single most important step to prevent unintended consequences across your fleet.
Keep Scripts Atomic and Idempotent
Write scripts that are self-contained and can be run multiple times without causing errors. For example, use
find commands to check if a rule already exists before trying to add it, preventing duplicate configurations.Build a Template Library
For any script you plan to reuse, save it as a Template. This enforces consistency, saves your team time, and reduces the risk of copy-paste errors. Standardize common tasks by creating shared, read-only Global Templates.
Enterprise Architecture: Global Templates are available across your entire Organization hierarchy, making them ideal for MSPs and enterprises that need to enforce standard procedures across multiple workspaces and teams.