ami_survey_begin
Start an AMI survey after completing a workflow to measure its cost from session logs. Auto-detects runtime and window, and excludes survey token spend from measurements.
Instructions
Open an AMI survey for the workflow you have just completed. Detects the runtime, session and measurement window automatically, and adopts any stage markers you buffered with ami_mark_stage while working. Call this FIRST, after the workflow's real work is finished, so the survey's own token spend is excluded from the measurements.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Optional working-directory override. | |
| adapter | No | Force a telemetry adapter instead of detecting the runtime. Rarely needed. | |
| work_unit | No | Optional, but declare it together with work_unit_count. The countable thing this workflow handled: 'ticket', 'CV', 'support email'. It is what cost and duration get divided by, so a workflow that did more work is not penalised for costing more. | |
| session_id | No | Optional session id override. | |
| workflow_name | Yes | Short reusable label for the workflow, e.g. 'Support Ticket Triage & Response'. | |
| transcript_path | No | Optional explicit transcript path override. | |
| work_unit_count | No | Optional, but declare it together with work_unit. How many work units this run actually handled - a whole number you can point at in the output, not an estimate. | |
| workflow_category | No | Optional. The workflow's category, from ami_get_workflow_categories. Decides which other workflows this run is compared against; an undeclared workflow is only ever compared against itself. Take it from the workflow's own workflow.json where one exists - do not invent one. | |
| workflow_end_time | No | Optional ISO-8601 override for when the workflow ended. | |
| workflow_start_time | No | Optional ISO-8601 override for when the workflow began. Defaults to the first human turn of this session. | |
| workflow_description | Yes | 1-3 sentences: what the workflow was given and what business work it produced. Minimum 20 characters. |