Restricting Task Execution to a Single Concurrent Job Using MaxJobThreads
4 min
Overview
Control concurrent execution of a task to ensure it runs only once at a time or within a defined concurrency limit.
Use Cases
- Prevent simultaneous file exports that could overwrite or corrupt output
- Avoid exceeding concurrent session limits (e.g., PowerShell sessions)
- Throttle resource-intensive tasks
Resolution
Limit Task to Single Execution
Configure the task parameter:
- Parameter Name: MaxJobThreads
- Value: 1
This ensures:
- The first submitted job runs immediately
- Subsequent jobs are queued and executed sequentially after the previous job completes
Limit to a Specific Concurrency Level
If limited parallelism is acceptable:
- Set MaxJobThreads to a value greater than 1 (e.g., 2, 3, etc.)
This allows multiple jobs to run concurrently up to the defined limit, helping manage resource utilization.
Important Notes
- The correct parameter name is MaxJobThreads
- Parameters such as MaxJobs are incorrect and will not enforce concurrency limits as intended
- Queued jobs will execute in order as threads become available