Output only. TaskGroup name.
The system generates this field based on parent Job name.
For example:
"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01".
Max number of tasks that can run in parallel.
Default to min(task_count, parallel tasks per job limit).
See: Job Limits.
Field parallelism must be 1 if the scheduling_policy is IN_ORDER.
When true, Batch will populate a file with a list of all VMs assigned to
the TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path
of that file. Defaults to false. The host file supports up to 1000 VMs.
Optional. If not set or set to false, Batch uses the root user to execute
runnables. If set to true, Batch runs the runnables using a non-root user.
Currently, the non-root user Batch used is generated by OS Login. For more
information, see About OS
Login.
Max number of tasks that can be run on a VM at the same time.
If not specified, the system will decide a value based on available
compute resources on a VM and task requirements.
public RepeatedField<Environment> TaskEnvironments { get; }
An array of environment variable mappings, which are passed to Tasks with
matching indices. If task_environments is used then task_count should
not be specified in the request (and will be ignored). Task count will be
the length of task_environments.
Tasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in
addition to any environment variables set in task_environments, specifying
the number of Tasks in the Task's parent TaskGroup, and the specific Task's
index in the TaskGroup (0 through BATCH_TASK_COUNT - 1).
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eTaskGroup\u003c/code\u003e class in the Google Cloud Batch v1 API defines a collection of tasks that share a common \u003ccode\u003eTaskSpec\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version of the \u003ccode\u003eTaskGroup\u003c/code\u003e class is 2.13.0, and documentation is available for versions ranging from 1.0.0 to 2.13.0.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eTaskGroup\u003c/code\u003e instances allow for configurable settings such as parallelism, SSH access, host file creation, and running tasks as a non-root user.\u003c/p\u003e\n"],["\u003cp\u003eTasks within a \u003ccode\u003eTaskGroup\u003c/code\u003e can be configured to run with specific environment variables and support different scheduling policies.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eTaskGroup\u003c/code\u003e class provides properties to define the number of tasks (\u003ccode\u003eTaskCount\u003c/code\u003e) and the maximum number of tasks that can run concurrently per VM (\u003ccode\u003eTaskCountPerNode\u003c/code\u003e).\u003c/p\u003e\n"]]],[],null,["# Batch v1 API - Class TaskGroup (2.13.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.13.0 (latest)](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.TaskGroup)\n- [2.12.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.12.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.11.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.11.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.10.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.10.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.9.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.9.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.8.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.8.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.7.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.7.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.6.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.6.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.5.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.5.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.4.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.4.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.3.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.3.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.2.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.2.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.1.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.1.0/Google.Cloud.Batch.V1.TaskGroup)\n- [2.0.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/2.0.0/Google.Cloud.Batch.V1.TaskGroup)\n- [1.3.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.3.0/Google.Cloud.Batch.V1.TaskGroup)\n- [1.2.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.2.0/Google.Cloud.Batch.V1.TaskGroup)\n- [1.1.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.1.0/Google.Cloud.Batch.V1.TaskGroup)\n- [1.0.0](/dotnet/docs/reference/Google.Cloud.Batch.V1/1.0.0/Google.Cloud.Batch.V1.TaskGroup) \n\n public sealed class TaskGroup : IMessage\u003cTaskGroup\u003e, IEquatable\u003cTaskGroup\u003e, IDeepCloneable\u003cTaskGroup\u003e, IBufferMessage, IMessage\n\nReference documentation and code samples for the Batch v1 API class TaskGroup.\n\nA TaskGroup defines one or more Tasks that all share the same TaskSpec. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e TaskGroup \n\nImplements\n----------\n\n[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[TaskGroup](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.TaskGroup), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[TaskGroup](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.TaskGroup), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[TaskGroup](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.TaskGroup), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html) \n\nInherited Members\n-----------------\n\n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Cloud.Batch.V1](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1)\n\nAssembly\n--------\n\nGoogle.Cloud.Batch.V1.dll\n\nConstructors\n------------\n\n### TaskGroup()\n\n public TaskGroup()\n\n### TaskGroup(TaskGroup)\n\n public TaskGroup(TaskGroup other)\n\nProperties\n----------\n\n### Name\n\n public string Name { get; set; }\n\nOutput only. TaskGroup name.\nThe system generates this field based on parent Job name.\nFor example:\n\"projects/123456/locations/us-west1/jobs/job01/taskGroups/group01\".\n\n### Parallelism\n\n public long Parallelism { get; set; }\n\nMax number of tasks that can run in parallel.\nDefault to min(task_count, parallel tasks per job limit).\nSee: [Job Limits](https://cloud.google.com/batch/quotas#job_limits).\nField parallelism must be 1 if the scheduling_policy is IN_ORDER.\n\n### PermissiveSsh\n\n public bool PermissiveSsh { get; set; }\n\nWhen true, Batch will configure SSH to allow passwordless login between\nVMs running the Batch tasks in the same TaskGroup.\n\n### RequireHostsFile\n\n public bool RequireHostsFile { get; set; }\n\nWhen true, Batch will populate a file with a list of all VMs assigned to\nthe TaskGroup and set the BATCH_HOSTS_FILE environment variable to the path\nof that file. Defaults to false. The host file supports up to 1000 VMs.\n\n### RunAsNonRoot\n\n public bool RunAsNonRoot { get; set; }\n\nOptional. If not set or set to false, Batch uses the root user to execute\nrunnables. If set to true, Batch runs the runnables using a non-root user.\nCurrently, the non-root user Batch used is generated by OS Login. For more\ninformation, see [About OS\nLogin](https://cloud.google.com/compute/docs/oslogin).\n\n### SchedulingPolicy\n\n public TaskGroup.Types.SchedulingPolicy SchedulingPolicy { get; set; }\n\nScheduling policy for Tasks in the TaskGroup.\nThe default value is AS_SOON_AS_POSSIBLE.\n\n### TaskCount\n\n public long TaskCount { get; set; }\n\nNumber of Tasks in the TaskGroup.\nDefault is 1.\n\n### TaskCountPerNode\n\n public long TaskCountPerNode { get; set; }\n\nMax number of tasks that can be run on a VM at the same time.\nIf not specified, the system will decide a value based on available\ncompute resources on a VM and task requirements.\n\n### TaskEnvironments\n\n public RepeatedField\u003cEnvironment\u003e TaskEnvironments { get; }\n\nAn array of environment variable mappings, which are passed to Tasks with\nmatching indices. If task_environments is used then task_count should\nnot be specified in the request (and will be ignored). Task count will be\nthe length of task_environments.\n\nTasks get a BATCH_TASK_INDEX and BATCH_TASK_COUNT environment variable, in\naddition to any environment variables set in task_environments, specifying\nthe number of Tasks in the Task's parent TaskGroup, and the specific Task's\nindex in the TaskGroup (0 through BATCH_TASK_COUNT - 1).\n\n### TaskGroupName\n\n public TaskGroupName TaskGroupName { get; set; }\n\n[TaskGroupName](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.TaskGroupName)-typed view over the [Name](/dotnet/docs/reference/Google.Cloud.Batch.V1/latest/Google.Cloud.Batch.V1.TaskGroup#Google_Cloud_Batch_V1_TaskGroup_Name) resource name property.\n\n### TaskSpec\n\n public TaskSpec TaskSpec { get; set; }\n\nRequired. Tasks in the group share the same task spec."]]