Files
rpa_vision_v3/.kiro/specs/workflow-composition/requirements.md
Dom a7de6a488b feat: replay E2E fonctionnel — 25/25 actions, 0 retries, SomEngine via serveur
Validé sur PC Windows (DESKTOP-58D5CAC, 2560x1600) :
- 8 clics résolus visuellement (1 anchor_template, 1 som_text_match, 6 som_vlm)
- Score moyen 0.75, temps moyen 1.6s
- Texte tapé correctement (bonjour, test word, date, email)
- 0 retries, 2 actions non vérifiées (OK)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 14:04:41 +02:00

8.9 KiB

Requirements Document

Introduction

Ce document définit les exigences pour la composition et le contrôle de flux des workflows dans RPA Vision V3. Il couvre le chaînage, les sous-workflows, la fusion, ainsi que les structures de contrôle fondamentales (boucles, conditions, déclencheurs) essentielles à tout système RPA.

Glossaire

  • Workflow : Graphe de transitions entre états d'écran représentant un processus automatisé
  • Chaînage : Exécution séquentielle de plusieurs workflows où la fin de l'un déclenche le début du suivant
  • Sous-workflow : Workflow réutilisable pouvant être appelé depuis d'autres workflows
  • Fusion : Combinaison de deux workflows partageant des nodes similaires en un seul workflow optimisé
  • Node de référence : Node spécial qui appelle un sous-workflow
  • Boucle : Répétition d'une séquence de nodes N fois ou jusqu'à une condition
  • Branchement conditionnel : Choix du chemin d'exécution basé sur l'état de l'écran
  • Déclencheur : Événement qui lance automatiquement un workflow (horaire, fichier, écran)
  • Variable globale : Donnée partagée entre workflows d'une même exécution
  • Condition visuelle : Évaluation basée sur la détection d'un élément à l'écran
  • Compteur de boucle : Variable incrémentée à chaque itération d'une boucle
  • Garde de sécurité : Limite maximale d'itérations pour éviter les boucles infinies

Requirements

Requirement 1

User Story: En tant qu'utilisateur, je veux chaîner plusieurs workflows ensemble, afin de construire des processus complexes à partir de blocs simples.

Acceptance Criteria

  1. WHEN a workflow reaches an end node with a chain configuration THEN the system SHALL automatically start the specified next workflow
  2. WHEN chaining workflows THEN the system SHALL pass context variables from the ending workflow to the starting workflow
  3. WHEN a chained workflow fails THEN the system SHALL provide options to retry, skip, or abort the entire chain
  4. WHEN defining a chain THEN the system SHALL validate that the end state of workflow A is compatible with the entry state of workflow B
  5. WHEN executing a chain THEN the system SHALL maintain a unified execution log across all chained workflows
  6. WHEN serializing a workflow chain THEN the system SHALL preserve chain configuration and deserialize it correctly

Requirement 2

User Story: En tant qu'utilisateur, je veux créer des sous-workflows réutilisables, afin d'éviter de dupliquer des séquences communes comme la connexion ou la navigation.

Acceptance Criteria

  1. WHEN a workflow contains a reference node THEN the system SHALL execute the referenced sub-workflow at that point
  2. WHEN a sub-workflow completes THEN the system SHALL return control to the calling workflow at the next node
  3. WHEN a sub-workflow is modified THEN the system SHALL automatically update all workflows that reference it
  4. WHEN creating a sub-workflow THEN the system SHALL allow defining input parameters and output values
  5. WHEN a sub-workflow fails THEN the system SHALL propagate the error to the parent workflow with full context
  6. WHEN serializing a workflow with sub-workflow references THEN the system SHALL preserve reference configurations and deserialize them correctly

Requirement 3

User Story: En tant qu'utilisateur, je veux que le système détecte et fusionne les workflows similaires, afin de réduire la redondance et améliorer la maintenabilité.

Acceptance Criteria

  1. WHEN two workflows share nodes with similarity above 0.9 THEN the system SHALL suggest merging them
  2. WHEN merging workflows THEN the system SHALL preserve all unique paths from both workflows
  3. WHEN merging workflows THEN the system SHALL combine statistics and learning data from both sources
  4. WHEN a merge is proposed THEN the system SHALL show a visual diff of the changes before applying
  5. WHEN merged workflows have conflicting actions on the same node THEN the system SHALL prompt the user to resolve the conflict

Requirement 4

