Note: this code runs successfully in Python version 3.13.5
API documentation: https://www.browseract.com/reception/integrations/api-workflow
Site: https://www.browseract.com
- Python 3.8 or higher
- pip (comes with Python)
- Install Python from python.org
- Verify installation:
python --version pip --version
-
Navigate to the Workflow-Python directory:
cd Workflow-Python -
Install dependencies:
pip install -r requirements.txt
If you're new to BrowserAct API, we recommend starting with scenario-based examples that demonstrate how to combine multiple APIs to accomplish real-world use cases:
📖 View Scenario Guide: Scenarios-Python/README.md
Quick Start with Scenario Examples:
# Scenario 1: Run custom workflow task and wait for completion
python ../Scenarios-Python/scenario_1_run_and_wait.py
# Scenario 2: Run template task and wait for completion (Recommended for beginners)
python ../Scenarios-Python/scenario_2_run_template_and_wait.pyIf you want to understand how each specific API works, you can run the following examples:
# Run specific example
python 1.run_task.py
python 2.stop_task.py
python 3.get_task.py
python 4.get_task_status.py
python 5.list_tasks.py
python 6.list_workflows.py
python 7.get_workflow.py
python 8.resume_task.py
python 9.run_task_by_template.py
python 11.list_official_workflow_templates.py
python 12.get_region_list.pyOption 1: Using Custom Workflows
- Get your workflow ID: Run
6.list_workflows.pyor visit https://www.browseract.com/reception/workflow-list - Get workflow details: Run
7.get_workflow.pyto see required input parameters - Run the task: Run
1.run_task.pywith your workflow ID and parameters - Check status: Run
3.get_task.pyor4.get_task_status.pyto monitor progress
Option 2: Using Official Templates (Easier for beginners)
- List available templates: Run
11.list_official_workflow_templates.pyto see all templates - Run template task: Run
9.run_task_by_template.pywith a template ID from step 1 - Check status: Run
3.get_task.pyor4.get_task_status.pyto monitor progress
Recommended: Start with Scenario Examples in ../Scenarios-Python/ directory for complete examples that combine multiple APIs.
Workflow-Python/
├── README.md # This file
├── requirements.txt # Python dependencies
├── 1.run_task.py # Start a new workflow task
├── 2.stop_task.py # Permanently terminate a task
├── 3.get_task.py # Get detailed task information
├── 4.get_task_status.py # Get task status only
├── 5.list_tasks.py # List all workflow tasks
├── 6.list_workflows.py # List all workflows
├── 7.get_workflow.py # Get workflow details
├── 8.resume_task.py # Resume a paused task
├── 9.run_task_by_template.py # Start a new workflow task using template
├── 11.list_official_workflow_templates.py # List official workflow templates
└── 12.get_region_list.py # Get supported region list
| File | Description | API Endpoint |
|---|---|---|
1.run_task.py |
Start a new workflow task (custom workflow) | POST /v2/workflow/run-task |
9.run_task_by_template.py |
Start a new workflow task using official template | POST /v2/workflow/run-task-by-template |
2.stop_task.py |
Permanently terminate a task | PUT /v2/workflow/stop-task |
8.resume_task.py |
Resume a paused task | PUT /v2/workflow/resume-task |
3.get_task.py |
Get detailed task information | GET /v2/workflow/get-task |
4.get_task_status.py |
Get task status only | GET /v2/workflow/get-task-status |
5.list_tasks.py |
List all workflow tasks | GET /v2/workflow/list-tasks |
| File | Description | API Endpoint |
|---|---|---|
6.list_workflows.py |
List all custom workflows | GET /v2/workflow/list-workflows |
7.get_workflow.py |
Get workflow details | GET /v2/workflow/get-workflow |
11.list_official_workflow_templates.py |
List official workflow templates | GET /v2/workflow/list-official-workflow-templates |
| File | Description | API Endpoint |
|---|---|---|
12.get_region_list.py |
Get supported region list for proxy | GET /v2/workflow/get-region-list |
Before running the examples, you need to:
- Get your API key from: https://www.browseract.com/reception/integrations
- Get your workflow ID or workflow template ID:
- For custom workflows: Get workflow ID from https://www.browseract.com/reception/workflow-list
- For official templates: Use
11.list_official_workflow_templates.pyto get template IDs
- Update the following variables in each example file:
authorization: Replace"app-abcdefghijklmn"with your actual API keyworkflow_id: Replace1234567890with your actual workflow ID (for custom workflows)workflow_template_id: Replace"1234567890"with your actual template ID (for template-based tasks)task_id: Replace the actual task ID returned by1.run_task.pyor9.run_task_by_template.py
Important: The examples use placeholder API keys for demonstration purposes. In production:
- Never hardcode API keys in your source code
- Use environment variables or secure configuration files
- Keep your API keys confidential and rotate them regularly
Example of using environment variables:
import os
authorization = os.getenv("BROWSERACT_API_KEY")BrowserAct provides official workflow templates that you can use without creating your own workflows:
-
List available templates:
python 11.list_official_workflow_templates.py
This will show you all available official templates with their IDs, names, and descriptions.
-
Run a task using a template:
python 9.run_task_by_template.py
Make sure to:
- Set
workflow_template_idto a template ID from step 1 - Configure
input_parametersaccording to the template's requirements
- Set
Note: Template-based tasks don't support save_browser_data and profile_id parameters. These features are only available for custom workflows.
All examples include comprehensive error handling for:
- Network connectivity issues
- API authentication errors
- Invalid parameters
- Server errors
- Requests: HTTP library for making API requests
- JSON: Built-in JSON parsing for API responses
- Python Version Error: Ensure Python 3.8+ is installed
- Module Not Found: Verify you're in the correct directory and dependencies are installed
- API Error 401: Check your API key and ensure it's valid
- API Error 10118: Verify the workflow ID exists and is accessible with your API key
- Template Not Found: Ensure the
workflow_template_idis valid. Use11.list_official_workflow_templates.pyto get available template IDs
- API Documentation: https://www.browseract.com/reception/integrations/api-workflow
- Support: Contact us via discord or email: support@browseract.com
- GitHub Issues: Report bugs or request features
This demo code is provided as-is for educational and development purposes.