🎯 Situation
L'équipe des opérations d'un client voulait automatiser deux tâches. Tâche 1 : quand une note de frais est soumise via Microsoft Forms, notifier l'approbateur sur Teams et l'enregistrer dans SharePoint. Tâche 2 : chaque nuit, extraire des données de transaction depuis une API externe, les nettoyer, les joindre aux données clients du CRM, et charger le résultat dans Azure SQL pour Power BI.
⚠️ Challenge
⚡ Use Power Automate when
- The trigger is an event in Microsoft 365: form submission, email received, file created, Teams message
- The logic is routing: notify this person, copy this data to that list, send this email
- The tools involved have native connectors: SharePoint, Teams, Outlook, Dynamics, Planner
- Non-technical users need to understand or maintain the flow
- Speed matters more than flexibility — Power Automate flows are built in hours, not days
🐍 Use Python when
- The task requires data transformation: cleaning, merging, reshaping, statistical calculations
- The data source is an API, database, or file format without a native Power Automate connector
- The logic is complex: conditional branching more than 2 levels deep, loops over thousands of records, error recovery
- The output goes to a database or requires a specific file format
- You need testability: unit tests, logging, reproducibility across environments
🔍 Analyse
The decision matrix:
Trigger type: - Event in Microsoft 365 → Power Automate - Time-based schedule with data processing → Python
Data volume: - Under ~5,000 records per run → Power Automate can handle it - Over 5,000 records or complex transformations → Python
Logic complexity: - Simple routing and notifications → Power Automate - Multi-step transformations, joins, cleaning → Python
Maintenance: - Non-technical team members need to update it → Power Automate (visual editor) - Developers own it → Python (version-controlled, testable)
The hybrid pattern: Power Automate triggers the Python script. A form is submitted, Power Automate picks it up, calls an Azure Function (Python), which runs the heavy processing, writes to a database, and Power Automate sends the confirmation notification. Both tools doing what they do best.
✓️ Bonne pratique
Three questions to decide:
1. Does the trigger come from a Microsoft 365 event? → Lean toward Power Automate 2. Does the task require transforming more than a few hundred records, or using a Python library? → Lean toward Python 3. Does a non-developer need to understand, modify, or maintain this? → Power Automate wins by a wide margin
The most common mistake: using Power Automate's Apply to each loop to process thousands of rows, when a pandas script would do it in seconds. Power Automate loops are visual and accessible — but they're not built for bulk data processing. Know the boundary.
💡 Synthèse
Power Automate and Python are complementary, not competing. The best data automation stacks use both — Power Automate for event-driven workflows and Microsoft 365 integrations, Python for data transformation and API pipelines. The question isn't which is better. It's which is right for the specific task.
👉 Power Automate routes. Python transforms.
Use each for what it was built for — and combine them when the task needs both.