User Story: En tant qu'utilisateur, je veux extraire automatiquement les séquences communes en sous-workflows, afin de garder mes workflows DRY (Don't Repeat Yourself).

Acceptance Criteria

  1. WHEN the system detects identical sequences in multiple workflows THEN the system SHALL suggest extracting them as a sub-workflow
  2. WHEN extracting a sub-workflow THEN the system SHALL replace the original sequences with reference nodes
  3. WHEN a sequence appears in 3 or more workflows THEN the system SHALL flag it as a high-priority extraction candidate
  4. WHEN extracting THEN the system SHALL preserve the original workflows as backups until the user confirms

Requirement 5

User Story: En tant qu'utilisateur, je veux gérer les dépendances entre workflows, afin de comprendre et maintenir les relations entre mes workflows.

Acceptance Criteria

  1. WHEN viewing a workflow THEN the system SHALL display its dependencies (sub-workflows it calls) and dependents (workflows that call it)
  2. WHEN deleting a sub-workflow THEN the system SHALL warn about all workflows that depend on it
  3. WHEN a circular dependency is detected THEN the system SHALL prevent the configuration and display an error
  4. WHEN listing workflows THEN the system SHALL show dependency count and usage statistics

Requirement 6

User Story: En tant qu'utilisateur, je veux créer des boucles dans mes workflows, afin de répéter des actions jusqu'à atteindre un objectif.

Acceptance Criteria

  1. WHEN defining a loop node THEN the system SHALL allow specifying a fixed iteration count or a visual condition for termination
  2. WHEN a loop iteration completes THEN the system SHALL increment the loop counter and evaluate the exit condition
  3. WHEN a loop reaches its maximum iteration limit THEN the system SHALL exit the loop and continue to the next node
  4. WHEN a loop condition is based on visual detection THEN the system SHALL capture and analyze the screen at each iteration
  5. WHEN a loop exceeds the safety guard limit of 1000 iterations THEN the system SHALL terminate the loop and log a warning
  6. WHEN serializing a workflow with loops THEN the system SHALL preserve loop configuration and deserialize it correctly

Requirement 7

User Story: En tant qu'utilisateur, je veux créer des branchements conditionnels, afin d'adapter le comportement du workflow selon l'état de l'écran.

Acceptance Criteria

  1. WHEN defining a conditional node THEN the system SHALL allow specifying multiple branches with visual conditions
  2. WHEN evaluating a conditional node THEN the system SHALL test each branch condition in order and execute the first matching branch
  3. WHEN no branch condition matches THEN the system SHALL execute the default branch or raise an error if none is defined
  4. WHEN a condition is based on element presence THEN the system SHALL use the visual matching engine to detect the element
  5. WHEN a condition is based on element text THEN the system SHALL use OCR to extract and compare the text value
  6. WHEN serializing a workflow with conditions THEN the system SHALL preserve all branch configurations and deserialize them correctly

Requirement 8

User Story: En tant qu'utilisateur, je veux configurer des déclencheurs automatiques, afin que mes workflows s'exécutent sans intervention manuelle.

Acceptance Criteria

  1. WHEN defining a schedule trigger THEN the system SHALL allow specifying cron expressions or time intervals
  2. WHEN defining a file trigger THEN the system SHALL monitor a directory and start the workflow when a matching file appears
  3. WHEN defining a visual trigger THEN the system SHALL periodically capture the screen and start the workflow when a target element is detected
  4. WHEN a trigger fires THEN the system SHALL pass trigger context (timestamp, file path, or detected element) to the workflow
  5. WHEN multiple triggers are configured for the same workflow THEN the system SHALL handle concurrent executions or queue them based on configuration
  6. WHEN serializing trigger configurations THEN the system SHALL preserve all settings and deserialize them correctly

Requirement 9

User Story: En tant qu'utilisateur, je veux gérer des variables globales entre workflows, afin de partager des données dans une chaîne d'exécution.

Acceptance Criteria

  1. WHEN a workflow sets a global variable THEN the system SHALL make it available to all subsequent workflows in the chain
  2. WHEN a workflow reads a global variable THEN the system SHALL return the current value or a default if not set
  3. WHEN a workflow chain completes THEN the system SHALL preserve the final variable state in the execution log
  4. WHEN serializing execution context THEN the system SHALL include all global variables and deserialize them correctly
  5. WHEN a variable name conflict occurs between workflows THEN the system SHALL use the most recent value and log the override