Build your first workflow

In this tutorial you build a five-step workflow that drafts a short research note, asks you to approve it, and then saves it. You publish it and run it with Start work. It takes about fifteen minutes.

Before you start, read What a workflow is. You also need:

  • a project to run the workflow in;
  • a working model provider for your tenant (see Before you start).

In production today. Your workflow runs as one mission. When its last step finishes, the mission waits for you to review the result. You do not get a proposed run to accept: that step is not available in production yet. See What is available where.

What you'll build

Five steps in one line:

  1. Trigger: the start of the workflow. Every new workflow already has one.
  2. Research (LLM): one model turn that writes a short note about your question.
  3. Approval Gate: the run waits here until you approve.
  4. workspace:create: creates a workspace for this run.
  5. workspace:write file: saves the note in that workspace.

One rule decides where the gate goes: every step that writes must come after an approval gate. Both workspace steps write. Creating a workspace counts as a write too. So both workspace steps sit after the gate. The LLM step only reads, so it can come before the gate. If a writing step has no gate before it, the workflow does not publish.

Create a draft

  1. In the sidebar, open Workflows.
  2. Click New Workflow, type a name in Workflow name (for example my-first-workflow), then click Create.
  3. The editor opens on version 1, a draft. The canvas already holds one Trigger. The Trigger tile in the palette is greyed out, because a workflow has at most one trigger.

A draft is the only version you can edit, and a draft cannot run. Click Save Draft at any time to keep your work.

Add the steps

Use the Palette on the left. You can click a tile to add it, or drag it onto the canvas. The Search step types… box finds a tile by name.

  1. The LLM step. Under Shortcuts, check that the switch under Research is set to LLM, not Coder. Then click Research. The new step comes pre-filled:
    • Call site: Research:Llm. Keep it.
    • Template version: 1. Keep it. The hint says the field is optional, but an LLM step without a template version does not publish.
    • Preset: leave None (site default). The step then uses the model set for that call site.
  2. The gate. Under Structural, click Approval Gate. In Properties, set Label to Review the note and Instructions to Read the note. Approve to save it. The label and the instructions are what you see when the run asks you to decide.
  3. The workspace. Under Workspace, click workspace:create. You can leave its inputs empty.
  4. The save. Under Workspace, click workspace:write file. In Properties, under Inputs, give path a Literal value, for example notes/first-note.md.

Do not use the Coder setting of the Research tile for this tutorial. It adds a coder step, which counts as a write and would need its own gate before it.

Wire the steps

Drag from a pin on one step to a pin on another to connect them.

Execution order. Connect each step's execution output to the next step's execution input:

Trigger → LLM step → gate → workspace:create → workspace:write file.

Data. Add two more connections:

  • the workspace output of workspace:create to the workspace input of workspace:write file;
  • the summary output of the LLM step to the content input of workspace:write file.

Use summary, not result. result is a JSON object, and content takes plain text. The editor and the publish check refuse a JSON output on a text input.

Your question. The LLM step needs to know what to research. Select it, and in Properties, under Inputs, switch input to Parameter. The editor creates a required workflow input for it. Start work will ask you for its value each time you run the workflow. To rename it, click an empty part of the canvas and edit the name under Workflow inputs (params), for example question.

Publish

Click Publish. Publishing saves the draft, then checks the whole graph.

If something is wrong, the publish is refused. You see "Publish failed — see the problems list." and the Problems tab opens. It lists every problem at once. Click a line to jump to the step concerned. Fix the list from top to bottom, then click Publish again.

Common problems in a first workflow:

The problem saysWhat to do
writes are not protected — no approval gate precedes itMove the gate so that it comes before workspace:create in the execution order.
required input pin … is not connected or literal-boundWire that input, or give it a Literal value (for example path).
kind mismatch: Json cannot feed StringYou wired result to content. Wire summary instead.
llm step requires a 'siteId' literalSet Call site to Research:Llm on the LLM step.
llm step pins no 'templateVersion' literalSet Template version to 1 on the LLM step.

When the publish goes through, you see "Workflow published.". The version shows Read-only and the palette disappears. Version 1 is now frozen: every run of version 1 runs exactly this graph.

To change the workflow later, open it and click New Version. This opens an editable draft of version 2, a copy of version 1. Publish it when it is ready. Runs of version 1 keep running version 1. See the workflow lifecycle.

Run it with Start work

Click Start work in the editor toolbar. You can also click Start work on the workflow's row in the Workflows list. The Start work dialog opens:

  • Project: choose the project to run in. It is required.
  • Recipe: your workflow is already selected.
  • Objective: say in one line what you want. The first line becomes the mission title.
  • Provider and Model: you must choose both to start. They set the model of coder steps that have no preset of their own. Your LLM step keeps the model of its call site. If the dialog says no provider and model are known for this tenant, add a provider key in the LLM configuration first.
  • Parameters: type your question in the field of the input you created. For example: What are the trade-offs between SQLite and PostgreSQL for a small internal tool?
  • You will be asked to: lists your gate (Review the note) and Review the result.

The footer reads "Creates 1 mission in … and runs '…' v1.". Click Start work. The mission page opens. For more on this dialog, see Starting work.

Approve at the gate

The decision for your gate appears in your Inbox as soon as the run starts. Its title is the gate's label followed by the step's id. You may approve it early: the steps after the gate still wait until the steps before it have finished.

To decide from the editor:

  1. Open your workflow and open the Pending gates tab at the bottom.
  2. Click Resolve on your gate.
  3. Under Choose a decision, pick approve, then click Confirm.

You can also decide from the Inbox; see the Decisions page. With skip or fail, the steps after the gate do not run. No timer approves a gate for you. If you set a timeout on it, the gate is skipped or failed when the time runs out (see gates).

What you get

To follow the run, open your workflow and the Runs tab at the bottom. Select the run: the canvas shows the state of each step. While the gate waits, the run shows Awaiting approval. Select a step to read its result:

  • the LLM step shows the note: a short Markdown report with a summary, the key findings, and caveats or open questions;
  • workspace:write file confirms the save.

The note is saved in a workspace created for this run. Nothing goes to your repository: this workflow creates no branch and no merge request.

In production, the steps end there, and the mission then waits for you to review the result on the mission page. There is no proposed run to accept and no Accept run button: this is not available in production yet. On staging, the same run may end as a proposal that you accept on the mission page; Runs, acceptance & changements describes that step.

Where next