DocsWorkflows

Your first workflow

A hands-on tutorial. Read a built-in workflow on the canvas, customize a copy with its own profile and an approval step, then build a checked change from scratch with a verify loop, manual checks and a subflow.

This tutorial takes about half an hour, in three parts that build on each other. You can stop after any of them.

  1. Read a workflow (5 minutes). Open the built-in Plan, build, verify and learn what every card and line on the canvas means.
  2. Customize a copy (10 minutes). Make Research with a risk list: a copy of Research & analyze whose second step has its own read-only profile, with an approval step between the two so you can steer it.
  3. Build one from scratch (15 minutes). Make Checked change: Build, then a Check step that reports every criterion, an acceptance step that sends failures back to Build, and manual checks for you. Then put a subflow in front of it.

You will use four things, each of which has its own page if you want the full detail:

Note

You need a workspace open and a model connected. If you have not done that, start with the Quickstart.

Part 1: Read a workflow on the canvas

  1. Open Behaviors in the left rail. The switch at the top left reads Workflows.
  2. In the list, select Plan, build, verify. It carries a Built-in badge, and the inspector on the right says Built into Rusty · available in every project. Everything is read-only, so click around freely.

The canvas reads left to right: Request → Plan → Plan approval → Build → Verify → Acceptance → Manual checks → Result. Each card is a step, with its kind as a badge and its id below its name:

Badge What the card shows
input Where the run starts: your message, the chat's last result and your attachments.
agent A step that runs a model: its tool setting (inherit means everything the chat has, which the profile then narrows), the start of its instructions, and its profile. Click the profile name, or double-click the card, to open the profile.
approval A point where the run waits for you: which step's result you review, where changes go to, whether the run may auto-approve it, and, for the plan approval, that approval notes revise first.
verify A check that runs no model: how many checks it has, and which step it retries when one fails.
output Which step's result becomes the run's result.

The dotted lines below the cards are the loops:

  • changes from Plan approval back to Plan: your notes revise the plan.
  • retry from Acceptance back to Build: a failed criterion sends the work back.
  • changes from Manual checks back to Build: what you report after trying the result.

Now click a few cards and read the inspector:

  • Build. Its Instructions are long on purpose. They tell the step its place (You are Build, step 3 of 6), what it is given, what to do, and who checks its result. Under Context from earlier steps, the ticked boxes are what Build receives. Attempts is 3: Build can be sent back twice.
  • Acceptance. Checks is [{"type": "criteria", ...}]: it reads the criteria Verify reported, one by one. On failure, retry is Build.
  • Manual checks. Review the result of is Acceptance, and Requested changes go to is Build.

That is the whole mechanism: agent steps do work, verify and approval steps decide whether it moves on or goes back. How workflows work explains each part in depth.

Part 2: Customize a copy

You will make Research with a risk list. It investigates a question like the built-in Research & analyze stage does, but its second step is read-only by construction, always ends with the riskiest places in the code, and only starts once you have approved the research.

Why copy instead of starting blank

The 15 built-in workflows are read-only, and they are carefully tuned: every step is told its place in the workflow, they pass written handoffs between steps, and they retry after errors. Starting from a copy keeps all of that and lets you change only what you care about. Everything in the editor works the same on a copy as on a workflow you wrote yourself.

1. Make a profile for the second step

A profile sets a step's instructions, tools, limits and checks. You will write one that can read the code but never change it.

  1. Open Behaviors in the left rail.

  2. Click Profiles in the switch at the top left.

  3. Click New profile, type the id risk-analyst and press Enter. Ids use lowercase letters, digits, dots, dashes and underscores. The editor saves it as .rusty/profiles/risk-analyst.json and selects it.

  4. In the inspector on the right, under Profile, set Status to Published. A new profile starts as a draft.

  5. Under Instructions, leave Mode on Append to the system prompt and write in Text:

    Trace how the code behind the question works. Finish with a section called
    "Riskiest places": the three files or functions most likely to break if
    this area changes, each with the file path and one sentence on why.
  6. Under Tools, set Available tools to Only these tools and tick Read Files, List Files, Search Codebase, Project Info and Read Workflow Context. Leave everything that writes or runs commands unticked, so the step cannot change anything. (Searching for a tool by name is quicker than scrolling: use the Search tools box.)

  7. Under Model and limits, set Max turns to 40 so the step cannot loop forever.

