n8n
Connect an n8n workflow to a phone number: a Webhook node receives each text, your logic writes the answer, and we text it back. n8n lines use webhook mode: paste the URL, nothing else to set up.
Set it up
Paste it into n8n's AI assistant. Your agent builds and connects everything itself, and this box turns green when it's done.
Or: already running? Paste its URL
Doing it by hand
The quick way: answer in the response (5 minutes)
- Add a Webhook node: method
POST, Respond "Using 'Respond to Webhook' node". - Add your logic: an AI Agent node, an OpenAI or Anthropic node, anything. The text is
{{ $json.body.message.body }}. - Add a Respond to Webhook node that responds with text (the agent's
output), or JSON like{"text": "{{ $json.output }}"}. - Activate the workflow, copy the webhook's Production URL and paste it into the connect wizard.
We read the response leniently: plain text, or JSON with text, output, reply, message, response or answer. n8n's default [{"output": "…"}] works too. Your workflow has 10 seconds to respond.
Slower workflows: reply later through the API
If your workflow can take longer than 10 seconds, respond straight away with nothing to say (or {"reply": "__async__"}), then send the answer with POST /v1/lines/:id/reply within 5 minutes. The template below is wired that way.
Import the template
Download n8n-arrow.json, then in n8n: Workflows, then Import from File (or paste the JSON onto the canvas).
It has five nodes, wired in order:
| Node | Type | What it does |
|---|---|---|
| Silver Arrows webhook | Webhook | POST /webhook/arrow, response mode "Using 'Respond to Webhook' node", Raw Body on. |
| Verify signature | Code (disabled) | Checks X-Arrow-Signature. Disabled nodes pass data through; enable it once your secret is set (below). |
Respond __async__ |
Respond to Webhook | Answers our request immediately with {"reply": "__async__"}. |
| Your agent logic | Edit Fields (Set) | Placeholder that builds a field named reply. Replace it with your agent. |
| Reply via Silver Arrows | HTTP Request | POST https://silverarrows.dev/v1/lines/{{line_id}}/reply with your API key. |
Step by step
1. Add your API key (2 minutes)
Create a key at /account. In the "Reply via Silver Arrows" node, replace YOUR_SA_LIVE_KEY in the Authorization header with it, so the header reads Bearer arrow_live_....
Better: set Authentication to "Generic Credential Type", then "Header Auth", with name Authorization and value Bearer arrow_live_..., and delete the inline header. That keeps the key out of the workflow JSON.
2. Put your agent in the middle (5 minutes)
The template's "Your agent logic" node just echoes. Replace it with whatever you use: an AI Agent node, an OpenAI or Anthropic node, a few HTTP calls. Whatever it is, its output must have a reply field with plain text under 320 characters.
The incoming text is available as expressions:
| Expression | Value |
|---|---|
{{ $('Silver Arrows webhook').item.json.body.message.body }} |
What they texted |
{{ $('Silver Arrows webhook').item.json.body.history }} |
Last 20 messages, oldest first |
{{ $('Silver Arrows webhook').item.json.body.sender_id }} |
Stable anonymous user id. Good for an AI Agent's memory session key. |
{{ $('Silver Arrows webhook').item.json.body.message.media_urls }} |
Photo URLs, if any |
For an AI Agent node, set the prompt to the message body, use a memory node keyed on sender_id, and add a final Set node that maps the agent's output to reply.
The HTTP Request node sends:
{
"conversation_id": "{{ conversation_id from the webhook }}",
"body": "{{ $json.reply }}",
"in_reply_to": "{{ message.id from the webhook }}"
}
3. Activate and copy the production URL (1 minute)
Toggle the workflow to Active. Open the webhook node and copy the Production URL, for example https://you.app.n8n.cloud/webhook/arrow. The Test URL only works while you're watching the editor.
4. Paste it into Silver Arrows (2 minutes)
Paste the URL into the connect wizard. An acknowledgement without a reply is read as "the answer comes later", so there's nothing to switch on. Or create the line with the API (a webhook_url alone makes a webhook line):
curl -s -X POST "https://silverarrows.dev/v1/lines" \
-H "Authorization: Bearer $SA_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My n8n Agent",
"keyword": "MYFLOW",
"webhook_url": "https://you.app.n8n.cloud/webhook/arrow"
}'
Then run the test (POST /v1/lines/:id/test) or text the keyword to the number.
Verify the signature (optional, recommended)
Anyone who finds your webhook URL can call it. To accept only our requests, turn on the template's "Verify signature" Code node (right-click, then Activate). It checks X-Arrow-Signature against the exact bytes we signed, which the webhook keeps because its Raw Body option is on.
- Copy the line's webhook secret (
whsec_..., shown once when you created the line, or rotate it withPATCH /v1/lines/:idand{"rotate_webhook_secret": true}). - Store it as an n8n Variable named
ARROW_WEBHOOK_SECRET(Overview, then Variables), or as an environment variable on self-hosted n8n. Self-hosted also needsNODE_FUNCTION_ALLOW_BUILTIN=crypto. - Activate the node.
The node's code, if you're building your own workflow:
// Code node, mode "Run Once for All Items", right after a Webhook node with Raw Body on
const crypto = require("crypto");
const secret = $vars.ARROW_WEBHOOK_SECRET || $env.ARROW_WEBHOOK_SECRET;
const item = $input.first();
const header = String(item.json.headers["x-arrow-signature"] || "").trim();
const raw = await this.helpers.getBinaryDataBuffer(0, "data"); // the exact bytes we signed
const expected = "sha256=" + crypto.createHmac("sha256", secret).update(raw).digest("hex");
const a = Buffer.from(expected);
const b = Buffer.from(header);
if (a.length !== b.length || !crypto.timingSafeEqual(a, b)) {
throw new Error("Bad Silver Arrows signature");
}
return $input.all();
Don't rebuild the body with JSON.stringify(item.json.body): n8n re-serialises it differently, so the signature won't match.
If the check throws, the workflow errors before responding and we send the line's fallback text. That's what you want for forged requests.
Scheduled messages from n8n
To send a daily message to texters who opted in, build a second workflow:
- Schedule Trigger (for example every day at 8:00).
- HTTP Request:
GET https://silverarrows.dev/v1/lines/<line_id>/schedule_consents. - Split Out the
dataarray and Filterstatusequalsactive. - Your logic writes the message.
- HTTP Request:
POST https://silverarrows.dev/v1/lines/<line_id>/sendwith{"conversation_id": "...", "body": "..."}.
A 403 daily_limit means that person already got one today; skip it. See Async and scheduled.
Troubleshooting
- "n8n returned 404: the webhook isn't listening." The workflow isn't active, or you pasted the Test URL.
- Reply never arrives: check the HTTP Request node's execution. A 403
outside_reply_windowmeans your logic took more than 5 minutes orin_reply_tois missing. - 401 from the reply endpoint: the API key is wrong or missing
Bearer.