> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.itential.com/itential-platform/6/studio/tasks/reference/childjob/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server. # childjob > Use the childjob task to run a separate workflow as a child job, enabling workflow reuse and parallel or sequential looping. Some jobs share a need for the same sequence of tasks. For this situation, you can create a separate workflow containing that task sequence and use the `childjob` task to run it. In addition to making workflows reusable, child jobs reduce complexity by replacing repeated task sequences with a smaller set of `childjob` tasks, improving readability. The `childjob` task also enables running multiple iterations of the same workflow in parallel or sequentially. ## Properties | Property | Description | | :------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | Workflow | Name of the child workflow to start. | | Loop Type | When looping is enabled, specifies the loop type. `None` starts a single child job; `Parallel` starts multiple child jobs simultaneously; `Sequential` starts them one at a time. | | Loop Array | Array of job variables to pass into each child job iteration. Each element must either match the child workflow's input schema or be transformed to match it. The maximum array length is 10,000 elements. Avoid large datasets to prevent task execution from stalling in the workflow engine. | | Input Source | When the child job requires job variables, select a job or task source to populate the Job Variable dropdown. | | Transformation (JST) | A JST to run on each element of Loop Array. Each element is set to `currentValue` in the transformation. The result is passed into the corresponding child job as job variables and must match the child's input schema. | Changes to variables within a child workflow are not incorporated into the parent workflow until the `childjob` task is reopened. Reopening the task validates the current child workflow status and inputs. For additional detail on using tasks in the new canvas, see [How to configure and manage tasks](/itential-platform/studio/workflows/tasks/configure-manage-tasks). ## Child jobs with no loop The `childjob` task starts a job inside the currently running job. The parent job waits for the child to finish (complete or cancelled) before progressing. If the child job is cancelled, it errors and the parent progresses along the error transition. If it completes, execution progresses along the success transition. Any job variables in the child job are placed in an object with `: ` key/value pairs. Variables can then be passed up to the parent via the outgoing schema of the child workflow. If a specific variable is needed, use a transformation to query out that key. By default, the **Enable Looping** slider is off. ![](/_fern-img/aec6e93fb3735efd780092b0f3a824106ddd8a425776a842b50c18981df0960c.webp) The task details show the **Workflow** input (the name of the workflow to run), looping disabled, and the **Workflow Input Job Variable** set to a string from a task. ![](/_fern-img/309f3008a704d9a7134668d01b84743c9bd201ff0a07fcb80dc8ec5e541e2427.webp) After the child job finishes with status complete, the output includes variables determined by the child job's output schema — in this case the incoming job variables, `_id`, and `initiator`. ![](/_fern-img/dd4d1109d72c642f13e6312c53e22682a9b50e90cc7a795942de9af4d2b523a7.webp) ## Child jobs that loop Multiple iterations of the same child job can be run sequentially or in parallel by setting the Loop Type to `sequential` or `parallel`. One iteration runs for each element of the **Loop Array**, so the array length determines the total number of child jobs. Sequential iterations run one after the previous finishes. Parallel iterations all start at once, and the `childjob` task finishes after the last child job completes. If the task loops and includes a transformation, the transformation runs on each Loop Array element to produce the job variables for each child job. A single incoming schema with `$id` and `currentValue` is created by default. When the task runs, each Loop Array element is passed as `currentValue`. Additional incoming schemas added to the transformation become additional JST parameters that can be passed through the `childjob` task for values that don't change across iterations. If the task loops without a transformation, each Loop Array element is passed directly as job variables. Each element must be type `object` with `: ` key/value pairs. A looping `childjob` task errors if all child jobs are cancelled. If at least one child job completes, the task ends with status `complete`. The job variables and final status of each iteration are returned in the task output under the `loop` property. When a parent job is cancelled while a looping `childjob` task is running, all non-completed iterations are also cancelled. ![](/_fern-img/b784d4112aa8693fe6e7dbb3dfbc8d158bea98dbe555edef0867cf13e052def7.webp) ### ChildJob loop index variable To access the index value within a child job running as a loop, an additional job variable named `childJobLoopIndex` is available. This prevents you from having to manually pass the index via the data array. Indexing starts at `0`. To use the `childJobLoopIndex` variable: #### Open the task Open the task in a workflow that is a child of a `runChildJob` task in a parent workflow. #### Switch the reference task Switch the **Reference Task** to `job`. #### Enable the reference variable field Select the dropdown for **Reference variable** to enable the field. #### Enter the variable name Click **Edit** and type `childJobLoopIndex`. #### Save Click **Save** to retain the changes. ![](/_fern-img/d2555e21273882a5234bf7ab6e5690f1ac9df7ed0a9c83bf1053f4b4b950538b.webp) ### Loop with transformation example In the following example, the child workflow named `child` runs with Loop Type set to `Parallel`. The loop settings are shown before a transformation is added. Without a transformation, each Loop Array element is passed directly as job variables — if any element is not type `object`, the task errors. Click **Create New Transformation (+)** to create a new local transformation, or select an existing one. ![](/_fern-img/776b9ba4b99a416cc5a4b629acd9a007b5f9176d8b5112732e306353b9f35ee5.webp) The transformation below shows `currentValue` connected to `getProperty`, which is then connected to each corresponding outgoing schema. After the child job task completes successfully, you can query the loop results. Results are wrapped in an object with a `status` field indicating whether all items finished, and a `loop` field containing an array of per-iteration results. ![](/_fern-img/da237d821591e7ce09bf4836600675c51bc069b16aa2a41c2340ef988469ea37.webp) ### Loop without transformation If the `childjob` task loops but has no transformation, Loop Array elements are passed directly as job variables to the child job. Note that using a transformation is the preferred approach for child job looping. ## Viewing task details for a childjob To open task details for a child job, navigate to the **Job Details** page in Operations Manager, click the menu button (⋮), and select **View** to open the task details dialog. ![](/_fern-img/b74f1295f851abd496223615445221b91c3bed47832bdab6732cbbdc1c0aa78a.webp) > Use the childjob task to run a separate workflow as a child job, enabling workflow reuse and parallel or sequential looping.