⚡ Advanced Make Workflows
Nâng cao kỹ năng automation với Make/Integromat.
Beyond Basic Workflows
Simple vs Advanced
Text
1Simple workflow:2Trigger → Action → Action → Done3 4Advanced workflow:5Trigger → Router → Multiple paths6 → Error handling7 → Iterations8 → Sub-scenarios9 → Data transformation10 → Conditional logicRouters & Filters
Router Module
Text
1Split flow into multiple paths:2 3 ┌→ Path 1: If order4Incoming → Router┼→ Path 2: If question5Message └→ Path 3: Default6 7Each path:8- Has filter condition9- Executes independently10- Can have different actionsFilter Setup
Text
1Filter conditions:2- Contains: text contains "order"3- Equals: status = "pending"4- Greater than: amount > 1005- Matches pattern: regex match6- Is empty: field is blank7- Exists: field has valueMultiple Conditions
Text
1AND: All must be true2- status = "active"3- AND amount > 504- AND type = "subscription"5 6OR: Any can be true7- source = "WhatsApp"8- OR source = "Telegram"9- OR source = "SMS"Iterators & Aggregators
Iterator
Text
1Process arrays one item at a time:2 3Input: [item1, item2, item3]4 ↓5 Iterator6 ↓7 item1 → Process8 item2 → Process9 item3 → Process10 11Use for:12- Process list of orders13- Send multiple messages14- Update multiple recordsAggregator
Text
1Combine multiple items back:2 3 item1 → 4 item2 → Aggregator → Combined result5 item3 →6 7Types:8- Array: Collect into array9- Text: Join with separator10- Numeric: Sum, average, countExample: Process Orders
Text
1Scenario:21. Get orders from API (returns array)32. Iterator: For each order43. Check inventory54. Update status65. Send notification76. Aggregator: Collect results87. Send summary reportError Handling
Error Types
Text
1Common errors:2- Connection failed3- Invalid data4- Rate limit5- Timeout6- Permission denied7- Not foundBreak Directive
Text
1Stop execution on error:21. Add Error Handler32. Select "Break"43. Execution stops54. Error logged65. No further actionsResume Directive
Text
1Continue despite error:21. Add Error Handler32. Select "Resume"43. Log error54. Continue to next module65. Workflow completesCommit Directive
Text
1Save progress on error:21. Add Error Handler32. Select "Commit"43. Data up to error point saved54. Execution stops65. Can resume laterRollback Directive
Text
1Undo changes on error:21. Add Error Handler32. Select "Rollback"43. Undo committed changes54. Clean state65. Retry possibleCustom Error Handling
Text
1Handle specific errors:2 3Router (error path):4If error code = 429 (rate limit)5 → Wait 60 seconds6 → Retry7 8If error code = 404 (not found)9 → Create new record10 → Continue11 12Default:13 → Log error14 → Send alert15 → StopData Transformation
Built-in Functions
Text
1Text:2- lower(text): Lowercase3- upper(text): Uppercase4- trim(text): Remove whitespace5- replace(text, old, new): Replace6- substring(text, start, length): Extract7 8Numbers:9- round(num, decimals)10- floor(num), ceil(num)11- formatNumber(num, format)12 13Dates:14- formatDate(date, format)15- addDays(date, days)16- parseDate(text, format)17 18Arrays:19- length(array)20- first(array), last(array)21- slice(array, start, end)22- map(array, key)JSON Operations
Text
1Parse JSON:2- Use JSON module3- parseJSON(text) function4 5Create JSON:6- Use JSON > Create JSON7- Build object from variables8 9Transform:10- Extract specific fields11- Restructure data12- Filter arraysExample: Transform API Response
Text
1API returns:2{3 "data": {4 "orders": [5 {"id": 1, "total": 100, "status": "pending"},6 {"id": 2, "total": 200, "status": "shipped"}7 ]8 }9}10 11Transform:121. Parse JSON132. Access: data.orders143. Filter: status = "pending"154. Map: Extract only id and total165. Result: [{"id": 1, "total": 100}]Sub-Scenarios
Why Sub-Scenarios?
Text
1Benefits:2- Reusable components3- Cleaner main flow4- Easier testing5- Better organizationCreating Sub-Scenario
Text
11. Create new scenario22. Use webhook as trigger33. Build your logic44. Return result with webhook response5 6Main scenario:71. Call sub-scenario via HTTP82. Wait for response93. Continue with resultExample: AI Processing Sub-Scenario
Text
1Sub-scenario: process_with_ai2Input: {message, context}3 41. Webhook trigger52. OpenAI: Generate response63. Store to database74. Webhook response: {reply, tokens_used}8 9Main scenarios call this sub-scenario10when AI processing neededData Stores
Setup Data Store
Text
1Create persistent storage:21. Go to Data Stores32. Create new43. Define structure:5 - Key (unique identifier)6 - Fields (columns)Operations
Text
1Add/Update Record:2- Add or replace by key3- Upsert pattern4 5Search Records:6- Filter by conditions7- Get multiple results8 9Get Record:10- Retrieve by key11- Fast lookup12 13Delete Record:14- Remove by key15- Clean up dataUse Cases
Text
1- Cache API responses2- Track conversation state3- Store user preferences4- Rate limiting counters5- Temporary data storageAdvanced Patterns
Retry Pattern
Text
1Handle transient failures:2 31. Try action42. If fails:5 a. Increment counter6 b. If counter < 3:7 - Wait (exponential backoff)8 - Retry9 c. Else:10 - Log failure11 - AlertRate Limiting
Text
1Respect API limits:2 3Before API call:41. Get counter from data store52. If counter > limit:6 - Wait until reset73. Else:8 - Increment counter9 - Make callDeduplication
Text
1Prevent duplicate processing:2 31. Generate hash of incoming data42. Check data store for hash53. If exists:6 - Skip (already processed)74. Else:8 - Store hash9 - ProcessScheduling
Schedule Options
Text
1Interval:2- Every X minutes3- Every X hours4 5Time-based:6- Every day at 9am7- Every Monday8- First of month9 10On-demand:11- Webhook trigger12- Manual runScheduled AI Tasks
Text
1Example: Daily summary2 3Schedule: Every day at 6pm41. Get today's conversations52. Send to AI: "Summarize trends"63. Generate report74. Email to teamDebugging
Execution History
Text
1Review past runs:2- Input data3- Output data4- Errors5- Duration6- Module by moduleCommon Issues
Debug Tips
Text
1Data mapping errors:2- Check data structure3- Use get() with fallback4- Validate inputs5 6Rate limits:7- Add delays between calls8- Implement retry logic9- Use batching10 11Timeouts:12- Optimize slow modules13- Break into sub-scenarios14- Increase timeout settings15 16Memory issues:17- Don't load huge arrays18- Process in batches19- Use streaming when possiblePerformance Tips
Optimize Performance
Text
11. Minimize operations2 - Combine where possible3 - Remove unnecessary modules4 52. Use filters early6 - Filter before processing7 - Skip irrelevant data8 93. Batch operations10 - Update many at once11 - Reduce API calls12 134. Cache responses14 - Store in data store15 - Set expiration16 175. Parallel paths18 - Independent actions parallel19 - Use routers effectivelyBài Tập
Practice
Build Advanced Workflow:
- Create multi-path router
- Implement error handling
- Add data transformation
- Create sub-scenario
- Use data store for state
- Add retry logic
- Test all paths
Tiếp theo: Bài 9 - Stack AI
