Scaffold a first-draft Workbench flow
workbench_flows_scaffoldCreates a runnable first-draft flow from a spec you author: pick the simplest pattern that fits (classifier for read-and-bucket, structurer for transform/extract/draft-for-review, agent for genuinely conversational), write a production-quality system prompt grounded in what the user told you, and mark anything stubbed with [STUB: ...] markers plus stubNotes. The draft opens in Workbench's simple editor at /w//flows/ — give the user that path. May return needs_confirmation; show the user what you're proposing and wait for their approval, then re-call with the approvalId. When the draft comes from a Compass change, pass its opportunityId so the flow and the change point at each other (Compass shows 'Open in Workbench'; the flow shows where it came from). Then: workbench_flows_run to try it, workbench_flows_publish when it's ready for schedules and share links.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | Pattern editor the draft opens in. Pick interviewer for conversations that LEARN something from a person (research calls, intake, retros) — pair it with workbench_flows_share_create so non-account humans can talk to it. | |
| model | No | The model node slug the draft runs on — an `llm` entry from workbench_node_catalog_get that the workspace allows (e.g. an OpenAI, Anthropic, or Google model). Defaults to Claude Haiku 4.5. Set it here rather than editing the flow afterwards. | |
| flowName | Yes | Imperative + specific, ≤80 chars. | |
| stubNotes | No | What's stubbed / missing / worth wiring next. | |
| workspace | No | Workspace slug. Personal tokens with no default workspace MUST pass this. | |
| approvalId | No | Approval id from a prior needs_confirmation response. Omit on the first call. | |
| categories | No | classifier only: 2-12 buckets. | |
| description | No | 1-2 sentences: what it does, where it fits. | |
| systemPrompt | No | The draft's behavior — production-quality first attempt with [STUB: ...] / [FILL IN: ...] markers where reality is missing. Required for structurer and classifier. Leave it out of an agent to get the bare model with no instructions (a 'promptless' agent). | |
| opportunityId | No | Compass change (from compass_opportunities_list) this draft implements. Sets the flow ↔ change link; refused when the change already has a draft. | |
| inputDescription | No | What the flow's single input carries. | |
| responseSchemaJson | No | structurer only: the output JSON Schema, JSON-encoded as a string (object root, required fields, additionalProperties false). |