8.4 Execution Priority
When hundreds of cells are waiting to run, which one goes first? That's where execution priority comes in. This section explains how Taibles prioritizes tasks and how you can control execution order when needed.
Understanding Execution Priority
What Is Priority?
Priority determines the order in which cells execute when multiple cells are queued.
Simple analogy: Priority is like an "express lane" at the grocery store:
- High priority = express lane (go first)
- Normal priority = regular lane (wait your turn)
- Low priority = back of the line
In Taibles:
Queue with 100 cells waiting:
High Priority (1000): Cell A → Executes first
High Priority (1000): Cell B → Executes second
Normal Priority (100): Cell C → Executes third
Normal Priority (100): Cell D → Executes fourth
...
Low Priority (1): Cell Z → Executes lastHigher number = higher priority = executes sooner
Why Priority Matters
Without priority system:
Queue (first-in-first-out):
1. Background job (can wait)
2. Background job (can wait)
3. User's urgent request (needs now!)
4. Background job (can wait)
...User waits while background jobs process first 😞
With priority system:
Queue (priority-ordered):
1. User's urgent request (priority 1000) ← Executes immediately
2. Dependency chain (priority 100)
3. Background job (priority 0)
4. Background job (priority 0)
...User gets instant response ✓
Priority Levels in Taibles
The Priority Hierarchy
Taibles uses four priority levels:
| Priority Level | Value | Use Case | Who Sets It |
|---|---|---|---|
| User-Triggered | 1000 | Manual recalculation | You (via UI) |
| Dependency Chain | 100 | Cascading updates | System (automatic) |
| Low Priority | 1 | Secondary dependencies | System (automatic) |
| Background | 0 | Automated processing | System (automatic) |
Higher value = higher priority
Priority 1000: User-Triggered (Highest)
When assigned:
- You manually click "Recalculate cells"
- You manually trigger a single cell
- You manually run a column
Why highest?:
- You're waiting for results
- Interactive response expected
- User experience matters most
Example:
User interactions always go first ✓
Priority 100: Dependency Chain (High)
When assigned:
- Cell A completes
- Cell B depends on Cell A
- Cell B automatically queued with priority 100
Why high priority?:
- Maintains automation flow
- Prevents stalled workflows
- Keeps dependent processing moving
Example:
Dependency chains flow quickly ✓
Priority 1: Low Priority
When assigned:
- Secondary dependencies
- Cross-row dependencies (less critical)
Why lower priority?:
- Not blocking main workflow
- Can wait for primary tasks
- Less time-sensitive
Example:
Priority 0: Background Processing (Lowest)
When assigned:
- CRON-triggered executions
- Bulk operations (e.g., "Calculate all rows")
- Background maintenance tasks
Why lowest priority?:
- No user waiting
- Not time-critical
- Should not block interactive requests
Example:
Background jobs stay in background ✓
How Priority Works
The Priority Queue
Taibles maintains a priority queue:
Execution order:
- All priority 1000 tasks first (FIFO within same priority)
- Then all priority 100 tasks
- Then all priority 1 tasks
- Then all priority 0 tasks
FIFO Within Same Priority
When multiple cells have same priority:
Order: First-In-First-Out (FIFO) by creation time
Example:
Fair ordering within same priority level ✓
Dynamic Priority
Priority is set when task is queued, not when it executes.
Example scenario:
Recalculation updates priority ✓
Using Priority Effectively
Method 1: Manual Recalculation (Priority 1000)
To give cells highest priority:
Result: Selected cells process immediately (or very soon)
Method 2: Single Cell Recalculation
For one cell:
Result: Cell queued with priority 1000
Method 3: Column-Wide Recalculation
To prioritize entire column (all rows):
Use when: Entire column needs urgent recalculation
When to Use Priority Boost
Use Case 1: Urgent Customer Request
Scenario: Customer calls, needs order status immediately
Value: Immediate customer service ✓
Use Case 2: Testing New Automation
Scenario: Testing new enrichment column
Value: Fast iteration cycle ✓
Use Case 3: VIP Processing
Scenario: VIP customer orders need priority processing
Value: Differentiated service ✓
Use Case 4: Fixing Errors
Scenario: 10 cells failed, need immediate retry
Value: Fast error recovery ✓
When NOT to Boost Priority
Don't Boost: Large Background Jobs
Don't Boost: Routine Operations
Don't Boost: Already Processing
Priority and Rate Limiting
How They Interact
Priority affects queue order, rate limiting affects execution pace.
Key insight: High-priority cells consume rate limit budget first
Priority Doesn't Skip Rate Limits
Important: Priority changes order, not rate
Priority doesn't bypass rate limit ✓
Both systems work together:
- Priority: Determines which 10 cells execute first
- Rate limit: Determines when they execute
Monitoring Priority
Visual Indicators
Currently: No special visual indicator for priority in UI
Cells look the same whether priority 1000 or priority 0:
Execution order shows priority:
- High-priority cells execute sooner
- Low-priority cells wait longer
How to Infer Priority
Clues about priority:
Testing Priority
To verify priority is working:
If manual cell waits: Priority may not be working (check rate limits first)
If manual cell executes immediately: Priority working correctly ✓
Best Practices for Priority
Best Practice 1: Reserve Priority 1000 for Users
Why: Keep express lane clear for interactive use
Best Practice 2: Trust Automatic Priorities
System assigns priorities intelligently:
- User actions: 1000 (you set these)
- Dependencies: 100 (system sets)
- Background: 0 (system sets)
Usually: No manual intervention needed
Only boost when you have a specific reason
Best Practice 3: Use Selectively
Priority boost is a tool, not a default:
Why: Priority only matters when there's competition for resources
Best Practice 4: Combine with Rate Limits
For urgent processing:
Best of both worlds:
- Priority: Urgency
- Rate limit: Safety
Best Practice 5: Document VIP Workflows
If you have VIP processing:
Train team on priority boosting for VIP cases
Priority System Summary
How Priority Works
✅ Four priority levels:
- 1000: User-triggered (highest)
- 100: Dependency chains
- 1: Low priority
- 0: Background (lowest)
✅ Execution order:
- Higher priority executes first
- Same priority = FIFO (first-in-first-out)
✅ Dynamic: Priority set when task queued, can change via recalculation
How to Boost Priority
✅ Method: Manual recalculation
- Select cells
- Right-click
- Click "Recalculate cells"
- Cells re-queued with priority 1000
✅ Effect: Cells jump to front of queue
When to Use
✅ Use priority boost for:
- Urgent customer requests
- Testing and debugging
- VIP processing
- Error recovery
❌ Don't boost for:
- Large background jobs
- Routine operations
- Already running cells
Priority + Rate Limiting
✅ Both work together:
- Priority: Determines order in queue
- Rate limit: Determines execution pace
✅ Priority doesn't bypass rate limits:
- High-priority cells still respect rate limits
- Just execute before lower-priority cells
Best Practices
✅ Reserve priority 1000 for users: Interactive responsiveness
✅ Trust automatic priorities: System assigns intelligently
✅ Use selectively: Only when needed
✅ Combine with rate limits: Safety + urgency
✅ Document VIP workflows: Consistent priority handling
Troubleshooting Priority Issues
Issue 1: Manual Recalculation Doesn't Jump Queue
Symptom: You recalculate cells, but they wait in queue
Possible causes:
Issue 2: Background Jobs Blocking User Actions
Symptom: You trigger cell, but it waits behind background job
Issue 3: All Cells Process at Same Speed
Symptom: Priority doesn't seem to affect anything
Possible causes:
Summary
You now understand execution priority:
✅ Priority levels: 1000 (user) > 100 (dependency) > 1 (low) > 0 (background)
✅ Purpose: Ensure interactive responsiveness
✅ How to boost: Right-click → "Recalculate cells" (priority 1000)
✅ When to use: Urgent requests, testing, VIP processing, error recovery
✅ When NOT to use: Bulk operations, routine processing
✅ Interaction with rate limits: Priority determines order, rate limits determine pace
✅ Best practices: Reserve priority 1000 for users, trust automatic priorities, use selectively
Next Steps
You've completed Chapter 8: Run Modes and Execution Control! You now understand:
✅ Run modes (Once, Always, Manual, Scheduled) ✅ Rate limiting (configuration, monitoring, and priority) ✅ Execution priority (boosting urgent tasks)
Next up in your Taibles journey:
- Advanced automation patterns
- Custom integrations
- Team collaboration features
- Production optimization strategies
Continue exploring to unlock the full power of Taibles! 🚀