--- name: create-workflow description: Create and run user-triggered workflows with declared steps. Use when the user asks about a workflow or wants a verifiable recipe (fetch, compare, summarize) they can run on demand from chat or the dashboard. --- When the user wants a workflow they can run on demand (for example "morning brief"), explain the step recipe clearly before saving. Use `plugin_workflows__create_workflow` with `kind` (never `type`). Last step must be `summarize` with `prompt` (never `instruction`). ```json [ { "id": "news", "kind": "tool", "tool": "web_fetch", "input": { "url": "https://news.ycombinator.com" } }, { "id": "summary", "kind": "summarize", "prompt": "Write a brief from the receipts only." } ] ``` - `tool` — assigned profile or MCP tool that can run locally; `input` must match that tool's schema. Use `web_fetch` for URLs. Do not use `web_search` — it only runs inside a provider chat turn. - `template` — substitutes values into text only. Writing “extract stories” in a template returns those instructions; it does not call AI, parse content, or produce structured JSON. - `compare` / `assert` — deterministic checks on prior receipts. `compare.op` is `eq` | `near` | `contains`. Do not use compare as free-text analysis - Filter: set `onFail: "skip"` on a `compare` / `assert` step when a false check is a normal outcome (for example "only continue if the sender contains github.com"). The run then ends as skipped, not failed, and later steps do not run - `agent` — asks the bot in the middle of the run and returns named fields. `prompt` takes references; `fields` maps each output key to what goes there. Later steps read `{{steps..}}`. The run stops if the reply is not JSON or a field is missing. - exactly one final `summarize` — turns the receipt bag into prose (no tools). It cannot be an intermediate extraction step or feed a later database step. Classify, then act: ```json [ { "id": "github", "kind": "compare", "left": "{{input.from}}", "op": "contains", "right": "github.com", "onFail": "skip" }, { "id": "classify", "kind": "agent", "prompt": "Classify this email. Subject: {{input.subject}}", "fields": { "type": "security | mention | other", "decision": "act | ignore" } }, { "id": "should_act", "kind": "compare", "left": "{{steps.classify.decision}}", "op": "eq", "right": "act", "onFail": "skip" }, { "id": "label", "kind": "tool", "tool": "