Desktop workflow automation
Desktop workflow automation lets the Electron renderer save a reusable graph of VoiceStudio tasks, bind text or audio input to that graph, and run each item with visible progress and resumable results. It gives users a local workflow surface without replacing the speech, transcription, translation, or audio services described in Speech platform integration. It is a child workspace of the Electron desktop application, complements the wider Electron workspace interface, and sits beside related desktop automation surfaces such as the desktop agent browser.
Workflow library
The workflow library is the user’s set of saved task graphs. A workflow is a named document with steps and links between them. The canvas is for designing and saving the graph; it does not run a step by itself.
Workflow documents
Each document has a stable unique identity, a name, editable steps, and connections. The library keeps one active document and supports new workflows, copies, starter recipes, renaming, and deletion. Starter recipes cover speech batches, audio processing, localization, and call preparation so an engineer can see the intended task shape before adding custom steps.
The document model keeps display layout separate from executable settings. Moving a node or changing its label changes the saved design, but it does not change the work that a matching run has already completed. A condition step adds a controlled yes/no route to the graph. An agent or call step remains a local draft or handoff concept rather than a task that the workflow runner executes.
The library surface also exposes the state that matters to a user: the active workflow name, save status, duplicate and delete actions, and a clear setup warning when a required step setting is missing. This keeps document management separate from task execution.
References: electron/…/workflow-model.ts• L3-45 electron/…/workflow-model.ts• L68-120 electron/…/workflow-title-bar.tsx• L6-18 electron/…/workflows-page.tsx• L138-171 electron/…/workflow-model.test.ts• L17-49
Workflow persistence
The renderer stores the workflow library in browser storage and keeps run records and imported audio in a separate local store. This split lets the canvas reopen quickly while larger audio and completed outputs remain available to the run panel. Saved data is treated as untrusted: invalid steps or links are discarded, and an unreadable library becomes a usable new workflow instead of blocking the workspace.
The library autosaves document changes. When a workflow is copied, source audio can remain shared. The renderer releases that audio only after the last workflow reference is gone. It records removed media and runs in a cleanup queue so a storage error does not lose the deletion work. A workflow deletion first removes its saved run, then removes the document from the library.
The saved-library parser also preserves large libraries and graphs without silently cutting their documents, steps, or connections. It repairs automatically generated names when the saved language changes while leaving custom names unchanged. When saved connections point to missing steps, it drops only those broken connections and keeps the rest of the workflow usable.
References: electron/…/use-workflow-library.ts• L14-24 electron/…/use-workflow-library.ts• L32-63 electron/…/workflow-model.ts• L123-272 electron/…/workflow-model.ts• L434-447 electron/…/workflow-delete-dialog.tsx• L16-45 electron/…/workflow-run-store.ts• L3-23 electron/…/workflow-run-store.ts• L40-63 electron/…/workflow-model.test.ts• L51-133 electron/…/workflow-model.test.ts• L146-151
Input binding
Input binding connects a workflow’s input step to the material that the later steps will process. Text workflows use one or more scripts. Media workflows use imported audio clips. The same graph can therefore apply one task chain to a batch of independent items.
Text and media inputs
The start of a text workflow accepts direct text or imported script files. Direct text uses a line containing --- as the separator between items. Each imported audio file becomes one item in an audio workflow. The workflow keeps source names so the run panel can show which clip or script produced each result.
Input limits protect the renderer and the local store. A workflow accepts at most 50 input items, each script is bounded in size, and each imported audio file has a bounded size. These limits apply before execution, so a run cannot start with only part of an invalid batch.
References: electron/…/workflow-inputs.tsx• L59-85 electron/…/workflow-inputs.tsx• L102-128 electron/…/workflow-runtime.ts• L136-143
Step settings
Step settings bind reusable VoiceStudio choices to a task. Speech and voice-conversion steps use a saved voice profile with language and speed controls. Translation uses source and target languages plus a local provider. Normalization uses a target level. Transcription reads the source audio and lets the service detect its language. A condition uses a phrase and a match mode to choose its route.
The inspector owns these settings while the canvas shows a short summary. It also shows the first setup issue for the selected step and provides the handoff action for a call draft. This relationship keeps the graph readable while making missing run inputs visible before execution.
References: electron/…/workflow-inputs.tsx• L27-58 electron/…/workflow-inputs.tsx• L87-100 electron/…/workflow-inspector.tsx• L14-45 electron/…/workflow-inspector.tsx• L63-110 electron/…/workflows-page.tsx• L388-399
Operation orchestration
Operation orchestration turns an editable graph into a safe, typed task plan. The compiler checks the whole graph before it allows any service call. The executor then applies the plan to each input item and records every useful intermediate result.
Execution graph
Executable workflows have one input step and one end step. They can use a linear path or a condition with exactly two labeled routes. Each path must reach the end, and routes that join must carry the same kind of value so a shared tail receives a stable input type.
The supported task chain is:
- Text to speech through a selected voice.
- Audio transcription to text.
- Text translation between explicit languages.
- Audio voice conversion through a selected voice.
- Audio normalization after generated speech or converted audio.
- Text conditions that route each item by phrase match.
Call, agent, and other draft nodes are useful design or handoff concepts, but they are not execution steps in this runner. A call draft opens the call workspace with its phone number and brief. It does not dial as part of a workflow run.
The canvas makes the graph rules visible. The step palette groups input, task, draft, and end steps. A new step can be placed on the canvas or added after a selected step when that step has a free output. A condition exposes separate yes and no connection points.
This diagram shows how input type and a condition control the operations that can follow an item.
flowchart LR
Text[Text scripts] --> Speak[Speak]
Text --> Condition{Condition}
Audio[Audio clips] --> Transcribe[Transcribe]
Audio --> Convert[Convert voice]
Transcribe --> Translate[Translate]
Translate --> Speak
Condition -->|yes| Yes[Text branch]
Condition -->|no| No[Text branch]
Speak --> Normalize[Normalize audio]
Convert --> Normalize
Speak --> End[Completed output]
Normalize --> End
Translate --> TextOut[Completed text]
Transcribe --> TextOut
Yes --> End
No --> End
References: electron/…/workflow-runtime.ts• L38-161 electron/…/workflow-branching.test.ts• L49-184 electron/…/workflow-runtime.test.ts• L95-160 electron/…/workflow-setup.test.ts• L14-53 electron/…/workflow-step-palette.tsx• L7-20 electron/…/workflow-step-node.tsx• L72-117 electron/…/workflows-page.tsx• L263-327
Branch evaluation
A condition compares the text that reaches it with its configured phrase. The match can check containment, equality, a starting phrase, or an ending phrase. The comparison ignores case and surrounding spaces, so the same input takes the same route on each machine.
Each input item evaluates the condition on its own. A single run can therefore send different scripts down different routes. A route can join another route only when both carry the same value type, and the shared tail runs once for each item that reaches it.
References: electron/…/workflow-runtime.ts• L40-57 electron/…/workflow-runtime.ts• L97-111 electron/…/workflow-runtime.ts• L205-219 electron/…/workflow-branching.test.ts• L62-120
Service operations
The operation layer maps each executable step to an existing VoiceStudio service. Speech generation uses the selected voice and speech controls. Transcription checks local recognition readiness before sending audio. Translation sends one segment through the chosen local provider. Conversion retrieves the local audio artifact returned by the conversion service. Normalization sends the current audio to the audio tool.
The runner passes an abort signal to each operation. A service result must contain usable text or non-empty audio before the executor stores it as a successful checkpoint. This keeps an incomplete service response from looking like a valid workflow output. Translation failures remain failures even when the service returns the original source text, and conversion accepts only the local audio route.
References: electron/…/workflow-operations.ts• L15-21 electron/…/workflow-operations.ts• L23-89 electron/…/workflow-operations.test.ts• L17-106 electron/…/workflow-runtime.ts• L172-179 electron/…/workflow-runtime.ts• L220-245
Run state
Run state describes the progress of each script or audio clip independently. It gives the renderer enough information to show queued, active, completed, failed, or cancelled work and to resume without repeating successful operations.
Checkpoints and resume
Before inference starts, the runner saves a run record. After source loading and after each operation, it saves the current text, audio, step, and state. Execution is serial so model loads and local service work do not compete across items.
If one item fails, the executor stops rather than silently skipping it. A retry reuses completed checkpoints for that item and then continues from the failed step. Cancellation keeps completed work and marks the active item as cancelled. A later run can resume that work when the executable plan still matches. For a branched plan, resume uses the checkpointed text to take the same condition route again.
The reuse signature contains input scripts, execution settings, condition rules, and graph wiring. It excludes names and canvas positions, but includes values such as voice, speed, languages, provider, normalization level, match phrase, and match mode. Changing an executable value or route invalidates old results; renaming or moving a node does not.
References: electron/…/workflow-runtime.ts• L4-35 electron/…/workflow-runtime.ts• L144-169 electron/…/workflow-runtime.ts• L205-257 electron/…/workflow-branching.test.ts• L88-103 electron/…/workflow-branching.test.ts• L208-243
Local run storage
Run records are keyed by workflow identity and validated when read. They contain text checkpoints and audio blobs for completed steps. Source media uses the same local store with a separate key space, so a workflow can survive a page reload before its first run.
Storage is part of the run contract. If the first checkpoint cannot be saved, the runner does not start expensive inference. If a later save fails, the run reports the storage error instead of claiming that recovery is available.
References: electron/…/workflow-run-store.ts• L25-53 electron/…/workflow-runner.tsx• L49-65 electron/…/workflow-runtime.test.ts• L68-80
Execution interface
The execution interface joins the graph editor and the run panel in one renderer workspace. The editor collects the graph and its settings. The run panel validates the graph, waits for required engine information, starts or cancels the run, and presents each result for review or export.
Canvas editor
The canvas is the main design surface. A left rail lists saved workflows and starter recipes. A step palette adds input, task, draft, and end steps. The center canvas shows nodes and links. Selecting a node opens an inspector for its name, input, voice, language, media, condition, or task settings.
When a workflow opens, the canvas frames all measured steps in view and keeps short workflows near the top of the work area. This gives the graph a stable reading position without changing its saved layout.
The editor marks incomplete steps on the node and in the inspector. The same setup rules block Run and guide the user to the first missing setting. The editor disables graph changes while a run is active so the executing plan cannot drift under the user.
Templates provide speech, speech with normalization, transcription, conversion, localization, and call preparation starting points. Call preparation switches to the call workspace with the draft phone number and brief; the workflow itself remains a non-dialing design.
Speech-only runs can show a text-to-speech readiness notice. Audio-only transcription does not require a working text-to-speech engine, which lets the workflow surface match the service actually used by the plan.
References: electron/…/workflow-step-palette.tsx• L10-20 electron/…/workflow-template-picker.tsx• L25-95 electron/…/workflow-step-node.tsx• L39-69 electron/…/workflow-inspector.tsx• L63-110 electron/…/workflow-title-bar.tsx• L35-90 electron/…/workflows-page.tsx• L177-410 electron/…/workflow-fit.tsx• L11-37 electron/…/workflows.css• L27-41 electron/…/workflows.css• L283-347
Run panel
The run panel shows validation and service errors before execution, then reports completed items against the total input count. Each item can show its current step, failure message, text result, audio player, and export control. The panel offers run, retry, restart, and cancel actions. It marks a saved active item as cancelled if the view closes during work.
Text and audio outputs use safe names derived from the workflow and item names. This makes exported files usable across desktop platforms without letting workflow text create path separators or control characters.
References: electron/…/workflow-runner.tsx• L41-106 electron/…/workflow-runtime.ts• L263-268 electron/…/workflows.css• L319-347
Change checklist
When these files or sections are changed, remember to consider these:
- Keep graph validation rules aligned with the operation map. A new executable step must have a data type contract, a service operation, an input editor, and a visible runner state before it can execute.
- Keep condition handles aligned across the canvas, compiler, branch map, and run signature. A missing or renamed yes/no route must fail before inference rather than select a route at run time.
- Keep the setup warning contract aligned across
stepSetupIssue, the canvas node, the inspector, and the Run control. A new required setting must be both visible and blocking. - Keep the run signature aligned with every setting and connection that changes service output. If a setting or route is omitted, an old result can be shown for new work.
- Keep workflow storage cleanup aligned with duplication, deletion, and the autosave queue. Shared source media must stay until its last workflow reference is removed, and a failed cleanup must remain retryable.
- Keep readiness checks aligned with the plan. ASR-only workflows must not become dependent on TTS readiness, while speech and conversion workflows must not start without their required engine state.
- Keep output naming rules aligned with export targets. Workflow and item names can contain characters that desktop file systems reject.
- Keep saved-library parsing aligned with workflow identity, generated names, graph links, and cleanup entries. A change that accepts or rejects saved data can alter which workflows and shared media survive reload.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A graph has a cycle, an incomplete condition fork, a disconnected step, or a path without an end | The run is rejected before any service call | Whole-graph compilation in compileWorkflow |
| A condition receives audio or has no phrase to test | The route cannot be evaluated safely | Condition type and phrase validation |
| A merge receives different value types from its branches | A shared tail could process text as audio or audio as text | Value-type agreement during graph compilation |
| A text or audio type reaches an incompatible step | The workflow could create a false or synthetic result | Explicit type checks for transcription, translation, speech, conversion, and normalization |
| A required voice, language, media file, or local model is missing | The affected run cannot produce a valid output | Canvas setup warnings, compile-time validation, and operation readiness checks |
| A service returns empty text, empty audio, or an unsafe remote audio URL | An incomplete or untrusted artifact could be saved | Result checks and local audio-route validation |
| A checkpoint write fails before inference | Expensive work could run without a recoverable run | Initial checkpoint is saved before execution |
| A later step fails | Earlier successful work could be lost or silently skipped | Per-step checkpoints and stop-on-failure retry |
| A copied workflow still shares source media | Deleting one workflow could break the other | Reference-aware cleanup queue |
| Run storage cleanup fails during deletion | The workflow is removed while old run or media data remains pending | Atomic cleanup queue and retry action |
| Saved graph data contains a connection to a missing step | A damaged link could block the whole library or create an invalid graph | Saved-library parsing drops broken connections and keeps valid data |
Key files
| File | Why to read it |
|---|---|
| electron/…/workflow-model.ts | Defines workflow documents, step kinds, condition branches, starter recipes, setup checks, saved-library recovery, and reference cleanup decisions. |
| electron/…/use-workflow-library.ts | Coordinates autosave, locale-safe names, and retryable cleanup for removed workflow data. |
| electron/…/workflow-inputs.tsx | Shows how text, scripts, audio, voices, languages, condition rules, and audio settings bind to selected steps. |
| electron/…/workflow-runtime.ts | Defines graph compilation, value-type rules, branch evaluation, run signatures, checkpoints, resume behavior, and serial execution. |
| electron/…/workflow-model.test.ts | States the contracts for workflow identity, saved-library recovery, generated names, graph preservation, and shared-media cleanup. |
| electron/…/workflow-setup.test.ts | States the contract between per-step setup warnings and graph compilation. |
| electron/…/workflow-branching.test.ts | States the safety contract for per-item routing, branch joins, condition matching, and route-aware resume. |
| electron/…/workflow-operations.ts | Maps executable workflow steps to VoiceStudio speech, audio, transcription, translation, and conversion services. |
| electron/…/workflow-operations.test.ts | Protects service contracts for local readiness, translation providers, and safe audio results. |
| electron/…/workflow-run-store.ts | Defines local persistence for run records, source media, and deferred cleanup. |
| electron/…/workflows-page.tsx | Connects the workflow library, template picker, palette, canvas, inspector, calls handoff, and run-panel entry point. |
| electron/…/workflow-step-node.tsx | Defines the node summaries, setup warnings, and condition handles shown on the canvas. |
| electron/…/workflow-step-palette.tsx | Defines how users add or drag step kinds into the graph. |
| electron/…/workflow-template-picker.tsx | Defines the starter workflow groups and their initial graph shapes. |
| electron/…/workflow-inspector.tsx | Defines step editing, setup feedback, deletion, and call preparation from the selected node. |
| electron/…/workflow-title-bar.tsx | Defines save status, run blocking, rename, duplicate, and delete controls. |
| electron/…/workflow-delete-dialog.tsx | Defines the confirmed deletion boundary for saved workflow runs. |
| electron/…/workflow-fit.tsx | Defines the opening canvas view so the workflow graph is visible and starts near the top. |
| electron/…/workflows.css | Shows the workspace layout and the desktop and narrow-window behavior of the canvas, inspector, and run panel. |
| electron/…/workflow-execution-smoke.mjs | Covers end-to-end workflow execution, checkpoint resume, audio input survival, typed processing, export, and cleanup. |