> For the complete documentation index, see [llms.txt](https://docs.pyck.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pyck.cloud/graphql-api/mutations/executeinventoryrepositorymovement.md).

# Execute Inventory Repository Movement

Execute Inventory Repository Movement Mutation

Executes a pending repository movement, updating the repository's location in the system.

## Arguments

| Name | Type  | Description                              |
| ---- | ----- | ---------------------------------------- |
| `id` | `ID!` | ID of the repository movement to execute |

## Return Type

`InventoryRepositoryMovementOutput` - Contains the executed repository movement and any triggered workflows.

| Field                         | Type                 | Description                               |
| ----------------------------- | -------------------- | ----------------------------------------- |
| `inventoryRepositoryMovement` | `RepositoryMovement` | The executed repository movement          |
| `workflows`                   | `[TemporalWorkflow]` | Any workflows triggered by this operation |

## Usage Example

```graphql
mutation {
  executeInventoryRepositoryMovement(
    id: "movement-123"
  ) {
    inventoryRepositoryMovement {
      id
      executed
      executedAt
      repository {
        id
        name
        parentID
      }
      from {
        name
      }
      to {
        name
      }
    }
    workflows {
      id
      type
      status
      runID
    }
  }
}
```

## What Happens During Execution

1. **Validation**: Checks if movement can be executed
   * Movement must be pending (not already executed)
   * Not blocked by business rules
   * Repository must exist and be valid
2. **Location Update**:
   * Updates the repository's parentID to the destination
   * Updates any child repositories if applicable
   * Maintains location hierarchy
3. **Movement Update**:
   * Sets `executed` to true
   * Sets `executedAt` timestamp
   * Records the executing user
4. **Workflow Triggers**:
   * May trigger configured workflows
   * Can initiate automated processes

## Error Cases

* Movement already executed
* Movement is blocked
* Repository not found
* Invalid destination repository
* Circular reference (moving to self or child)

## Notes

* Execution is atomic - either fully completes or rolls back
* Changes the physical location tracking in the system
* Cannot be undone - create reverse movement to undo
* All items within the moved repository move with it


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.pyck.cloud/graphql-api/mutations/executeinventoryrepositorymovement.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
