Building Voice AI Workflows with Branches Instead of One Giant Prompt Telnyx launched a Conversational Workflow for auto insurance claim intake that uses structured branches and backend tool calls instead of a single large prompt. The workflow collects caller, policy, vehicle, and incident details, branches for urgent cases, and creates claim records or fallback references via Express tool endpoints. This approach makes operational processes like first notice of loss easier to audit and can be reused for scheduling, support triage, and patient intake. | name | build-conversational-workflow | | |---|---|---| | title | Build a Conversational Workflow | | | description | Build a Telnyx Conversational Workflow for inbound auto insurance claim intake with structured branches, backend tools, and priority follow-up. | | | language | nodejs | | | framework | express | | | telnyx products | | | | channel | | Build a Telnyx Conversational Workflow for inbound auto insurance first notice of loss intake. The workflow asks structured questions, branches for urgent cases, calls backend tools, and returns a claim or fallback reference to the caller. This example is configured in the Telnyx Portal as a Conversational Workflow. The local Express app exposes webhook tool endpoints that Telnyx calls from workflow tool nodes: Create Claim Intake Tool : POST /tools/create-claim-intake Log Fallback Tool : POST /tools/log-claim-intake-fallback Flag Priority Follow-Up Tool : POST /tools/flag-priority-follow-up Inbound PSTN call │ ▼ ┌────────────────────────────┐ │ Telnyx Conversational │ │ Workflow │ └─────────────┬──────────────┘ │ nodes + branches ▼ ┌────────────────────────────┐ │ Auto claim intake flow │ │ safety, caller, loss fields │ └─────────────┬──────────────┘ │ workflow tool calls ▼ ┌────────────────────────────┐ │ Express tool server │ │ /tools/create-claim-intake │ └─────────────┬──────────────┘ │ JSON result ▼ claim reference or fallback reference - Caller reaches the Telnyx phone number assigned to the workflow. - The workflow confirms this is a new auto claim. - The workflow checks for injury, danger, or unsafe vehicle status. - The workflow collects caller, policy, vehicle, and incident details. - The workflow calls create claim intake when required fields are present. - The workflow calls log claim intake fallback when the intake cannot be completed. - The workflow calls flag priority follow up when priority flag is true. Telnyx is an AI Communications Infrastructure platform that puts voice, AI, SIP, messaging, and programmable communications on one private, global network. Conversational Workflows let you build structured voice experiences with visible branches and tool calls, so operational processes like insurance claim intake are easier to audit than a single large prompt. Insurance first notice of loss is a useful workflow pattern because it has realistic business constraints: - the caller may be stressed - the workflow must collect specific fields - urgent cases need early branching - backend records should only be created after required information is present - the voice experience must not promise coverage, payment, repairs, liability, legal advice, or medical advice The same structure can be reused for scheduling, support triage, lead qualification, patient intake, and service dispatch. Copy .env.example to .env and fill in: | Variable | Type | Example | Required | Description | Where to get it | |---|---|---|---|---|---| TELNYX API KEY | string | KEY your telnyx api key here | no | Telnyx API key for Portal/API automation; the local mock tool server does not call Telnyx directly | | CLAIM TOOL SECRET string dev-secret yes x-tool-secret header from Telnyx workflow tools PORT number 8787 git clone https://github.com/team-telnyx/telnyx-code-examples.git cd telnyx-code-examples/build-conversational-workflow-nodejs cp .env.example .env fill in CLAIM TOOL SECRET npm install npm test node server.js starts on http://localhost:8787 - Expose your local server: ngrok http 8787 - In the Telnyx Portal https://portal.telnyx.com , create a Conversational Workflow named auto claim intake conversational workflow . - Build the nodes and branches from GUIDE.md https://raw.githubusercontent.com/team-telnyx/telnyx-code-examples/main/build-conversational-workflow-nodejs/GUIDE.md . - Configure tool nodes with your ngrok base URL: POST https://