Overview
When you need to scrape multiple pages, fill multiple forms, or process a batch of URLs, firing requests concurrently can significantly speed up your workflow. This guide shows how to run multiple TinyFish Web Agent runs in parallel using the sync API.Basic Example
Fire multiple requests concurrently and gather results:The sync
/run API is perfect for concurrent requests - you get clean, simple code without SSE stream handling,
making it ideal for batch operations with asyncio.gather() or Promise.all().Batch Multiple Forms
Fill multiple contact forms concurrently:Python
Gotchas and Caveats
Queueing Behavior
When you hit your account’s concurrency cap:- No 429 errors: Unlike traditional rate-limited APIs, TinyFish won’t reject your request with a 429 status code
- Automatic queueing: Your request will be accepted and queued until a browser session becomes available
- Longer run times: The total run time will include both queue wait time and execution time
- Requests 1-3 start immediately
- Requests 4-10 are queued
- As each request completes, the next queued request begins
- You won’t get errors, but later requests will take longer to complete
We’re actively working on improving the queueing experience with better visibility into queue position and estimated
wait times. This behavior will be enhanced in an upcoming release.
Best Practices
- Know your limits: Check your plan’s concurrency limit in your dashboard
- Batch sizing: Size your concurrent batches to match your concurrency limit for optimal performance
- Progress tracking: Implement timing/logging to monitor which requests are queued vs executing
- Error handling: Always handle potential timeouts for long-running or queued requests
Related
Web Scraping
Extract data from pages
Form Filling
Automate form submissions
Run API Reference
Complete API documentation