What are Programmatic Actions?
Programmatic actions let you build browser automation workflows using code instead of the visual workflow builder. You write Python (or other languages) to orchestrate individual browser actions, giving you complete control over the execution flow.How It Works
The basic pattern involves:- Create a session to maintain browser state across actions
- Execute actions sequentially using the same session ID
- Pass data between actions using variables
- Add conditional logic based on action results
- Terminate the session when complete
Key Advantages
Full Control
Complete programmatic control over execution flow and logic
Dynamic Logic
Make decisions at runtime based on previous action results
Easy Integration
Seamlessly integrate into existing codebases and applications
No Pre-Definition
Build workflows on-the-fly without pre-configuring in the dashboard
When to Use Programmatic Actions
Dynamic Decision-Making
Dynamic Decision-Making
Perfect when you need to make decisions at runtime based on the results of previous actions or external data.Example: Check if a user is logged in, and only perform login if needed.
Conditional Logic
Conditional Logic
Use when your workflow requires branching, loops, or complex conditional logic that can’t be predefined.Example: Process a variable number of items based on what’s found on the page.
Tight Integration
Tight Integration
Ideal when the workflow is deeply integrated with your application logic and needs to interact with other systems.Example: Fetch data from your database, use it in browser actions, then save results back to your database.
Code-Level Control
Code-Level Control
Best when you want full programmatic control and prefer Git-based version control over dashboard-based management.Example: Version control your automation alongside your application code.
Custom Error Handling
Custom Error Handling
Use when you need sophisticated error handling, retries, or fallback strategies tailored to your use case.Example: Implement exponential backoff retries with custom retry logic.
Limitations
While powerful, programmatic actions have some tradeoffs:- Requires writing and maintaining code
- No visual representation of the workflow
- Debugging requires custom logging
- Changes require code deployment
Detailed Guides
Getting Started
Learn the fundamentals: sessions, actions, variables, and basic workflows
Session Management
Advanced session config, parallel workflows, and session pooling
API Reference
Complete API documentation for programmatic actions
Comparison with Other Approaches
| Feature | Programmatic Actions | Visual Workflow Builder |
|---|---|---|
| Control | Full programmatic control | Visual configuration |
| Conditional Logic | Runtime decisions with code | Pre-configured conditions |
| Integration | Easy integration with apps | Standalone workflows |
| Version Control | Git-based | Dashboard-based |
| Debugging | Custom logging needed | Built-in execution logs |
| Best For | Dynamic, integrated workflows | Stable, repeatable tasks |
API Reference
Run Single Action
Execute a single browser action within a session
Create Session
Create a browser session with custom configuration
Terminate Session
Clean up and terminate a browser session
List Sessions
View all active sessions for your account