Receive SMS in n8n and Auto-Reply From Your Own Number
Text HELP to your number. An n8n workflow picks up the incoming SMS, checks the keyword, and sends an acknowledgement from the same phone. That's what we'll build here: a two-way SMS workflow using an Android phone, its existing SIM card, and three n8n nodes. You can use the same pattern for support requests, appointment confirmations, or replies to notifications. Disclosure: I built SimGate, the…
Receiving SMS messages and automatically replying from your own number is easily achievable using n8n. A workflow can be set up to detect the keyword "HELP" in incoming messages and reply with an acknowledgement from the same phone number. This two-way SMS communication can be utilized for support requests, appointment confirmations, or notification replies.
The process begins when someone texts "HELP" to your SIM number. The Android phone connected to the SimGate app detects the incoming SMS message. SimGate then forwards the event to n8n, which checks the sender's details and the keyword received. If the conditions are met, SimGate sends an acknowledgment back to the sender using the same phone number that received the initial message.
The SimGate app connects the Android phone to n8n, allowing the phone's SIM number to be used for the reply. The starter template only replies to a test sender through one configured device, simplifying initial testing before integrating with customer records or other actions.
To set up this workflow, an Android phone with an active SIM that supports SMS is required. The SimGate app must be installed and linked to your account. Additionally, n8n (Cloud or self-hosted) and a separate control phone to send test messages are necessary. Ensure the gateway phone remains powered and online, grants the app SMS permissions, and confirms that the SIM can receive ordinary text messages.
For the setup, you'll need to install the SimGate nodes and add credentials. SimGate is a verified n8n integration available on both Cloud and self-hosted instances. After opening a workflow, search for SimGate, select it, and choose "Install." You'll be using two nodes: SimGate Trigger for receiving SMS and SimGate for sending replies. Create an API key in the SimGate dashboard and add it as a SimGate API credential in n8n. Perform a connection test to ensure everything is working correctly.
Next, download the n8n SMS auto-reply workflow JSON file. Import this file into n8n, which will add three nodes: Receive SMS, Prepare HELP reply, and Send reply. Make sure to update the following placeholders within the workflow:
- Replace your separate test phone's number in international format (e.g., +14155550100) in the Prepare HELP reply node.
- Replace the gateway phone's device ID from your SimGate dashboard in the same node.
- Select the same SimGate API credential for sending the reply.
The SimGate Trigger node handles incoming SMS events, emitting them as n8n items. The critical fields to focus on include:
- `id`: Identifies the event for deduplication.
- `from`: The sender's number, which you'll use to match the keyword.
- `body`: The message content, which will be checked against the "HELP" keyword.
- `deviceId`: Indicates the phone number that received the SMS, ensuring replies are sent through the correct device.
Within the Prepare HELP reply node, the provided code filters messages based on the following criteria:
1. It checks if the message type is `sms.received`.
2. Verifies that the sender's number and device ID match the specified values.
3. Confirms that the message body is a string and matches the "HELP" keyword (case-insensitive).
4. Validates that the sender's number follows the correct international format (e.g., +1XXXXXXXXXX).
Once the workflow is activated, the SimGate Trigger node registers its webhook and automatically captures the signing secret. It then verifies signed deliveries and checks that their timestamps are within five minutes of the n8n host's clock. If multiple inbound automations are required, consider using one trigger workflow and branching inside it to accommodate additional scenarios.
After setting up the workflow, activate it, and start testing by sending the "HELP" message from your control phone. The reply should be received back on your designated phone number, demonstrating the two-way SMS capability.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.