How to Build Two-Way Webhook Automations With Response Actions (Pro)

A one-way webhook is a shout into the dark: your phone sends a signal to a service, and you hope it arrived. A two-way webhook is a conversation: the service replies, and your phone acts on that reply — confirming a task, fetching a value, or branching to a different action depending on what came back. MacroDroid Pro’s response actions make that conversation possible, letting a macro send an HTTP request, wait for the response, and then use the returned data in later steps. This guide builds a safe, testable two-way automation from first principles, with special attention to the places where webhooks usually go wrong: secrets, timeouts, unexpected replies, and silent failures.

Two-way automation is powerful precisely because it connects your phone to the wider world of services you already use — a home server, a personal dashboard, a note-taking service, or a small script you control. But that power brings responsibility. A macro that sends data outward should send as little as possible, a macro that acts on a reply should validate that reply before trusting it, and a macro that runs automatically should never expose a secret key in a notification, a log, or a shared export. Keep those three rules in mind throughout, and the rest is straightforward engineering.

Prerequisites

You need MacroDroid Pro, because response actions are a Pro feature, plus a webhook endpoint you control or a test service you trust for learning. A simple, safe starting point is a request-echo test endpoint that returns exactly what you sent, which lets you learn response handling without touching a real service. You also need a basic understanding of what your endpoint expects: its address, the method it accepts, and the format of its reply. Write those details down before you build. Never use a production service, a real account, or a live secret key for your first test; learn the pattern with harmless data, then move it to a real endpoint once the pattern works.

Before building, decide what the automation should do with each possible reply: a success reply, an error reply, a slow reply, and no reply at all. Many webhook guides only handle success, which is why so many automations fail confusingly in real life. Your macro should have a plan for all four cases, even if that plan is simply “show a notification saying the request failed, and try again later.” Back up your macros before adding network actions, and keep secret keys out of macro names, scene labels, and screenshots.

Step-by-Step Setup

Step 1: Send a request and capture the response

Create a new macro with a manual trigger for testing, such as a tile tap, so you control exactly when it runs. Add an HTTP Request action pointing at your test endpoint, using the GET method first because it is the simplest to inspect. In the response settings, store the returned body in a string variable and the status code in an integer variable, giving both clear names such as “webhook_reply” and “webhook_status”. Run the macro and inspect those variables: you should see the test endpoint’s reply and a status code in the 200 range. If you see nothing, check the address, the network connection, and whether the endpoint requires a particular method or header, before changing anything else.

Step 2: Branch on the status code

A two-way automation must not assume success. Add a condition after the request that checks the status variable: if it equals 200, continue to the success branch; otherwise, go to an error branch that notifies you and stops. This single check prevents the most common webhook bug, where a macro cheerfully processes an error page as if it were real data. Keep the error branch visible — a notification, not a silent log entry — during testing, so failures cannot hide. Once the macro is proven, you may quieten the error notification, but never remove the branch itself. A macro without an error branch is a macro waiting to mislead you.

Step 3: Extract the value you need from the reply

Most replies contain more data than you need, so the next step is extraction. If the reply is structured data, use MacroDroid’s dictionary or text-parsing tools to pull out the single field you care about, such as a temperature, a task title, or a simple “yes” or “no”. Store that field in its own variable with a descriptive name, and test the extraction with several different replies, including an empty reply and a reply missing that field. Decide what the macro should do when the field is absent: stop safely, use a previous value, or notify you. Never let a missing field silently become zero or an empty message that then triggers further actions.

Step 4: Act on the reply, then respond back

Now build the second half of the conversation. If the reply says a task is complete, the macro might silence a reminder; if it returns a value, the macro might speak it, display it in a scene, or store it for later. In a true two-way pattern, the macro may also send a follow-up request confirming receipt, closing the loop with the service. Keep this acting stage separate from the extraction stage, so a mistake in one does not corrupt the other. Add a short wait between the request and any follow-up request if the service needs time to process, and keep the whole sequence short enough that you can follow it in the macro editor without scrolling for minutes.

Step 5: Protect secrets and limit retries

If your endpoint needs authentication, store the key in a variable or a secure field rather than typing it into a visible label, and never display that variable in a notification or a scene. Limit retries to a small number — two or three attempts with a pause between them — because an endpoint that is failing will not be fixed by hammering it, and repeated requests can lock an account or flood a log. Add a constraint so the macro cannot run more than a few times per hour automatically, protecting you from a trigger loop that fires requests endlessly. Review the macro’s network actions before sharing or exporting it, and strip any secret before the file leaves your phone.

Step 6: Move from test endpoint to real service

Once the pattern works against a test endpoint, point it at your real service one change at a time: first the address, then the method and headers, then the real data fields. Test each change separately, and keep the test macro as a reference copy so you can compare behaviour. Confirm the real service’s reply format matches what your extraction expects, because real services often wrap values differently from test services. Run the real macro manually several times, at different times of day, before allowing any automatic trigger to run it. When it is stable, rename it without the word “test” and document its purpose in its description.

Testing and Verification

Test four scenarios deliberately: a successful reply, an error status, a slow or timed-out request, and a reply missing the expected field. For each, confirm the macro takes the branch you designed and produces a visible, correct result. Test with mobile data and Wi-Fi, with the phone locked, and after a restart. Check that no secret appears in notifications, logs, or scenes during any test. Test the retry limit by pointing the macro temporarily at an unreachable address and counting its attempts. Only when all four scenarios behave correctly is the automation ready for automatic triggers; a macro tested only on success is only half tested.

Troubleshooting

If the request always fails, verify the address character by character, check whether the service needs HTTPS, and confirm the phone has network access at that moment. If the status is 200 but the extracted value is empty, inspect the raw reply variable — the field name or structure is usually different from what you assumed. If the macro works manually but not automatically, check its trigger and constraints, and confirm battery optimisation is not delaying it. If the macro runs repeatedly without stopping, look for a trigger that its own actions re-fire, and add a cooldown constraint. If a shared or exported macro leaks a key, revoke that key immediately at the service; changing the macro alone does not unexpose a key that has already left your phone.

Tips

Log each webhook run briefly — time, status, and result — during the first weeks, then reduce logging once the automation is stable. Prefer GET requests for reading data and POST requests for changing something, following the service’s own documentation. Keep request timeouts short, so a hung service cannot freeze your macro for minutes. Version your webhook macros informally when you change an endpoint, so you can roll back if a service changes its reply format. Finally, remember the principle of least data: send only the fields the service needs, store only the values you will use, and delete test variables when the macro is finished.

Frequently Asked Questions

Do I need MacroDroid Pro for webhook responses?

Yes. Sending a request and acting on its response, including response actions, is a Pro feature. Basic macros without response handling do not need Pro, but two-way automation does.

What is a safe endpoint for learning webhooks?

A request-echo test service that returns what you sent, used with harmless test data only. Learn extraction, branching, and error handling there before pointing a macro at any real service.

Why does my macro process an error page as success?

Because it lacks a status-code check. Always branch on the status variable first, and only process the reply body when the status indicates success.

How do I keep an API key safe in a macro?

Store it in a variable rather than a visible label, never display it in notifications or scenes, and strip it before sharing or exporting the macro. If a key leaks, revoke it at the service.

What should a macro do when a request times out?

Notify you or schedule a limited retry, and stop cleanly. Never retry endlessly, and never treat a timeout as success or as an empty result.

Leave a Comment