Leave Rules and Completion gate empty for now. They are covered in Going further.

Tip

The checkboxes decide what the step is offered. The session's own permissions still apply on top, so a step can only ever use tools that both the profile allows and the session enables. See Permissions & safety.

2. Copy a built-in workflow

  1. Click Workflows in the switch at the top left.
  2. In the list, select Research & analyze. It carries a Built-in badge, and the inspector says Built into Rusty · available in every project.
  3. Click New workflow, or Customize a copy at the top of the inspector. Both open the same dialog.
  4. Type the id risk-research and click Create.

You now have an independent, editable copy, saved as .rusty/workflows/risk-research.json once you save. It starts as a copy of whichever built-in workflow was selected, with its revision reset to 1 and its name set to the id.

Note

New workflow copies the built-in that is selected. With one of your own workflows selected instead, it starts from a small blank flow. Part 3 uses that.

3. Make it yours

The canvas shows the copy: Request → Research → Analyze → Result.

Name it. Click an empty part of the canvas so nothing is selected. The inspector shows the workflow itself. Set Name to Research with a risk list and Description to one sentence, such as Investigate a question, then list the riskiest places in the code. The description is what you read when you hover the workflow in the Mode menu. Bump Revision whenever you change a workflow you have already used, so you can tell versions apart.

Give Analyze the profile.

  1. Click the Analyze step.
  2. Under Behavior, open the Profile menu and choose risk-analyst.

The step keeps its instructions and its inputs; only what it is allowed to do changes. It can no longer write files or run commands, whatever its instructions say.

