Skip to content

Actions


An action is something your device can do when a macro runs.
For a macro to be valid, it must have at least one action.
Actions are the “doers” of MacroDroid:
they perform tasks like sending a message, adjusting volume, making an HTTP request, or running a script, among many others.


When to Use Them

Actions are used to automate tasks in response to triggers or conditions.

They are essential for any macro, as they define what happens once it is activated.
For example, if a trigger detects that you arrive home, an action could turn on the lights or play music.


Types of Actions

MacroDroid offers a wide variety of categorized actions to make them easier to use:

  • Device & System:
    Adjust brightness, volume, Wi-Fi, Bluetooth, etc.

  • Applications:
    Launch apps, simulate touches, copy text.

  • Network & Communication:
    Send SMS, emails, HTTP requests.

  • Variables & Logic:
    Set variables, loops, conditionals.

  • Advanced:
    Shell scripts, plugins, interactions with other devices.


What About Actions That Take Time?

Most actions run instantly, but some take time, such as HTTP requests, long scripts, or actions that depend on accessibility.

MacroDroid handles this in two ways:

  • Synchronous actions:
    Finish before the next action continues.

  • Asynchronous actions:
    Start, but the macro keeps running in parallel.

If you need MacroDroid to wait until the action finishes, enable:

“Block next action until complete”

This is key when you need to use data returned by a slow action.


What If the Action Is Asynchronous and I Need Its Result?

MacroDroid does not have callbacks or a built-in “when finished, do this” system like programming languages do.
The practical way to handle this is by using one of these methods:

  • Store the result in a variable
  • Use a Wait or a loop until that variable changes
  • Trigger another macro when the result is ready
    (via global variable, event, etc.)

Case: You make an HTTP request to get a price.

  • If you need to use that value immediately, enable Block next action until complete in the HTTP action.

  • If you don’t want to block:

    • Store the response in a variable
    • Add a Wait
    • Check that variable later
    • Or trigger another macro when it changes

What happens if you don’t block and validate data?

If an asynchronous action hasn’t finished when you try to use its data
(for example, in a condition or validation),
the data won’t be available.

The macro may fail, skip steps, or use incorrect values (like empty, previous, or default ones).

To avoid this, always include safeguards:
check whether the variable has changed before proceeding, or use a loop to wait.


Important Limitations

  • Some actions require special permissions (e.g., root for advanced shell scripts).
  • Asynchronous actions without blocking can complicate flows if not handled properly.
  • Not all actions return data directly; use variables to capture results.
  • On restricted devices (e.g., Android 10+), some actions like accessibility require additional setup.

Unofficial project. Not affiliated with MacroDroid.