# Build your own

At the end, you have drawn a workflow, told each step what to do in your own words, walked every route without spending anything, saved it as yours and run it.

## At a glance

**Time:** 20 minutes.

**You need:**

- Loopgate open: [On your laptop](laptop.md)
- A command your repository declares in `.loopgate/repo.yaml`, such as `verify`, if you add a check

## Steps

1. **On Workflows, press New workflow.**

   You should see: the builder. The palette on the left lists the blocks by who acts: **Work** (Agent, Check), **You** (Choice, Approve, Lock, Notify), **Flow** (Join, Fan out, Subworkflow) and **End** (Pull request, Finish), then the agents.

2. **Drop an Agent, a Check and a Finish, and draw a route from each to the next.** Name the check's **Repository command**, such as `verify`.

   You should see: the track, and **Issues** under the canvas counting what is left to fix.

3. **Select the agent and write two lines of Instructions.** Pick a persona, then press **Preview**.

   You should see: the whole message the step will be sent, each part tagged by who wrote it.

4. **Draw a route from the check back to the agent.** In its form, turn on **Loop back**, set **Rounds at most** to 3, and **When the rounds run out, go to** Finish.

   You should see: a dashed route from the check to Finish, labelled `after 3 rounds`.

5. **Choose Simulate under the canvas.**

   You should see: every route walked on the fake harness, the exhausted loop included. No run is created and nothing is spent.

6. **Press Publish, then Run.**

   You should see: the workflow under **Yours** on Workflows, and Tasks with it picked under **Who**, waiting for a task.

## Good to know

- Every route is a verdict the step ends with, the check's pass or fail, or a person's choice. A step's verdicts come from the routes drawn out of it, such as `approve` and `changes_requested`.
- Every loop has a bound: its rounds, and the step it goes to when they run out.
- Choice, Approve and Lock wait for you. A Lock holds a step's document for you to edit and lock before the next step reads it.
- Branches that write get their own worktrees and merge before the step they meet at. A Fan out runs its step once per work item.
- Say what you want in the copilot bar at the foot of the canvas (⌘J). A reply that carries a workflow lands on the canvas as one undo step. It never publishes, never starts and never grants Full access.
- A built-in is read-only: **Make a copy to edit** first. Each published version is kept, and a run records the version it used.

## If something is off

- **Run is grey in the builder.** The workflow still has issues. Open **Issues** under the canvas; each one names its step.
- **Tasks names a command the workspace has not declared.** Press **Initialize workspace**: it saves the checks it detects in `.loopgate/` and runs nothing.

## Next

- [A model per step](models.md)
- [Steer a run](steer.md)