Look at what the step receives. Still on Analyze, scroll to the Step section. Under Context from earlier steps, Original request and Research are ticked: Analyze receives your request (and the chat's last result) plus Research's final message. Response format is Text / Markdown, so Research's message arrives as written. Leave Tools on Everything the session has: the profile already narrows them.

4. Add an approval step

Research runs first and Analyze builds on it. If Research goes the wrong way, Analyze goes with it. An approval step between them lets you read the research and correct it before Analyze starts.

  1. Click Approval above the canvas. A step named Approval (id approval) appears. Drag it between Research and Analyze.
  2. Click the arrow from Research to Analyze and choose Delete edge. Deleting it also takes Research's result away from Analyze; you will give it back in step 5.
  3. Drag from Research's right handle to Approval, then from Approval's right handle to Analyze. Connecting Approval to Analyze also hands Analyze the approval's result: your decision and any notes you wrote.
  4. Select Approval and set:
    • Name: Approve the research.
    • Review the result of: Research.
    • Question: Read the research. Approve it to go on to Analyze, or ask for changes.
    • Leave Requested changes go to on The step being reviewed, so changes go back to Research.
  5. Select Analyze and, under Context from earlier steps, tick Research again.

A dotted changes line now runs from Approve the research back to Research.

5. Save and check

The button at the top right reads Save 2: two files changed, the profile and the workflow. Press ⌘ S or click it. The button goes back to Saved.

The editor validates everything as you type. A red dot beside a file in the list means it has a problem, and the inspector lists it. A file with a blocking problem still saves, but an invalid profile is skipped when sessions load, so fix a red dot before you rely on the file.

6. Run it

  1. Click Run in Agent Mode. It saves anything unsaved, selects the workflow in Agent Mode and opens the chat. If the workflow has a blocking problem, it tells you instead of running.
  2. In the workflow bar, the Mode menu now reads Stage: Research with a risk list. It is labelled Stage because the copy kept the built-in's metadata. Workflows you make from scratch are labelled Workflow:.
  3. Ask a real question about your project, such as How does the settings store save its data?, and press Enter.

The bar lists the steps and where the run is, for example Running step 2 of 5: Research. When Research finishes, the bar shows the approval step waiting for your answer, and a card opens above the message box: Approve the research needs your answer, with your question and Research's findings.

Try both ways through it:

  • Write a correction in Notes, such as Also look at how the store migrates old settings, and choose Request changes. Research runs again with your notes and its previous findings, and the card comes back with the revised research.
  • Choose Approve. Analyze starts, with the research and your approval.

When it finishes, read the last message: Analyze's handoff, ending with Riskiest places. Because no step can change files, Rusty also saves it as a Markdown file under .rusty/findings/ and says where.

Back in the Behaviors tab, the canvas carries a badge such as Last run completed, and each step shows its own state.

If something went wrong, the bar says which step failed and your next message resumes there. Steps that finished are kept. See Run a workflow.

Part 3: Build a checked change from scratch

You will make Checked change: a workflow that builds a change, has an independent step check every requirement, sends failures back to the builder automatically, and gives you the checks only a person can do. It is a small version of the built-in pipelines, and by the end it uses every kind of step.

Input → Build → Check → Acceptance → Manual checks → Output
          ↑                  │             │
          ├─ retry ──────────┘             │
          └─ changes ──────────────────────┘

1. Start from the blank flow

  1. In the list, select Research with a risk list (one of your own) and click New workflow.
  2. Type the id checked-change and click Create.

With one of your own workflows selected, New workflow starts from a small blank flow: Input → Execute → Verify → Output. Execute and Verify are both agent steps here, with short placeholder instructions. Click the empty canvas and set Name to Checked change.

2. The Build step

Select Execute (id execute) and set:

  • Name: Build.

  • Profile: rusty-ide.builtin.build. Built-in profiles are listed under their full ids. Build can change files, must run the project's checks after its last edit, and reports what it did.

  • Instructions:

    Implement the request in the workspace. Read the code before changing it,
    add or update tests, and run the project's checks. Finish with a report:
    what you changed and where, the checks you ran and their results, and
    anything left for me.
  • Attempts: 3, so the work can come back to Build twice.

Under Context from earlier steps, Input is already ticked: Build receives your request.

3. The Check step

Select Verify (id verify; it is an agent step, despite the name) and set:

  • Name: Check.

  • Profile: rusty-ide.builtin.verify. It can read files and run checks, but never edit.

  • Under Context from earlier steps, tick Input as well, so Check sees the request and not only Build's report. Do this before the next setting: the checkboxes are only shown for Text / Markdown steps.

  • Instructions:

    Check the change against the request in the real workspace. Read the
    changed code and run the project's checks. Report every requirement of
    the request, and every problem you find, as a criterion: pass when it is
    done properly, fail followed by what is wrong and where, manual only for
    what needs a person (then give the exact steps in how_to_test). Do not
    edit files.
  • Response format: JSON with host validation. The acceptance step needs Check's criteria as data it can read one by one.

Then open Advanced data mapping and replace Output schema with the shape of a report. This is the same shape the built-in Verify steps use:

{
  "type": "inline", "name": "check",
  "schema": {
    "type": "object", "additionalProperties": false, "required": ["criteria", "summary"],
    "properties": {
      "criteria": {
        "type": "array",
        "items": {
          "type": "object", "additionalProperties": false,
          "required": ["id", "status", "evidence", "how_to_test"],
          "properties": {
            "id": { "type": "string", "minLength": 1 },
            "status": { "type": "string", "enum": ["pass", "fail", "manual"] },
            "evidence": { "type": "string", "minLength": 1 },
            "how_to_test": { "type": "string" }
          }
        }
      },
      "summary": { "type": "string", "minLength": 1 }
    }
  }
}

The model does not have to write JSON: it is asked for a Markdown section per field, and Rusty reads its reply into this shape.

4. The Acceptance step

  1. Click Verify above the canvas. This adds a real verify step, which runs no model. Its id is verify_2, because verify is taken.

  2. Set Name to Acceptance.

  3. Replace Checks with:

    [{ "type": "criteria", "pointer": "/check/criteria" }]
  4. Set On failure, retry to Build.

  5. Open Advanced data mapping and set Input bindings to:

    [{ "target": "check", "source": { "type": "node_output", "node_id": "verify", "pointer": "" } }]

    This hands Check's report to Acceptance under the name check, which is why the check's pointer starts with /check.

  6. Rewire: delete the edge from Check to Output, then connect Check to Acceptance.

The editor now lists a few problems. Two go away in step 5, once Acceptance leads somewhere and Output can be reached again. One needs fixing now: retry target execute must list verification_failed in retry_on. A step may only be sent back for a failed check when its own retry settings accept that reason. Click Edit as JSON at the top of the inspector, find the step with "id": "execute", and change its retry to:

"retry": { "max_attempts": 3, "retry_on": ["verification_failed"] }

Click Show form to go back. That problem is gone, and a dotted retry line runs from Acceptance back to Build.

5. The Manual checks step

  1. Click Approval above the canvas (id approval).
  2. Connect Acceptance to it, and it to Output.
  3. Select it and set:
    • Name: Manual checks.
    • Review the result of: Acceptance.
    • Question: Verification passed. Try the manual checks listed below, then Approve, or describe what does not work and choose Request changes.
    • Requested changes go to: Build.
    • Skip when empty at: /manual_checks. Acceptance collects the criteria Check marked manual there; when there are none, you are not asked at all.

6. The Output step

Select Output. Show the final message from is already Check, so the result is every criterion with its status and evidence, then the summary. To show only the summary, open Advanced source mapping and change "pointer": "" to "pointer": "/summary".

7. Save and run

Press ⌘ S. If a step still shows a red mark, hover it or select the step to read the problem. Then click Run in Agent Mode; the Mode menu reads Workflow: Checked change. Ask for a small, real change, such as Add a --version flag to the CLI.

What you will see:

  1. Build changes the code and runs the checks. Rusty asks before each command; allow the ones you recognize.
  2. Check reads the change, runs the checks, and reports each requirement as pass, fail or manual.
  3. Acceptance passes when nothing failed. If something did, the chat says Acceptance sent the work back; running Build again (attempt 2), and Build receives each failed criterion with its evidence as its repair list. After three Build attempts the run fails at Acceptance.
  4. Manual checks opens a card only when Check left something for a person. Request changes sends your description back to Build, and the whole loop runs again.
  5. The result is Check's report.

If you get lost, click Edit as JSON and compare with the complete file:

{
  "schema_version": 1,
  "id": "checked-change",
  "revision": 1,
  "name": "Checked change",
  "status": "draft",
  "nodes": [
    { "id": "input", "name": "Input", "type": "input", "config": { "defaults": {} } },
    {
      "id": "execute", "name": "Build", "type": "agent",
      "config": {
        "instructions": "Implement the request in the workspace. ...",
        "profile": { "id": "rusty-ide.builtin.build" },
        "tools": { "type": "inherit" },
        "context_mode": "isolated_child",
        "structured_output": "text"
      },
      "input_bindings": [
        { "target": "request", "source": { "type": "node_output", "node_id": "input", "pointer": "/request" } }
      ],
      "output_schema": { "type": "inline", "name": "written_handoff", "schema": { "type": "string" } },
      "retry": { "max_attempts": 3, "retry_on": ["verification_failed"] }
    },
    {
      "id": "verify", "name": "Check", "type": "agent",
      "config": {
        "instructions": "Check the change against the request in the real workspace. ...",
        "profile": { "id": "rusty-ide.builtin.verify" },
        "tools": { "type": "inherit" },
        "context_mode": "isolated_child",
        "structured_output": "host_validated"
      },
      "input_bindings": [
        { "target": "report", "source": { "type": "node_output", "node_id": "execute", "pointer": "" } },
        { "target": "input", "source": { "type": "node_output", "node_id": "input", "pointer": "" } }
      ],
      "output_schema": { "type": "inline", "name": "check", "schema": { "...": "the schema from step 3" } }
    },
    {
      "id": "verify_2", "name": "Acceptance", "type": "verify",
      "config": { "checks": [{ "type": "criteria", "pointer": "/check/criteria" }], "retry_target": "execute" },
      "input_bindings": [
        { "target": "check", "source": { "type": "node_output", "node_id": "verify", "pointer": "" } }
      ]
    },
    {
      "id": "approval", "name": "Manual checks", "type": "approval",
      "config": {
        "subject": { "type": "node_output", "node_id": "verify_2", "pointer": "" },
        "prompt": "Verification passed. Try the manual checks listed below, ...",
        "revise_target": "execute",
        "skip_if_empty": "/manual_checks",
        "max_revisions": 5,
        "allow_auto_approve": true
      }
    },
    {
      "id": "output", "name": "Output", "type": "output",
      "config": { "source": { "type": "node_output", "node_id": "verify", "pointer": "" }, "strict": false }
    }
  ],
  "edges": [
    { "id": "input-execute", "source": "input", "target": "execute", "condition": "on_success" },
    { "id": "execute-verify", "source": "execute", "target": "verify", "condition": "on_success" },
    { "id": "verify_to_verify_2", "source": "verify", "target": "verify_2", "condition": "on_success" },
    { "id": "verify_2_to_approval", "source": "verify_2", "target": "approval", "condition": "on_success" },
    { "id": "approval_to_output", "source": "approval", "target": "output", "condition": "on_success" }
  ]
}

The ... parts are shortened here; your file has the full texts and schema. The editor also stores each card's position under metadata.editor.position, which the engine ignores.

8. Investigate first, with a subflow

A subflow runs a whole workflow as one step. Put the built-in Research & analyze in front of Build, so Build starts from an investigation instead of from nothing.

  1. Click Subflow above the canvas (id subflow) and set Name to Investigate.

  2. Set Run to A saved workflow and Workflow to rusty-ide.builtin.investigate. Every built-in workflow is listed under its full id, next to your own.

  3. Open Advanced data mapping and set Input bindings to:

    [
      { "target": "request", "source": { "type": "run_input", "pointer": "/request" } },
      { "target": "context", "source": { "type": "run_input", "pointer": "/context" } }
    ]

    What is bound to a subflow step is the child run's whole input, and the built-in workflows read both request and context.

  4. Rewire: delete the edge from Input to Build, then connect Input to Investigate and Investigate to Build. Connecting it to Build hands Build the investigation.

Save and run it again. Investigate runs Research & analyze as one step, then Build starts with its findings. Permission prompts and approvals from inside the subflow appear in your chat as usual.

Going further

Add a rule

Rules react to events during a step. Open risk-analyst in the Profiles view and, under Rules, pick an event and an action beside Add rule, then click it. For example, to remind the agent of something when the step starts:

Event Action Then set
RunStart inject Inject text: Cite the file path for every claim you make.

The text is added to the model's context when the rule fires. The same mechanism can refuse a tool call (deny), ask you first (ask), or stop the run (stop_run). The full list of events, actions and conditions is in The workflow editor.

Add a completion check

A completion gate stops an agent from finishing too early. Under Completion gate, click Add completion check. The new check uses the method Check tool activity and, by default, requires at least one Run Commands call. That is wrong for a read-only step, so change it: under the check's condition (Tool call count), untick Run Commands and tick Read Files and Search Codebase, with At least set to 1. Then write the Feedback when this check fails, which is what the agent receives when it tries to finish without looking at the code: Read the relevant files before answering. If checks still fail decides what happens after the allowed Additional attempts: Fail the run is strict, Finish with checks not passed lets the step through anyway.

Make Rusty choose it

A workflow written with a route.when sentence in its metadata is a candidate for Auto: Rusty reads the sentence and picks it when a request fits. The copy you made inherited one from Research & analyze, so Auto may already pick your copy for the same kind of question. To change that, open the JSON view (the file icon at the top of the inspector, Edit as JSON) and edit metadata.route.when or delete metadata.route. See Choosing and switching flows.

Let an agent write it

You can also describe a workflow in words and let an agent build it. In a Single agent chat, choose the workflow-author skill and describe what you want, for example a workflow that fixes lint errors one file at a time and asks me before touching tests. It reads your existing workflows and profiles, asks only about what is still unclear, and saves a complete, validated workflow. It does not run it: select it in the Mode menu and run it yourself. See Workflow Author skill.

Where to next

  • What each kind of step does, how work is sent back, and every limit: How workflows work.
  • Every control in the Behaviors tab and in the Agent Mode bar: The workflow editor.
  • What the built-in workflows do and which profile each step uses: Built-in workflows.
  • The JSON behind it, for editing files directly: Profiles & workflows.
  • Commit .rusty/profiles/ and .rusty/workflows/ to share what you built with your team.
Esc

Type to search the docs.