# Text a lead before calling

## Prompt

```text
When a new lead in my sheet or Salesforce has opted into both texts and calls, text from our number. About five seconds after the carrier accepts the text, call them. Show me the proposed actions before activation.
```

Map a stable record ID, destination and the two actual consent records from an authenticated source. The worker sends one SMS. A local harness can use the durable follow-up example to store the receipt and earliest call time. The clock starts at carrier acceptance. Polling latency and carrier setup affect when the phone rings. Stop on opt-out, unknown delivery, a failed send, or a missing authorization. Use the saved call key on every retry. A server-side scheduler can drive the same steps while the laptop sleeps.

[Download the first worker](/recipes/workers/lead-text.mjs) · [Download the durable follow-up](/recipes/workers/follow-up.mjs). Keep the returned message ID, thread ID and the lead's original contact source in the customer's protected workspace.

Give the first worker a per-run SMS budget with `max_text_cost_usd` and a credential with `messages:write`. Use `test_worker` to inspect the proposed text before activation.
