# Tune ROV PPO reward weights with OpenAI, Google Sheets and Gmail

> Quick overview This workflow starts a webhook-driven PPO training loop for an ROV, logs each round’s metrics to Google Sheets, uses OpenAI to propose updated reward weights, clamps changes to safe bounds, and emails a final report (or a failure alert) via Gmail. How it works 1. Receives a POST webhook request to start a tuning run and sets the run configuration (round count, episodes per round, initial reward weights, and safety bounds). 2. Sends the current round’s configuration to your PPO trainer over HTTP to start training and then waits and polls the trainer’s status endpoint until it completes or fails. 3. If training fails, sends a Gmail alert email with the run and round details to the notification address. 4. When training completes, fetches round metrics from the trainer (mean reward, success rate, collision rate, and energy use). 5. Appends the round metrics and the current reward weights to Google Sheets to keep an audit trail. 6. Sends the latest metrics, current weights, 

- **Domain**: `n8n-workflow-19757.n8n.io`
- **Provider**: n8n.io (https://n8n.io)
- **Kind**: workflow
- **Live-responds (last probe)**: None
- **Signed card**: False
- **Streaming**: False
- **Quality score**: 40%

## URLs
- Agent card: https://n8n.io/workflows/19757
- Page (HTML): https://agenstry.com/agents/n8n-workflow-19757.n8n.io
- Documentation: https://n8n.io/workflows/19757
