{"id":116136,"plugin_id":"plugin_asdk_app_6ae37a13301c81919b3c62b884f60c6b","kind":"skill","collection_source":"plugin_package","comparison_source":null,"observed_at":"2026-11-25T18:15:59.723Z","digest":"9ba67ab76881cb97a04cca1d4677fe23017872d9123f889f4074be76d90a0034","against":null,"payload":{"description":"Use when a task involves creating or editing a Scenario workflow graph through MCP: building an app from a brief, adding or rewiring nodes (models, prompts, approval gates, loops), authoring editor_info, publishing, unpublishing or renaming, importing an exported workflow JSON, migrating a graph built in Weavy, ComfyUI, or another node tool, copying a workflow, or turning a prompt chain into an app. Running or pricing a workflow is scenario-workflows. Keywords: node graph, editor_info, CEL.","included_files":[{"relative_path":"references/editor-info.md","size_in_bytes":21372},{"relative_path":"references/foreign-graph-import.md","size_in_bytes":11032},{"relative_path":"scripts/fetch_workflow_examples.py","size_in_bytes":8203}],"name":"scenario-workflow-authoring","skill_md_contents":"---\nname: scenario-workflow-authoring\ndescription: \"Use when a task involves creating or editing a Scenario workflow graph through MCP: building an app from a brief, adding or rewiring nodes (models, prompts, approval gates, loops), authoring editor_info, publishing, unpublishing or renaming, importing an exported workflow JSON, migrating a graph built in Weavy, ComfyUI, or another node tool, copying a workflow, or turning a prompt chain into an app. Running or pricing a workflow is scenario-workflows. Keywords: node graph, editor_info, CEL.\"\nlicense: MIT\n---\n\n# Scenario Workflow Authoring\n\n## Overview\n\nA workflow has two representations: `editor_info` (the editable node graph: `nodes`, `edges`,\n`inputKeys`) and `flow` (the compiled runnable form). Authoring through MCP means writing the whole\n`editor_info` document: there are no per-node editing tools; every change is a read, modify, write\nof the full graph through `workflow_create` or `workflow_update`. Never hand-write `flow`:\n`workflow_publish` compiles `editor_info` into it and flips status to `ready`. Editing a ready\nworkflow's `editor_info` leaves the stale `flow` running until you publish again.\n\nRead [references/editor-info.md](references/editor-info.md) before writing any graph: it holds the\nnode type vocabulary, the node choice doctrine (when an `llm` node is legitimate), the edge\ndirection rule, per-node data contracts, and a validated minimal example. Create, update, publish,\ncopy and delete live in the tool catalog (`scenario_tools_search` plus the matching executor, see\nthe `scenario` skill). `workflows_list`, `workflow_get` and `workflow_run` are direct tools: scope\nand `dry_run` go in their top-level arguments, never an executor wrapper. Running and pricing: the\n`scenario-workflows` skill. If a sibling skill named here is missing from your available skills,\nload it with `skill_get` (Scenario MCP) or ask the user to install it\n(https://github.com/scenario-labs/skills#install); unattended, proceed from tool schemas and flag\nthe gap.\n\n## Quick reference\n\n| Step              | Call                                 | Notes                                    |\n| ----------------- | ------------------------------------ | ---------------------------------------- |\n| 1. Study a graph  | `workflow_get` on a working workflow | Copy the shape, never ids                |\n| 2. Model contract | `model_schema_get`                   | Handle names and required inputs         |\n| 3. Author         | `editor_info` + `inputs_definition`  | Per the reference file                   |\n| 4. Create         | `workflow_create`                    | Non-atomic, see below                    |\n| 5. Publish        | `workflow_publish`                   | Compiles `flow`; one output pin required |\n| 6. Validate       | `workflow_run` with `dry_run=true`   | Prices and runs the real validator       |\n\n`workflow_create` is two calls under the hood: a failed create may still have created a draft whose\nid is in the error. Recover with `workflow_update` on that id; re-creating duplicates. Seed step 1\nwith `workflow_get`: it returns the full graph of any workflow whose id you have, public ones\nincluded (an id or app URL the user supplies, or your own team's from `workflows_list`). To find a\npublic template, use `search` with `target=\"workflows\"`, `public=true`, a keyword `query`,\n`limit=3`, and your scope; for example, `query=\"image\"` with raw `filter: 'status = \"ready\"'`. Read\nids from `workflows`, then fetch the chosen graph with `workflow_get`; search hits are summaries,\nnot graph documents. Workflow search supports keyword text and filters only, so omit image and\nsemantic options. Use `workflows_list` for browsing your saved workflows.\n[scripts/fetch_workflow_examples.py](scripts/fetch_workflow_examples.py) bulk-exports trimmed\nfeatured-workflow graphs for maintainers (setup in its header).\n\n## Worked example: a text-to-image app\n\n1. `recommend` with `capability: \"txt2img\"` and the user's brief as `prompt`, following the\n   `scenario` skill's `next_step` discipline, then `model_schema_get`: its input names become the\n   model node's handle names, and its `required` flag marks what must be wired. Use `search` instead\n   when the user names a model.\n2. Author `editor_info`: `text1` with `data.isInput: true`, `model1` with `type: \"model\"`,\n   `data.modelId` and `data.isOutput: true`, one edge from `model1`'s input to `text1`'s output\n   (edges name the downstream node as `source`, see the reference), `inputKeys: [\"text1\"]`.\n3. `workflow_create` with `name`, `editor_info`, and `inputs_definition` naming `text1` as a string\n   input. The published input key is the node id, which is why run inputs have names like `text1`.\n4. `workflow_publish`, then `workflow_run` with `dry_run=true` to validate and price. Fix the graph\n   and re-publish if validation fails.\n\n## One output per item needs a loop\n\nA multiple-asset input wired straight into a generative model's reference field is one generation\nconditioned on every item at once: ten product shots in come back as one image blending them, not\nten edits. Field names and cardinality are per model, so read them off `model_schema_get`\n(`array: true` marks a list), and read the field's description as well: a few utility tools take a\nlist and return one output per item, which needs no loop. When each item needs its own result, put\nthe model inside a `forEach` over the list and read the outputs from the `forEachEnd` (wiring in the\nreference's forEach section); keep the direct wiring only when the items are meant as joint\nreferences for a single output. Inside the loop the current item feeds an array field as a one-item\nlist. `forEach` runs one billed model job per item, but the dry run prices one iteration whatever\nthe list length (observed: one quote for one or two items, twice that billed for two), so multiply\nthe quote by the item count before quoting the user.\n\n## Migrating a graph from another node tool\n\nA pipeline exported by Weavy, ComfyUI, or another node editor does not import: only Scenario's own\nexport round-trips. It is translated node by node, then created, published, and dry-run as above.\nThe mapping table, member resolution, and the report the user gets are in\n[references/foreign-graph-import.md](references/foreign-graph-import.md); read it before touching\nsuch an export, since its first rule is to reduce the file to a table locally rather than paste it\ninto the conversation.\n\n## Common mistakes\n\n- Writing UI palette names as node types: persisted types are the camelCase vocabulary in the\n  reference, and every generator is `type: \"model\"`.\n- Wiring edges producer to consumer: persisted edges point the other way.\n- Expecting an `editor_info` update to change a live app without re-publishing.\n- Retrying a failed `workflow_create` with a second create instead of `workflow_update` on the id\n  from the error.\n- Wiring a batch of assets into one model input and expecting one output per item: that is one\n  generation over all of them; loop with `forEach`.\n- Publishing with no output pin, or with `data.isOutput` on a text or asset node: publish fails with\n  `compiled to an empty flow`. The output pin goes on the `model`, `llm`, or `forEachEnd` node that\n  produces the deliverable. Input pins are optional: a graph with its prompt built in publishes and\n  runs with no inputs.\n- Gating a text node in front of a builder or model: a branch skips only the node wired to its\n  handle, so the consumer stays pending and the job never completes. Gate the node that does the\n  work, or use a CEL ternary for conditional prompt text, per the reference's `ifElse` section.\n- Double-quoted CEL literals: they evaluate but corrupt the canvas editor, single quotes only.\n- Sending `workflow_id` to `workflow_copy`: get, update, publish, run and delete take `workflow_id`,\n  but copy takes `source_workflow_id`; the copy inherits everything verbatim and needs its own\n  publish.\n"},"changes":[],"summary":"First saved snapshot. No earlier version is available for comparison.","summary_kind":"deterministic","summary_metadata":{}}