Asynchronous Function Calls in BAS
The Async Function Call module in Browser Automation Studio — run functions in parallel with the main script, so a bot can work two sites or wait on a signal without blocking.
Most BAS flows are linear: do this, then that. But sometimes a bot needs to do two things at the same time — and that’s what the Async Function Call module is for.
Normal vs asynchronous calls
A normal function call is strict and sequential: BAS runs the whole chain of actions inside the function and returns a result before the main flow continues. Nothing else happens until it finishes.
An asynchronous function is different. It’s a special function-action that runs independently of the main script, in parallel with it, and can even be paused mid-execution. You start it, the main flow keeps going, and you collect its result later — the call doesn’t block.
The actions
- Call async function — launch a function to run in parallel.
- Wait for async function execution — pause the main flow until the async function finishes, when you do need its result before continuing.
- Get async function result — read what the async function returned.
- Cancel async function — stop it early.
A concrete example
The classic case is working two sites at once. The first site monitors for a code arriving by email, or gathers information another site needs. The second site waits for that email or holds until the required information has been written. Running the first as an async function lets both progress together: one watches the inbox while the other stands ready, and the moment the data lands, the second proceeds — no wasted serial waiting.
When to reach for it
Async functions add complexity, so use them when parallelism genuinely helps: overlapping waits, monitoring something while doing something else, coordinating two browser contexts. For ordinary step-by-step work, a normal function call is simpler and clearer — reach for async only when “at the same time” is actually part of the task.
FAQ
What is an asynchronous function in BAS?
An async function is a function-action that runs independently and in parallel with the main script, and can be paused mid-execution. A normal function call runs the whole chain and returns a result before continuing; an async call does not block.
When do I need async functions in BAS?
When you must do two things at once — for example work two sites simultaneously, where one waits for an email code while the other keeps going. Start the async function, let it run alongside the main flow, and collect its result when ready.
- Browser Automation Studio: The Complete Practical GuideGuide
- Building Your First Bot in Browser Automation StudioA step-by-step walkthrough of creating your first working BAS bot — from a blank project to a flow that navigates, extracts data, and runs in multiple threads.
- Setting Up Proxies in Browser Automation StudioHow to configure proxies in BAS the right way — proxy types, per-thread assignment, rotation, and the checks that keep multi-account bots from getting flagged.
- Finding Elements in BAS: Selectors That Don't BreakHow element search works in Browser Automation Studio — CSS vs XPath selectors, why recorded ones break, and how to write selectors that survive page changes.