Execute Inventory Item Movement
Execute Inventory Item Movement Mutation
Executes a pending item movement, transferring the inventory and updating stock levels.
Arguments
id
UUID!
ID of the movement to execute
Return Type
InventoryItemMovementOutput - Contains the executed movement and any triggered workflows.
itemMovement
ItemMovement!
The executed item movement
workflows
[TemporalWorkflow]
Any workflows triggered by this operation
Usage Example
mutation {
executeInventoryItemMovement(
id: "movement-123"
) {
itemMovement {
id
quantity
executedAt
executedBy
fromRepository {
id
name
}
toRepository {
id
name
}
item {
id
sku
}
transactions {
id
quantity
repositoryID
}
}
workflows {
id
type
status
runID
}
}
}What Happens During Execution
Validation: Checks if movement can be executed
Movement must be pending (not already executed)
Not blocked by business rules
Sufficient stock available (unless from virtual repository)
Stock Updates:
Decreases stock in source repository
Increases stock in destination repository
Updates parent repository aggregations
Transaction Creation:
Creates outgoing transaction in source repository
Creates incoming transaction in destination repository
Movement Update:
Sets
executedAttimestampRecords
executedByuser ID
Error Cases
Movement already executed
Movement is blocked
Insufficient stock in source repository
Movement not found
Notes
Execution is atomic - either fully completes or rolls back
Virtual repositories bypass stock validation
Triggers any configured workflows
Cannot be undone - create reverse movement to undo
Last updated
Was this helpful?
