Compile Workflow Diagram
compile_workflowTurn supplied document evidence or raw operational text into a publication-ready workflow diagram with source references, clean vector SVG, Mermaid, Excalidraw scene, and interactive Studio deep link (studioUrl). INPUT SCOPE: Use reviewed written procedures only. Do not interpret scans, images, chart/diagram geometry or unlabeled arrows, and do not certify business procedures. Ask for reviewed written process text or source-backed clarification. HOW TO STRUCTURE TEXT INPUTS: Either pass sources (array of 1..60 verbatim chunks {id, locator, excerpt} where each excerpt is <= 2000 chars with exact numbers/actors/thresholds preserved) OR pass raw text and Unseen will automatically segment it into source chunks. EDITING GUIDANCE: For cosmetic/styling/annotation edits, edit the returned <svg> XML directly. For structural/topological edits (adding/removing nodes or rerouting branches), edit spec (VisualSpec JSON) and call autofix_workflow ($0 deterministic connector healing + fresh SVG/Mermaid/Excalidraw) or revise_workflow.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | Optional raw document or user text. If provided when `sources` is omitted or empty, Unseen automatically segments `text` into faithful `sources[]` chunks. | |
| jobId | No | Optional job ID when resuming a workflow after clarification | |
| sources | Yes | Array of faithful source excerpts with locators from the input document (1..60 chunks, <=2000 chars each). Preserve exact thresholds, actors, and IF/ELSE branches. | |
| userGoal | Yes | The overarching operational goal or process description (e.g. 'Driver Onboarding SOP' or 'Vendor Risk Assessment') | |
| authToken | No | Optional session token (`utok_...`) obtained from `auth_verify_otp` or `auth_login` if not already supplied in the HTTP `Authorization: Bearer` header. | |
| requestId | No | Optional client request correlation ID | |
| hostContext | No | Optional advisory context observed by the host agent | |
| priorAnswers | No | Answers to prior Unseen clarification questions when resuming a compilation | |
| desiredOutput | No | ||
| schemaVersion | Yes | Protocol envelope version (must be '0.1') |