Content Strategist
Dani PlickaWhen starting a project with SignalWire, choosing the right tools to build with is the first step. This can be a hard choice, but your use case should designate exactly what you need. Overall, SignalWire offers three core options:
SignalWire Markup Language (SWML): A JSON or YAML based call flow language designed for AI interactions and complex programmable logic. Pairs with Call Flow Builder.
Compatibility API and XML (cXML): A REST API and XML-based language meant for quick migrations from providers like Twilio or legacy VoIP systems.
RELAY: A WebSocket-based protocol that gives developers complete control over real-time call states, events, and interactions.
Each technology serves a distinct purpose. In this post, we’ll get into the details so that you can understand their strengths and use cases to make the right choice for your application.
SWML: The future of AI-powered call flows
If you’re looking to build AI voice applications with uncomplicated coding, SWML is the obvious choice. Designed for modern JSON-based workflows, SWML allows developers to define entire call flows within a single document, making it easier to manage, scale, and integrate with AI.
One of the easiest ways to experience SWML for the first time is to use Call Flow Builder, which will write the SWML script of your call flow for you. This will give you an idea of how to work with SWML for more complex projects.
SWML is also the way to implement AI agents into voice applications within SignalWire. If your project involves virtual assistants or any kind of agentic AI application, SWML makes building and prompting easy. Unlike older CPaaS solutions that use XML, SWML adopts JSON or YAML, which are more flexible and readable.
With SWML, you can define every step of a call in a single file, avoiding the need for external API calls or fragmented XML documents. SWML is serverless, and thanks to our web editor, you can author, test, and deploy SWML entirely within the SignalWire Dashboard. This keeps your logic structured, efficient, and easy to maintain.
Use SWML if you need:
a lower-code way to build complex IVRs and call flows
to design humanlike, low latency AI agents that can handle calls and actions
serverless, scalable, and programmable call routing
Example use case
A large e-commerce business wants to build AI into an IVR that can process returns, track orders, and escalate complex issues to human agents. Instead of requiring multiple XML documents or backend logic, SWML allows the entire call flow to be defined in one place, integrating AI, API calls, and dynamic responses.
Compatibility API & cXML: A simple migration path for legacy systems
When transitioning from legacy VoIP systems or Twilio, the Compatibility REST API and cXML provide an easy, structured way to migrate existing call flows with minimal changes. If you’ve used TwiML, you’ll find cXML almost identical, offering quick portability without a steep learning curve. SignalWire’s Compatibility API is similarly designed for plug-and-play migrations from Twilio’s API.
When migrating, cXML allows you to reuse most of your existing logic with only minor tweaks, making it easy to work with, especially for teams already familiar with XML-based workflows. Unlike real-time event-driven solutions, cXML doesn’t require a persistent backend, making it a good choice for small-scale IVRs and call routing setups.
Use the Compatibility REST API and cXML if you are:
porting a Twilio app or legacy IVR system without extensive refactoring
dealing with basic call routing and simple IVRs that don’t require AI or complex event handling
Example use case
A small healthcare provider has an existing Twilio-based patient appointment IVR. Instead of rewriting the entire system, they use cXML to quickly migrate their call flow to SignalWire. Since cXML is nearly identical to TwiML, the transition is quick and easy, requiring only minor adjustments.
RELAY: Real-time control for developers
For experienced developers building real-time, event-driven audio and video applications, RELAY offers full control over call and event states. Unlike SWML and cXML, RELAY operates over WebSockets, keeping an active connection between your app and SignalWire, allowing dynamic, interactive applications to be built with precision and flexibility.
RELAY applications create persistent connections via WebSocket, allowing instant control over call flows, messaging, and events. However, RELAY requires a backend application to process events and control call behavior dynamically.
We wouldn’t recommend this approach for every project. But if your app reacts to live data or external triggers, RELAY gives you the tools to modify call behavior as it happens.
Use RELAY when:
real-time event handling (live call monitoring, dashboard updates, agent assistance) is critical
you need fine-grained control over call states, media streaming, and event logic
interactive applications have a backend that actively manages call progression
Example use case
A large customer service center needs a way for supervisors to monitor live calls and intervene when necessary. Using RELAY, the system can listen in on active calls without interrupting them, allow supervisors to whisper guidance to an agent, or even barge into the call if needed.
How to choose between SWML, cXML, and RELAY
Ask yourself these questions:
Are you building an AI-powered IVR or call flow? → SWML is the best choice.
Are you migrating a Twilio app or legacy IVR? → cXML is the easiest path.
Do you need real-time event handling and backend-driven logic? → RELAY is the way to go.
Each of these tools serves a unique purpose. Whether you’re a developer looking for full control, a business migrating from a legacy provider, or a team wanting to build an AI-powered IVR, SignalWire provides the flexibility to build the right communication experience for your needs.
If you have any questions as you get started with SWML, cXML, or RELAY, bring them to our community forum, Discord, or Slack!