Skip to main content

Automation & Scheduling

Automate routine tasks in your SureStage workspace with scheduled jobs. Configure simulations to reset, data to refresh, health checks to run, and reports to generate on a recurring schedule.

Automation Dashboard

Access the automation dashboard at Settings > Automation to view and manage all scheduled tasks.

The dashboard shows:

  • Active tasks - Currently scheduled and running
  • Paused tasks - Configured but temporarily disabled
  • Task history - Recent executions with success/failure status
  • Next run times - Upcoming task schedule

Quick Actions

  • Create Task - Schedule a new automation
  • Run Now - Manually trigger a task outside its schedule
  • Pause/Resume - Temporarily disable or re-enable a task
  • View Logs - See execution history and debug failures

Task Types

Scheduled Simulation Reset

Reset a simulation to a clean state on a regular schedule.

Use cases:

  • Daily reset of demo environments before prospect meetings
  • Nightly cleanup of test data between test runs
  • Weekly refresh of sandbox state for QA teams

Configuration:

  1. Click Create Task > Simulation Reset
  2. Select the simulation to reset
  3. Choose reset behavior:
    • Clear state only - Wipe state data, keep configuration
    • Full reset - Clear state and request logs
    • Reset to snapshot - Restore to a saved snapshot
  4. Set schedule (see Scheduling section below)
  5. Click Create Task

Data Refresh

Refresh mock data from an external source or regenerate with AI.

Use cases:

  • Sync mock data with staging database overnight
  • Regenerate realistic data weekly for testing
  • Update API responses when dependent services change

Configuration:

  1. Click Create Task > Data Refresh
  2. Select the simulation and routes to refresh
  3. Choose data source:
    • External API - Fetch fresh data from a real endpoint
    • Database query - Pull data from a connected database
    • AI generation - Use StageAssist to regenerate realistic data
  4. Set schedule
  5. Click Create Task

Health Checks

Verify your simulations are responding correctly.

Use cases:

  • Monitor critical demo environments before customer meetings
  • Continuous smoke testing of mock APIs
  • Alert when a simulation becomes unreachable

Configuration:

  1. Click Create Task > Health Check
  2. Select the simulation to monitor
  3. Define health criteria:
    • Response time threshold - Maximum acceptable latency (ms)
    • Expected status codes - Which responses indicate health
    • Required routes - Endpoints that must be accessible
  4. Set notification preferences (see Notifications section)
  5. Set schedule
  6. Click Create Task

Report Generation

Generate and email reports on simulation usage, performance, or activity.

Use cases:

  • Weekly summary of demo environment usage
  • Monthly analytics on API mock performance
  • Daily activity report for compliance tracking

Configuration:

  1. Click Create Task > Report Generation
  2. Select report type:
    • Usage report - Request volume, active users, popular endpoints
    • Performance report - Response times, error rates, latency
    • Activity report - Changes, deployments, team actions
  3. Choose scope (specific simulations or all)
  4. Set delivery:
    • Email recipients - Who receives the report
    • Format - PDF, CSV, or JSON
  5. Set schedule
  6. Click Create Task

Scheduling

All tasks use cron-based scheduling for precise control.

Quick Schedule Options

Common patterns are available as presets:

  • Every hour - 0 * * * *
  • Daily at midnight - 0 0 * * *
  • Weekdays at 9 AM - 0 9 * * 1-5
  • Weekly on Monday - 0 0 * * 1
  • First day of month - 0 0 1 * *

Custom Cron Expression

For advanced scheduling, enter a cron expression directly.

Format: minute hour day month weekday

Examples:

  • 0 */6 * * * - Every 6 hours
  • 30 8 * * 1,3,5 - 8:30 AM on Mon, Wed, Fri
  • 0 0 1,15 * * - Midnight on 1st and 15th of each month

Timezone: Tasks run in your organization's configured timezone (see Localization Settings).

Manual Triggers

Run any task immediately without waiting for the schedule:

  1. Navigate to Settings > Automation
  2. Find the task in the list
  3. Click Run Now

The manual run does not affect the regular schedule.

Task History

View execution logs for any task:

  1. Click the task name in the automation dashboard
  2. Navigate to the History tab

Each execution shows:

  • Start and end timestamp
  • Duration
  • Status (Success, Failed, Timeout, Cancelled)
  • Output logs
  • Error messages (if failed)

Filtering History

  • Date range - Show executions within a specific period
  • Status filter - Show only successes or failures
  • Search - Find logs containing specific text

Notifications

Get notified when tasks complete or fail.

Notification Channels

Configure where notifications are sent:

  • In-app - Notification bell in SureStage header (see Notifications)
  • Email - Sent to task owner or specific addresses
  • Webhook - POST to an external URL (Slack, PagerDuty, etc.)

Notification Settings

  1. Open a task's settings
  2. Navigate to the Notifications tab
  3. Choose notification triggers:
    • On failure only - Alert when a task fails
    • On success and failure - Always notify
    • On first failure - Alert once when a task starts failing
    • Never - No notifications
  4. Select notification channels
  5. Click Save

Notification Payload

Webhook notifications include:

{
"task_id": "task_abc123",
"task_name": "Daily Demo Reset",
"task_type": "simulation_reset",
"status": "failed",
"started_at": "2026-03-21T08:00:00Z",
"completed_at": "2026-03-21T08:00:15Z",
"duration_ms": 15000,
"error": "Simulation not found: sim_xyz789"
}

Managing Tasks

Editing a Task

  1. Navigate to Settings > Automation
  2. Click the task name
  3. Modify configuration or schedule
  4. Click Save Changes

Tasks continue running on the old schedule until saved.

Pausing a Task

Temporarily disable a task without deleting it:

  1. Navigate to Settings > Automation
  2. Click the pause icon next to the task
  3. Confirm

The task remains configured but stops executing. Resume by clicking the play icon.

Deleting a Task

  1. Navigate to Settings > Automation
  2. Click the task name
  3. Click Delete Task
  4. Confirm deletion

Task history is preserved for audit purposes but the task no longer executes.

Best Practices

Test before scheduling - Use Run Now to verify task behavior before setting a recurring schedule.

Monitor first runs - Check task history after the first scheduled execution to catch configuration issues early.

Use health checks liberally - Automated health checks catch simulation problems before users do.

Set realistic timeouts - Give tasks enough time to complete. Default timeout is 5 minutes.

Consolidate reports - One weekly summary report is more actionable than daily noise.

Common Issues

Task not running - Check that the task is not paused. Verify the cron expression is valid and the next run time is in the future.

Task timing out - Increase the timeout in task settings or optimize the task (e.g., reset fewer simulations at once).

Notifications not received - Verify notification settings in the task configuration. Check spam folder for email notifications.

Data refresh failing - Ensure external API credentials are current. Check that the data source is accessible from SureStage.

Next Steps