Build with

Change a customer’s phone number after verifying their identity and confirming the new value. This walkthrough uses Voiceflow’s built-in Salesforce → Update contact tool with the connected org, then checks the saved value on the same record. Your application supplies the authorized Contact ID; this workflow does not require a separate API tool or Salesforce API token.

Before you begin

  • An authenticated customer with a backend-authorized Salesforce Contact mapping and a trusted runtime proxy that retains session credentials and resets protected identity on every turn. Strip client-supplied identity, variables, state and session keys, or authorize the customer-to-record relationship in a backend tool on every operation. A customer-supplied Contact ID is not an access check.
  • A test project with Salesforce CRM action OAuth and permission to update/read Contact.Phone.
  • The existing Contact ID and the customer’s confirmed international phone number. The example +14165550123 is illustrative.

Studio

Open the test project in Agent studio. In More → Variables, create salesforce_contact_id with an empty default. Your application developer supplies the authorized Contact ID on every turn and resume; do not let the model or client select another customer.

Code

Use a Voiceflow bearer credential with access to this project and test Environment; keep it on your backend. Set VF_TOKEN, PROJECT_ID and ENVIRONMENT before using the commands. Standalone execution uses the Environment’s Draft. For native CRM actions, complete the browser OAuth in the prerequisite manual even when working through Code.

Change the saved phone

1

Resolve the permitted existing record

Use your authenticated application’s customer-to-Contact mapping. Confirm the intended org, Contact ID and permission to change Phone. Inspect that test record in Salesforce before the update. If the agent also needs to retrieve profile fields independently, add the manual’s separate Contact lookup; it is an additional workflow, not a prerequisite for this update.

2

Confirm and apply only the requested change

Ask the customer to confirm the new number. Validate it under your application’s phone policy; the worked format is a leading + followed by 8–15 digits.

Studio

Add Salesforce → Update contact. Click the Id input row, choose Default value and select salesforce_contact_id from Variables. Click outside to save and check Value provided. Set Phone to the confirmed new number. Leave unrelated fields omitted. Use a Workflow condition or backend gate for confirmation and authorization, then Run once.

Change the confirmed phone on the existing authorized Contact. Photo:

Code

Set AUTHORIZED_CONTACT_ID from your backend mapping and CONFIRMED_PHONE from the confirmed, validated value. Then:

Require success: true, no error/truncation, the same output.data.Id and the confirmed output.data.Phone. The handler updates and retrieves the Contact; a read failure can happen after a successful write.

3

Read back before reporting completion

Inspect the retrieved Contact in the tool result: its ID must match the authorized record and its Phone must match the confirmed number. Open the same record in Salesforce and check that no unrelated fields changed. Only then tell the customer the update is saved. For HubSpot, the built-in catalog has no Update contact action; its additional phone update recipe uses a separately authorized API tool.

Verify the whole change

Test confirmation, cancellation, an invalid number, a different customer’s ID and an uncertain write response. Cancellation and failed authorization must leave the record unchanged. On an ambiguous failure, read the same record before retrying. For a Salesforce Lead, choose Update lead with the authorized Lead ID; do not send it to Update contact.

Use the up and down arrow keys to select a result, Enter to open it, and Escape to close the search.