execute_javascript
Queries and analyses high-frequency lap telemetry (speed, brake, throttle, steering, gear, RPM, track coordinates, tyre temperatures/pressures/grip/slip, suspension, and corner/braking diagnostics) stored on the Flowix server for lap_id and optional reference_lap_id using the read-only FlowixData query API. Each call is stateless; pass lap_id every time. Inside the script, globals lapId and refId (null without a reference lap) hold those UUIDs. If a call returns a busy error, retry shortly. If a script has a syntax or runtime error, adjust the script and call again. Recommended FlowixData queries:
FlowixData.compareLaps(compId?, refId?): Scans lap delta and returns topDeficitZones where time was lost (all distances in meters).
FlowixData.analyzeCorner(lapId, startDist, endDist, refId?): 4-phase MoTeC breakdown with understeer/oversteer detection, tyre stress, car setup recommendations, and meter units.
FlowixData.detectBrakingZones(lapId, threshold?): Detects braking events and trail-braking profile ('ski_slope', 'abrupt_release', 'trapped_brake'). These profile labels are internal: describe the behaviour in plain words instead of quoting them.
FlowixData.getActiveChannels(lapId?): Identifies recorded channels vs unrecorded all-zero channels.
FlowixData.getSummary(lapId): Whole-lap top speed, min speed, and acceleration stats.
FlowixData.listChannels(lapId) / getTyreSummary(lapId, startDist?, endDist?) / getChannel(lapId, name, startDist?, endDist?, step?): Reads extended channels (tyre temperatures, pressures, grip, slip, brake temps, suspension, weather); extended channels are read via these methods rather than row fields. Note: Always express distances in METERS. Only all-zero channels indicate unrecorded simulator channels. When pointing at a spot on the lap, include a link to the lap analysis page (zoom, markers, highlights): call get_coaching_guidelines once for the link format.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lap_id | Yes | UUID of the lap to analyse (the comparison lap) | |
| script | No | Optional JavaScript code (omitted: a whole-lap overview is returned); the value of its last expression is returned as JSON. Telemetry is accessed only via FlowixData methods, e.g. `FlowixData.getActiveChannels(lapId)` or `FlowixData.getSummary(lapId)` or `const z = FlowixData.detectBrakingZones(lapId); z.slice(0, 5)` | |
| reference_lap_id | No | Optional UUID of a reference/benchmark lap on the same track |