Skip to content

Sequences

A Sequence is an ordered, versioned collection of Actions that defines a workflow for deployment operations. Sequences allow you to chain multiple actions together in a specific order.

Sequences define the order in which actions execute. While actions are atomic units, sequences combine them into meaningful workflows:

Each sequence is:

  • Ordered - Actions execute in a defined sequence
  • Versioned - Like actions, sequences support semantic versioning
  • Composable - Reuse existing actions across multiple sequences
  • Flexible - Specify version requirements for action compatibility
ComponentDescription
NameDescriptive identifier (e.g., “Deploy Web Application”)
VersionSemantic version number
StepsOrdered list of action references with version requirements

Steps execute sequentially from lowest to highest order index:

OrderActionVersion RequirementDescription
0health-check^1.0.0Verify target is healthy
1stop-service>=1.0.0Gracefully stop the service
2deploy-files^2.0.0Deploy new application files
3start-service>=1.0.0Start the service
4smoke-test~1.2.0Verify deployment succeeded

Each action reference includes a version requirement using semver ranges:

RequirementMeaningExample Match
^1.0.0Compatible with 1.x.x1.0.0, 1.5.3, 1.9.9
>=2.0.02.0.0 or higher2.0.0, 3.1.0, 10.0.0
~1.5.01.5.x only1.5.0, 1.5.1, 1.5.99
=1.2.3Exact version only1.2.3
>=1.0.0,<2.0.0Range1.0.0 through 1.x.x

When a sequence version is created, Mantis resolves each action’s version requirement to the highest matching version available at that moment and pins the exact action version. During deployment, Mantis uses these already-pinned versions directly — no further resolution occurs at deploy time.

This means two sequence versions created at different times may resolve the same version requirement to different action versions, depending on which action versions existed at creation time. To pick up a newer action version, create a new sequence version.

  • Actions are atomic execution units
  • Sequences combine actions into ordered workflows
  • Solutions bundle sequences for complete deployment packages
  1. Navigate to Sequences in the sidebar
  2. Click New Sequence
  3. Enter a name (e.g., “Deploy Backend Service”)
  4. Specify the initial version (e.g., “1.0.0”)
  5. Add action steps:
    • Click Add Action
    • Select an action from the dropdown
    • Specify the version requirement
    • Repeat for additional steps
  6. Reorder steps using the up/down arrows
  7. Click Save

In the sequence editor, you can:

  • Add Steps - Include additional actions
  • Remove Steps - Delete unnecessary steps
  • Reorder Steps - Use the up/down arrow buttons to change execution order

Like actions, sequences use semantic versioning:

ScenarioVersion Change
Add a new stepMinor (1.0.0 -> 1.1.0)
Remove a stepMajor (1.0.0 -> 2.0.0)
Reorder stepsMajor (1.0.0 -> 2.0.0)
Update version requirementMinor (1.0.0 -> 1.1.0)
Fix typo in step configPatch (1.0.0 -> 1.0.1)

Sequence versions are immutable once created. To modify a sequence:

  1. Open the sequence detail page
  2. Click Add Version
  3. Configure the new version
  4. Save

This ensures deployments are reproducible and auditable.

Plan for steps that might fail:

  1. Pre-flight checks - Validate prerequisites before making changes
  2. Atomic operations - Each step should complete fully or not at all
  3. Post-deployment verification - Include health checks after changes

Balance between too many and too few steps:

Too GranularToo Coarse
20 single-command stepsOne monolithic script
Hard to maintainHard to debug
Slow executionNo visibility into progress

Aim for 5-10 logical steps that represent distinct phases of your deployment.

Use clear, workflow-oriented names:

GoodBad
deploy-web-applicationseq1
database-migrationdb_deploy_v2_final
rollback-frontendundo
Sequence: deploy-web-app (v1.0.0)
+-- Step 1: pre-flight-checks (^1.0.0)
+-- Step 2: backup-database (^2.0.0)
+-- Step 3: run-migrations (^1.5.0)
+-- Step 4: deploy-static-assets (^1.0.0)
+-- Step 5: deploy-application (^3.0.0)
+-- Step 6: warm-up-caches (^1.0.0)
+-- Step 7: health-check (^1.0.0)
Sequence: database-migration (v2.1.0)
+-- Step 1: backup-database (^2.0.0)
+-- Step 2: validate-migration-scripts (^1.0.0)
+-- Step 3: apply-migrations (^1.0.0)
+-- Step 4: verify-schema (^1.0.0)
+-- Step 5: update-connection-pools (^1.0.0)