Skip to main content

Workbench quickstart

You'll build a small AI behavior on the canvas, test it, publish it, and call it from your own code. The end state is a real endpoint you can curl — and a flow whose behavior you can keep changing without changing the integration.

  1. Open Workbench

    Go to workbench.zerowidth.ai, sign in, and pick your workspace. You'll land on the flows list.

  2. Create a flow

    Hit New flow and pick the Agent pattern. You get a working chat assistant out of the box: a system prompt feeding a model, with chat coming in and going out. (The other patterns — classifier, structurer, judge, interviewer — are there when you need a different shape; see Flows.)

  3. Give it a behavior

    Write a system prompt — the instructions that define how it responds. Something concrete, e.g.:

    You are a release-notes writer. Given a list of merged changes, write a tight, friendly changelog entry. No marketing language.

  4. Test it on the spot

    Open the test pane and talk to your flow. This is the same execution engine the public API uses, so what you see here is what your code will get. Iterate the prompt until it behaves.

  5. Publish a version

    When it's good, publish a version. A published version is a frozen snapshot — your production integration pins to it, so you can keep editing the draft without anything shipping until you publish again. (Pinning is the difference between a stable integration and one that changes whenever someone tweaks a prompt.)

  6. Mint an API key

    In Accounts → Workspace → API keys, create a key with the workbench:flows:run scope. Copy it when shown — it's the only time you'll see the secret.

  7. Run it from your code

    Open the flow's dev drawer → Quickstart. It shows your Flow ID (a UUID — the public id, not the one in the editor URL) and a ready-made request shaped to this exact flow. Drop in your key and run it:

    export ZW_API_KEY='zw_live_…'
    export ZW_FLOW='your-flow-id'   # the Flow ID from the Quickstart tab
    
    curl -X POST https://api.zerowidth.ai/1.0/flows/$ZW_FLOW/runs \
      -H "Authorization: Bearer $ZW_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{"input":{"kind":"chat","messages":[
            {"role":"user","content":"Merged: dark mode, CSV export, fixed login redirect"}
          ]},"source":{"kind":"published"}}'

    The response carries the flow's outputs, the run's cost, and a duration. That's your flow, live.

What's next

3 min read