> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/fr/sdks/bulk-workflow-operations.md).

# Opérations de workflow groupées

Attribuez ou déplacez de nombreuses tâches de workflow Unitlab en un seul appel du SDK Python, avec un dry run avant tout déplacement.

```python
workflow = project.workflow
annotate = workflow.get_stage(name="Annotate")
task_ids = [task.id for task in annotate.get_tasks()][:200]

workflow.assign_tasks(task_ids, user_id="USER_ID")

review = workflow.get_stage(stage_type="review")
plan = workflow.move_tasks(task_ids, destination_stage=review.id, reason="Spot check", dry_run=True)
print(plan)
workflow.move_tasks(task_ids, destination_stage=review.id, reason="Spot check")
```

| Appel                                                                            | Limite     | Remarques                                                                                                      |
| -------------------------------------------------------------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------- |
| `workflow.assign_tasks(task_ids, user_id=...)`                                   | 500 tâches | Attribue chaque tâche à un seul membre                                                                         |
| `workflow.move_tasks(task_ids, destination_stage=..., reason="", dry_run=False)` | 500 tâches | Ne tient pas compte des liaisons du workflow. `dry_run=True` indique ce qui serait déplacé sans rien modifier. |

Découpez les listes plus longues en lots de 500. `destination_stage` accepte un handle d'étape ou un identifiant.

Un déplacement vers une étape Model ou Agent lance une exécution pour chaque tâche, ce qui peut consommer du quota de modèle. Faites d'abord un dry run.

La clé doit disposer de **Assign project members** ou **Manage data**.

## Voir aussi <a href="#related" id="related"></a>

[Étapes de workflow et tâches](https://docs.unitlab.ai/api-sdk-cli/fr/sdks/workflow-stages-and-tasks.md) · [CLI : workflow](https://docs.unitlab.ai/api-sdk-cli/fr/clis/cli-workflow-tasks.md)
