Skip to main content

Runtime variable support in experiments

Last updated on

Runtime variables provide flexibility in chaos experiments by allowing you to customize experiment parameters at execution time rather than hardcoding them during creation.

New Chaos Studio Feature

Runtime input variables are part of the enhanced New Chaos Studio experience. If you're an existing customer and want access to new features, contact your Harness support representative. For more details, see New Chaos Studio Features.

Create and Run Experiments

You can execute chaos experiments using either static values or dynamic runtime values.

  • Static variables: Define them directly in the experiment and use them without any modification.
  • Runtime variables: Specify them using <+input>, allowing customization at runtime or through saved input sets.

Use Runtime Variables

To set up an experiment, specify details such as the name, environment, infrastructure, and fault name. In the Target Application and Tune Fault modals, you can choose between Fixed value and Runtime Input. Once you choose the input type, Save the changes.

runtime variables

runtime variables

tip
  • If you don't provide values for certain fields (which are not mandatory), the experiment executes with default values.
  • Variables specified as runtime inputs appear as editable fields in the UI, whereas static fields appear as display-only.

Use Runtime Inputs in Pipelines

When you add a chaos experiment with runtime inputs to a Harness CD pipeline, those inputs automatically appear in the Experiment Inputs section of the chaos step configuration. You can then configure each input to be a runtime input for the pipeline as well, allowing you to provide values when the pipeline runs.

This enables you to:

  • Reuse the same experiment across multiple pipelines with different configurations
  • Dynamically provide experiment parameters at pipeline execution time
  • Customize chaos validation based on deployment context

For more information on using chaos experiments with runtime inputs in CD pipelines, see Using Runtime Inputs in Chaos Experiments.