Knowledge > Runbooks > Voice Ops > Deploy Voice Agent Code Changes
Deploy Voice Agent Code Changes
Deploy updated voice agent code to Railway. This runbook covers the full deploy cycle: branch, code, test, deploy, verify.
Prerequisites
- Write access to
churchwiseai-webgit repository - Railway CLI (optional) or Railway dashboard access for log monitoring
- No active concurrent voice agent deployments in progress
Critical Warnings
- One agent serves all churches. A bad deploy affects every church simultaneously.
- Deploy via LiveKit CLI. Run
C:\dev\lk.exe agent deploy --project cwa-voice --silent. No git push, no Railway, no Cartesia CLI needed.
Steps
-
Create a feature branch from
maincd /mnt/c/dev/churchwiseai-webgit checkout maingit pull origin maingit checkout -b feat/voice-[short-description] -
Make your changes in
churchwiseai-web/voice-agent-livekit/Key files:
main.py— entry point and call routing (readssip.trunkPhoneNumber)session.py— Supabase client, phone registry, cachingturn_processor.py— moderation, noise filteringverticals/church/agents.py— Coordinator + Care agent buildersverticals/church/prompts.py— per-church prompt templatesverticals/church/tools.py— prayer, callbacks, visitor capturecore/— shared utilities and RAG
-
Test locally if possible (limited — LiveKit runtime is not available locally, but Python syntax and import errors can be caught):
cd /mnt/c/dev/churchwiseai-web/voice-agent-livekitpython -m py_compile main.py session.py turn_processor.pypython -m py_compile verticals/church/agents.py verticals/church/tools.py -
Commit your changes
git add voice-agent-livekit/git commit -m "feat(voice): [description of change]" -
Push to main — Railway auto-deploys
cd /mnt/c/dev/churchwiseai-webgit push origin mainWait ~2 minutes for Railway to build and deploy the Python service. LiveKit Cloud connects automatically once the worker is running — no additional step needed.
-
Place a test call to the demo church number (or any active church number) immediately after deploy.
-
Verify the call log shows a successful post-deploy call:
SELECT id, created_at, call_outcome, duration_seconds, error_messageFROM voice_call_logsORDER BY created_at DESCLIMIT 3; -
Merge to main after successful verification (if working on a feature branch):
git checkout maingit pull origin maingit merge feat/voice-[short-description]git push origin mainRailway will auto-deploy again from the merge push. LiveKit Cloud connects automatically.
Verification
- Railway build completes successfully (check Railway dashboard or
railway logs). - LiveKit Cloud shows the agent worker as connected (check LiveKit Cloud dashboard for project
cwa-voice-9x077mph). - Test call is answered with correct greeting and normal agent behavior.
- No
error_messagein the latestvoice_call_logsrow.
Rollback
To rollback, revert the code change in git and push to main (Railway auto-deploys):
- Revert the code change in git:
git revert HEADgit push origin main
- Wait ~2 minutes for Railway to build. LiveKit Cloud connects automatically once the service is running.
- Verify calls are routing correctly again.
See Also
- voice-agent-debug.md — if the deploy causes call issues
- cartesia-outage.md — if the deploy fails due to platform issues
- deploy-voice-agent.md — infrastructure-level deploy notes