End-to-end message flow
The most important runtime detail
Backend tool calls, frontend tool calls, and screen-autopilot actions all run from the embedded widget and then report results back to Warpy.
Tool routing logic
What each layer is responsible for
| Layer | Responsibility |
|---|---|
| Widget | capture the message, fetch config, execute browser-side tool calls, return results |
| Warpy API | orchestrate reasoning, choose tools, enforce widget auth, produce the final response |
| Customer app | receive backend requests, expose frontend handlers, or provide live page context |
Backend tool execution path
When Warpy returns a backend tool call, the widget:- reads the configured session headers from browser storage
- substitutes path parameters
- builds query string and body
- sends the request to your selected base URL
- sends the result back to Warpy
Frontend tool execution path
When Warpy returns a manual frontend tool call, the widget:- calls
window.warpy(toolName, vars) - waits for your app to finish the handler
- sends the result back to Warpy
Screen autopilot path
When screen autopilot is enabled, Warpy can:- inspect the page structure
- find the right element
- click, type, select, navigate, scroll, or run JavaScript
Security and limits in the flow
- Signed widget tokens are enforced on
POST /widget/chat. - Token refresh happens through the customer-owned endpoint you configure.
- Per-user rate limits are checked before and after billable execution.
- The widget hides when action availability or rate-limit state says it should.