What This Example Does
1
Uses platform-configured tasks
Tasks are defined once on the platform, reused in code
2
Switches between profiles
Uses different LLM configurations for different task types
3
Demonstrates observability
All task runs are visible on the platform dashboard
4
Shows error handling
Proper exception handling for platform errors
Key Concepts
Platform Configuration
Tasks and profiles managed on web UI
Unified API Keys
Single API key for all LLM providers
Cloud Observability
View task runs, traces, and analytics online
Type Safety
Structured output with Pydantic models
App Lock
Restrict task execution to specific apps
Cloud Execution
Run tasks from UI on cloud devices
Prerequisites
Before running this example, complete the Platform Quickstart:1
Create Account
Sign up at platform.mobile-use.ai
2
Generate API Key
Create an API key from the API Keys page
3
Create LLM Profiles
Create βdefaultβ and βaccurateβ profiles
4
Create Tasks
Create the following tasks:
email-summary- Check and summarize emailsschedule-meeting- Book a calendar meeting
Complete Code
platform_task_example.py
Code Breakdown
1. Define Output Structures
2. Verify API Key
3. Use Different Profiles
4. Handle Platform Errors
Running the Example
1
Set up environment
2
Install SDK
3
Connect device
4
Run the script
5
View on platform
Visit platform.mobile-use.ai/task-runs to see execution details
Expected Output
Viewing on Platform
After running, visit the platform to see detailed execution:- Task Runs List
- Run Details
- Analytics
- All your task runs with status
- Filter by task, status, date
- Quick status overview
Platform Task Configuration
For this example to work, create these tasks on the platform:Email Summary Task
Schedule Meeting Task
Running with Locked App Package
You can lock task execution to a specific app, ensuring the agent stays within that app:On the Platform
When creating a task, specify the Locked App Package field:Via SDK
Execute the platform task with its configured app lock:Cloud Execution (No Code Required)
Instead of running tasks via SDK, you can execute directly from the platform UI:How It Works
1
Open Tasks Page
Navigate to platform.mobile-use.ai/tasks
2
Click Run
Click the Run button on any task card
3
Select Cloud Execution
Choose the Cloud Execution tab in the dialog
4
Configure
- Select an LLM Profile
- Select a Cloud Device (must be in Ready state)
5
Execute
Click Run Task - youβll be redirected to the task run page
Local SDK vs Cloud Execution
Customization Ideas
Add more tasks
Add more tasks
Create additional platform tasks:
check-notifications- Check notification panelsend-message- Send WhatsApp/SMS messagesearch-product- Find products on shopping apps
Create specialized profiles
Create specialized profiles
Different profiles for different needs:
fast- Quick tasks with cheaper modelsaccurate- Complex tasks with powerful modelscost-optimized- Balance of speed and cost
Local + Platform hybrid
Local + Platform hybrid
Scheduled execution
Scheduled execution
Benefits Demonstrated
Centralized Config
Change task prompts without code changes
Unified API Keys
One key for all LLM providers
Cloud Observability
View all runs in one dashboard
Profile Switching
Easy to switch between model configurations
Type Safety
Pydantic models ensure data integrity
Team Collaboration
Share tasks and profiles with team
Troubleshooting
Task not found error
Task not found error
- Verify task name matches exactly (case-sensitive)
- Check task exists at https://platform.mobile-use.ai/tasks
- Ensure youβre using the correct API key
Profile not found error
Profile not found error
- Check profile name spelling
- Verify profile exists at https://platform.mobile-use.ai/llm-profiles
- Try using βdefaultβ profile
Authentication error
Authentication error
Next Steps
Platform Quickstart
Complete platform setup guide
Types Reference
PlatformTaskRequest type documentation
Local Examples
Compare with local approach
Dashboard
Open Minitap Platform

