Request Lifecycle
The Complete Call Flow
Understanding the request lifecycle helps you debug issues and optimize your agents. Here’s the complete flow:

Phase 1: Call Setup
When a call arrives at SignalWire:

Key points:
- SignalWire knows which agent to contact based on phone number configuration
- The request includes Basic Auth credentials
- POST is the default; GET requests are also supported for SWML retrieval
Phase 2: SWML Generation
Your agent builds and returns the SWML document:
Phase 3: AI Conversation
Once SignalWire has the SWML, it executes the instructions:

AI Parameters that control this loop:
Phase 4: Function Calls
When the AI needs to call a function:

Phase 5: Call End
When the call ends, the post-prompt summary is sent:

Handling Post-Prompt
Configure post-prompt handling in your agent:
Python
TypeScript
Request/Response Headers
SWML Request (GET or POST /)
SWML Response
SWAIG Request (POST /swaig)
SWAIG Response
Debugging the Lifecycle
View SWML Output
Test Function Calls
Monitor Live Traffic
Error Handling
SWML Errors
If your agent can’t generate SWML:
SWAIG Errors
If a function fails:
Next Steps
Now that you understand the complete lifecycle, let’s look at how security works throughout this flow.