> ## Documentation Index
> Fetch the complete documentation index at: https://www.voiceflow.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Send a text follow-up

> After answering a support question, offer to text the agreed details. This worked journey sends “Northstar support: your requested collection instructions are ready.” to…

After answering a support question, offer to text the agreed details. This worked journey sends “Northstar support: your requested collection instructions are ready.” to a separate test phone. It sends one notification; it does not move the conversation into an SMS Chat session.

## Before you begin

- An authorized SMS sender and a separate recipient you control. Use approved content and a recipient who expects this follow-up.
- A configured notification path from the [Twilio](/docs/guides/integrations/twilio/overview#sending-sms), [Vonage](/docs/guides/integrations/vonage/overview#sending-sms) or [Telnyx](/docs/guides/integrations/telnyx/overview#sending-sms) manual. Complete its credential and test-send prerequisites first. Voice-number assignment alone does not prepare the SMS action.
- A place to retain the provider message ID and the result of the send, so an uncertain response does not immediately trigger another message.
- For the Studio worked example, a **Chat** agent and a typed **Run** conversation. Use the separate phone's E.164 number, including `+` and country code. This example's exact typed confirmation tokens do not establish spoken confirmation behavior on a phone call.

The Twilio path uses **Send SMS** with `from`, `to` and `body`. Vonage and Telnyx use an API tool plus their payload formatter. These are implementations of the same notification job, with separate credentials and result formats.

## Confirm and send the follow-up

### 1. Confirm the destination and content

Read back the test recipient and the message. Continue only after confirmation; use a correction or cancellation branch otherwise. Keep the approved sender separate from the recipient. A caller's displayed number is a routing value, not proof of identity or permission to expose account information.

#### Studio

1. Through **More → Variables**, create `sms_to`, `sms_body`, `sms_confirm`, `sms_message_id` and `sms_status` with empty defaults.
2. Remove any directly attached SMS send tool from **Global tools** and from Playbooks after the manual's standalone test. Otherwise the agent has a send route outside this confirmation gate. Keep the saved tool available for a step inside the Workflow.
3. Create a Workflow named **Send confirmed follow-up** and attach that Workflow to the agent. Its Trigger should describe a request to text agreed support details. Build the following connected sequence from **Start**. For each **Message → Scripted** before a Listen, turn **Wait for user input** off; the following Listen collects the answer. For each **Listen**, use **Save entire reply to...** and turn **Listen for other triggers** off.

| Step | Configuration | Next |
| --- | --- | --- |
| Message: Ask for recipient | Ask for the separate test phone, including `+` and country code. | Listen: Save recipient |
| Listen: Save recipient | Save the whole reply to `sms_to`. | Message: Ask for approved text |
| Message: Ask for approved text | Ask for the agreed collection message. | Listen: Save approved text |
| Listen: Save approved text | Save to `sms_body`. | Message: Read back the message |
| Message: Read back the message | Insert the `sms_body` and `sms_to` variable chips. Ask: “Type SEND, CHANGE or CANCEL.” | Listen: Save confirmation |
| Listen: Save confirmation | Save to `sms_confirm`. | Condition: Confirm the send |

4. In **Condition → Business logic**, create three paths using `sms_confirm` **is** `SEND`, `CHANGE` and `CANCEL`. Connect **SEND** to **Reset attempt results** in the next section, **CHANGE** to **Ask for recipient**, and **CANCEL** to a Scripted Message saying “Cancelled. No message has been sent.” followed by an **End** step. Connect **Else** to **Read back the message**.

The comparison is exact: enter uppercase tokens without surrounding spaces for this exercise. Whole-reply capture does not validate or normalize a phone number. Use the controlled E.164 test recipient; before customer use, add your application's recipient checks and an appropriate confirmation design for the actual channel.

#### Developer

Have your application verify the recipient and approved content before sending. Retain a pending operation in your application keyed to this requested follow-up. Choose one send attempt at a time; the provider write is not made idempotent by a Voiceflow tool ID.

### 2. Prepare the provider-specific message

#### Studio

Add a **Set** step named **Reset attempt results** immediately after **SEND**. Under **Variables to set**, add two **Value** items: set `sms_message_id` and `sms_status` to the literal text `pending`. Keep this reset before every provider attempt; empty defaults initialize the variables only once.

- **Twilio:** connect this reset to an **Integration** step with **Twilio → Send SMS**. Bind **to** to `sms_to`, **body** to `sms_body` and **from** to the fixed approved sender. Open each **Input variables** row and choose its named variable chip or enter the fixed sender.
- **Vonage or Telnyx:** connect the reset to the manual's formatting **Function**, with `to` from `sms_to`, fixed `from` and `text` from `sms_body`. Save its output to `sms_payload`, then bind the following **API** step's payload input to that variable. Leave the formatter's custom paths empty and turn **Async execution** off on the Function and API steps. Enable its **Failure path**; wire **Success** to the API and **Failure** to review/correction and End, never to the API. The formatter rejects malformed E.164 inputs, but a thrown error alone does not prevent default-path continuation. Test a malformed destination after a successful send and confirm the API does not run with an earlier payload.

Workflow Integration step for sending a confirmed Twilio SMS — The send step receives the confirmed variables and runs only on the Condition's SEND path.

#### Developer

Use a Voiceflow bearer credential with access to your test project and Environment. Set `VF_TOKEN`, `PROJECT_ID`, `ENVIRONMENT`, `SMS_FROM` and `TEST_RECIPIENT` in your trusted shell. For Twilio, the following fixed text avoids standalone brace-token binding:

```sh
jq -n --arg from "$SMS_FROM" --arg to "$TEST_RECIPIENT" \
  '{toolName:"twilio_send_sms",inputs:{from:$from,to:$to,body:"Northstar support: your requested collection instructions are ready."}}' \
  > sms-execute.json
```

For Vonage/Telnyx, use the manual's downloaded formatter and `prepare-send.mjs` to produce `sms-execute.json`. Set `SMS_TEXT` to the confirmed message and retain the saved request's `API_TOOL_ID`. The formatter protects quotes, newlines and literal brace text; constructing quoted JSON with raw string replacement does not.

### 3. Send once and inspect the returned result

#### Studio

In the send step's **Capture response**, save the ID path below to `sms_message_id` and the status path to `sms_status`. These paths start at the step's result, with no standalone execute wrapper:

| Provider | ID path | Status path |
| --- | --- | --- |
| Twilio | `processedMessages.sid` | `processedMessages.status` |
| Vonage | `messages[0].message-id` | `messages[0].status` |
| Telnyx | `data.id` | `data.to[0].status` |

Connect the send step to **Condition → Business logic**, named **Check current provider result**. For each acceptance path, use **Match all**: `sms_message_id` **is not** `pending`, `sms_message_id` **is not empty**, and `sms_status` **is** the accepted value below. Add separate paths when several values are allowed; connect them to the same Scripted Message reporting the actual saved ID/status, then **End**.

| Provider | Separate accepted status paths |
| --- | --- |
| Twilio | `queued`, `accepted`, `sending`, `sent`, `delivered` |
| Vonage | `0` (the captured string `"0"` becomes numeric `0`) |
| Telnyx | `queued` |

Connect **Else** to “This attempt has no confirmed acceptance. Check the provider log before retrying,” then **End**. Any additional provider status stays on review until you interpret it using the provider contract. Keep an API step's enabled **Failure path** connected to the same review path. Twilio's Integration step has no equivalent Failure toggle: the reset and result Condition handle missing captures after a failed call. An unchanged `pending`, empty ID, provider error or timeout must never reuse an earlier accepted result. “Queued” or “sent” still does not establish delivery.

Select **Run**, request a text follow-up and enter the controlled recipient and exact worked message when asked. Check the read-back, type `SEND` and inspect the step result in the debugger alongside the saved variables. This is the first real provider send in the Workflow. In the same session, run a second confirmed attempt with a deliberately invalid test recipient. Confirm the reset runs, the unresolved branch is taken, and no earlier message ID is reported as the new attempt.

#### Developer

For Twilio, execute the prepared action:

```sh
curl --fail-with-body --silent --show-error \
  "https://realtime-api.voiceflow.com/v1/stable/integration/twilio/execute?projectID=$PROJECT_ID&environmentAlias=$ENVIRONMENT" \
  -H "Authorization: Bearer $VF_TOKEN" -H 'Content-Type: application/json' \
  --data-binary @sms-execute.json
```

For a Vonage/Telnyx saved API tool, use:

```sh
curl --fail-with-body --silent --show-error \
  "https://realtime-api.voiceflow.com/v1/stable/api-tool/$API_TOOL_ID/execute?projectID=$PROJECT_ID&environmentAlias=$ENVIRONMENT" \
  -H "Authorization: Bearer $VF_TOKEN" -H 'Content-Type: application/json' \
  --data-binary @sms-execute.json
```

Require `success: true`, `error: null` and `truncated: false`, then inspect the provider result. Standalone execute tests the selected Environment's Draft; it does not attach or publish a tool.

| Path | Acceptance check and retained ID |
| --- | --- |
| Twilio Send SMS | Inspect `processedMessages.sid` and `status`; standalone execution places these under `output.data`. |
| Vonage API tool | HTTP success plus `messages[0].status: "0"`; retain `messages[0]["message-id"]` from the provider body. |
| Telnyx API tool | Successful provider response and `data.id`; inspect the intended recipient's status and errors. |

For API tools, standalone execution exposes the provider HTTP status in `output.status` and body in `output.body`. HTTP success can contain a provider application error. An accepted or queued message is not a delivery receipt.

### 4. Check receipt and the cancellation path

Compare the message ID with the provider's message log and check the recipient's phone. Confirm the exact content and that only one message arrived. In fresh test sessions, exercise all routes:

| Confirmation | Expected result |
| --- | --- |
| `SEND` | One send step; retain its ID and status, then check receipt. |
| `CANCEL` | Cancellation message and End; no send step or provider message. |
| `CHANGE` | Collect recipient and text again; read back the new values before a subsequent `SEND`. |
| Any other reply | Read back again; no send step. |

Before customer use, publish the reviewed Workflow and prepare the intended Published credentials. Repeat the journey in a fresh released-agent session. A standalone send alone does not verify the agent's confirmation and branching.

## Handle an uncertain send

If the action times out or its response is lost, keep the operation unresolved and inspect the provider log before another attempt. Do not tell the customer the message was delivered from an accepted status. For ongoing text support rather than one notification, use [Support customers over SMS](/docs/guides/integrations/phone-messaging/support-over-sms).
