> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Ensure child run

> Create or recover the child run of a parent run tool call.

`ensureChildAgentRun(input: EnsureChildAgentRunInput!): EnsureChildAgentRunResult!`

## Arguments

| Argument | Type | Required |
| - | - | - |
| `input` | [`EnsureChildAgentRunInput!`](https://veryfront.com/docs/cloud/graphql/types/ensurechildagentruninput) | Yes |

## Input fields

### input

[`EnsureChildAgentRunInput`](https://veryfront.com/docs/cloud/graphql/types/ensurechildagentruninput)

| Field | Type | Required | Description |
| - | - | - | - |
| `parentRunId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Yes | Run that delegates the work; the caller must hold its current execution credential. |
| `toolCallId` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Yes | Tool call in the parent run that starts the child; the pair identifies the child run. |
| `request` | [`JSON!`](https://veryfront.com/docs/cloud/graphql/types/json) | Yes | Child agent and the input to start it with. |

## Response

Returns [`EnsureChildAgentRunResult!`](https://veryfront.com/docs/cloud/graphql/types/ensurechildagentrunresult). Open the type for its fields and nested types.

| Field | Type | Description |
| - | - | - |
| `childConversationId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Task conversation the child run belongs to. |
| `childRunId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Child run ID. |
| `childMessageId` | [`ID!`](https://veryfront.com/docs/cloud/graphql/types/id) | Message that starts the child run. |
| `agentId` | [`String!`](https://veryfront.com/docs/cloud/graphql/types/string) | Agent that runs the child. |
| `duplicate` | [`Boolean!`](https://veryfront.com/docs/cloud/graphql/types/boolean) | True when the child already existed and was returned instead of created. |

Types marked with `!` cannot be null. Lists use `[Type]` notation. The [type index](https://veryfront.com/docs/cloud/graphql/schema.md) lists all published input and response types.

## Example

```graphql title="query.graphql" theme={null}
mutation EnsureChildAgentRun($input: EnsureChildAgentRunInput!) {
  ensureChildAgentRun(input: $input) {
    agentId
    childConversationId
    childMessageId
    childRunId
    duplicate
  }
}
```

```json title="variables.json" theme={null}
{
  "input": {
    "parentRunId": "00000000-0000-4000-8000-000000000001",
    "toolCallId": "example",
    "request": {}
  }
}
```

<details>
  <summary>Try this mutation</summary>

  Calls use `https://api.veryfront.com/graphql`. Replace sample values with resources you can access. See [Authentication](https://veryfront.com/docs/cloud/authentication.md) for credentials and permissions.

  Bearer token or API key

  Stored in this tab's session. Clear credential

  Mutation

  Variables (JSON)
</details>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.