Restart agent
Overview of the Restart agent job step, which lets you restart an agent during a Job.
Restart agent is a job step which lets you restart an agent during a Job, which can be helpful when the agent is run in a Docker container. In this case restarting the agent would restart the container with all the software inside of it, consequently releasing PC resources for other tasks.

From the job step settings (Figure 1), you can customize information about the job step, including:
- A custom step name can be defined; otherwise, the default step name will be used
- If the clean workspace field is marked, the agent's working directory will be cleared and all data from it would be deleted
- Every step has Advanced options through which steps can be
managed. When execution of the step fails, execution of the job continues. If
option Abort job on step fail is marked, Job execution will stop once this step
fails and further steps will not be executed. When it comes to skip condition,
it allows skipping the current step if the condition is met.
Expression of the condition can include:
- a basic scenario, such as entering True/False directly or using an expression like 1 == 1.
- variable/value exist check - if the user adds
$parameter_name to the if clause, the Job
will be executed as long as the parameter name is
defined.
- variable can be referenced by using any of the following formats: ${parameter_name}, %parameter_name%, {{parameter_name}}, and $parameter_name.
- variable equal(==)/not equal(!=) to a certain value - if the user adds $parameter_name == some_value to the if clause and the values match, the Job will be executed.
- variable containing(~~)/not containing(!~) a certain value - if the user adds $parameter_name ~~ some_value and the value or parameter_name contains some_value, the Job will be executed.
- Within the execute if condition user can use environment variable AGENT_OS if needed, and create a condition based on the Agent's operating system.
Figure 2. Restart agent job step with advanced options shown
Note: In order to save a form, all input fields must be valid. Required fields are signed
with *.