> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blobhub.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Iterate on a workflow with a coding agent

> Copy Service Desk Agent from the public gallery into your organization, then change it with a coding agent: modify, push, play and pull.

You will copy Service Desk Agent, a workflow from the public gallery, into your organization, keep it in git, and
change it in three rounds, two with a coding agent and one in the website's visual editor. You finish with a working
copy of a gallery workflow in your organization, a git history of the changes you made to it, and the habit of the
loop.

## The loop

```mermaid theme={null}
flowchart LR
  gallery["workflow-gallery<br/>service-desk-agent"]
  local["your checkout<br/>blob.yaml and definitions<br/>in git"]
  yours["your organization<br/>service-desk-agent"]
  agent["coding agent<br/>reads docs.blobhub.io"]
  play(["play in the<br/>playground"])

  gallery -->|"1. pull, once"| local
  agent -->|"2. modify"| local
  local -->|"3. push"| yours
  yours -->|"4. play"| play
  play -.->|"next round"| agent
  yours -->|"5. pull"| local
```

Step 1 happens once, and steps 2 to 5 repeat, once per round. Step 5 matters because the website edits too: `pull`
brings a change made in the visual editor back to git.

## Before you start

Do the introduction's [Set up once](https://docs.blobhub.io/tutorials/introduction.md#set-up-once) first. It gives you:

* an organization of your own;
* the CLI, 0.14.0 or later;
* an org-scoped key with the `admin` role, stored with `blobhub login`;
* `ORG` set to your organization's alias in this terminal, with `export ORG=<your-org>`;
* a coding agent that reads these docs.

This tutorial adds one thing. Service Desk Agent runs Claude models through a credential it looks up by the alias
`anthropic`. Under **Credentials** in your organization's settings
(`https://blobhub.io/<your-org>/settings/credentials`), add a credential of type **API key** whose alias is exactly
`anthropic`, holding your own Anthropic key. Every run of the copied flow then uses it, a play in the playground and a
run from the CLI alike ([How a run uses one](https://docs.blobhub.io/general/credentials.md#how-a-run-uses-one)). Without the credential, a run
fails.

![The organization's Credentials page, listing the anthropic credential, type api\_key](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/credentials.png?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=d3120ac694011ceba97e5a794d526309)

Your organization's Credentials page, listing anthropic, type api\_key.

The pictures were taken in `halden-systems`, the organization of a fictional company, so they show
`--org halden-systems` where your terminal shows your organization, and the checkout as `~/service-desk-agent`.

## Copy it, then iterate

**1. Find the flow**

Open the gallery's
[Service Desk Agent playground](https://blobhub.io/workflow-gallery/service-desk-agent/playgrounds/default/showcase-vpn-berlin)
on its showcase session, `showcase-vpn-berlin`. Requests is on the left, Escalations and Tickets on the right.
Each post in Requests runs the `desk-agent` workflow, which plans across five tools over a planted directory,
status page, knowledge base and open tickets.

![The default playground of workflow-gallery/service-desk-agent: Requests on the left, Escalations and Tickets on the right](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/gallery-playground.png?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=7b46334af6beb1374f3f2c67cef5d6a4)

Service Desk Agent in the public gallery, on its showcase session.

**2. Pull it**

```bash theme={null}
mkdir service-desk-agent && cd service-desk-agent
blobhub --org workflow-gallery workflow pull service-desk-agent -f blob.yaml
```

![Terminal: the gallery pull writing blob.yaml and pulling workflow/desk-agent and playground/default into definitions/](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/pull.svg?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=d44846a51ba3ffabafdc2f1de132d0de)

pull writes blob.yaml, then every definition it lists.

`pull` with a blob and no `blob.yaml` writes the manifest first, then every definition it lists
([`blobhub workflow pull`](https://docs.blobhub.io/cli/workflow/commands/pull#a-first-pull-writes-the-manifest)); your key reads the
gallery's public workflow ([API keys](https://docs.blobhub.io/general/organizations-and-access.md#api-keys)). Look at what it wrote:

```bash theme={null}
tree
```

Where `tree` is not installed, `find . -type f` shows the same.

![Terminal: tree listing blob.yaml and the two definition files under definitions/](https://mintcdn.com/blobhub/DkrJUero1OCWWBPS/tutorials/images/iterate-with-a-coding-agent/tree.svg?fit=max\&auto=format\&n=DkrJUero1OCWWBPS\&q=85\&s=65c28a0031fbb20c544916b439d275ab)

The checkout: one manifest and one file per definition.

The manifest names the blob, its revision and one file per definition:

```yaml blob.yaml theme={null}
type: blob
version: '1.0'
blob_type: blobhub.compute.workflow
target:
  blob: service-desk-agent
  revision: default
definitions:
- alias: desk-agent
  category: workflow
  file: definitions/workflow__desk-agent.json
- alias: default
  category: playground
  file: definitions/playground__default.json
```

`target.blob` is the bare name, so `--org` alone decides which organization a later command reaches.

```mermaid theme={null}
flowchart LR
  subgraph checkout["service-desk-agent/, your checkout"]
    manifest["blob.yaml<br/>blob: service-desk-agent<br/>revision: default"]
    wf["definitions/<br/>workflow__desk-agent.json"]
    pg["definitions/<br/>playground__default.json"]
  end
  subgraph revision["the blob's default revision"]
    dwf["workflow<br/>desk-agent"]
    dpg["playground<br/>default"]
  end
  manifest -->|file| wf
  manifest -->|file| pg
  wf <-->|"pull, push"| dwf
  pg <-->|"pull, push"| dpg
```

**3. Put it in git**

```bash theme={null}
git init
git add .
git commit -m "Service Desk Agent from the gallery"
```

![Terminal: git init, git add . and the first commit](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/git-init.svg?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=b4696ed2bf4e39c857fa9a2f756c2293)

The copy as it came from the gallery, committed.

**4. Make it yours**

```bash theme={null}
blobhub --org "$ORG" blob create service-desk-agent --type blobhub.compute.workflow
```

![Terminal: blob create in halden-systems, printing the new blob, private, and its default revision](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/blob-create.svg?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=b6996a5a4d076f6be148a8bfbf20e0a8)

blob create makes an empty, private workflow in your organization.

It makes an empty, private workflow with the gallery's name in your organization and waits until it is ready
([`blobhub blob create`](https://docs.blobhub.io/cli/blob/create)); `push` never creates a blob. Now push your checkout into it:

```bash theme={null}
blobhub --org "$ORG" workflow push -f blob.yaml
```

![Terminal: workflow push creating and pushing workflow/desk-agent and playground/default](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/push.svg?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=e04e5ac5d05ac4d0ddd4ce357771ae3b)

push creates both definitions on your workflow and uploads them.

Open `https://blobhub.io/<your-org>/service-desk-agent`.

![The service-desk-agent workflow in halden-systems](https://mintcdn.com/blobhub/DkrJUero1OCWWBPS/tutorials/images/iterate-with-a-coding-agent/your-blob.png?fit=max\&auto=format\&n=DkrJUero1OCWWBPS\&q=85\&s=7a0fbb019eaec1850be010cf6d921e0a)

Your copy, in your organization.

What the three commands did:

```mermaid theme={null}
sequenceDiagram
  autonumber
  actor R as You
  participant C as blobhub CLI
  participant A as api.blobhub.io
  R->>C: --org workflow-gallery workflow pull<br/>service-desk-agent -f blob.yaml
  C->>A: read the blob and list its definitions
  C->>A: download each definition
  Note over C: write blob.yaml, then definitions/
  C-->>R: definitions/ written
  R->>C: --org $ORG blob create service-desk-agent<br/>--type blobhub.compute.workflow
  C->>A: create the blob, wait until ready
  C-->>R: your private copy, still empty
  R->>C: --org $ORG workflow push -f blob.yaml
  C->>A: create and upload each definition
  C-->>R: your copy holds the flow
```

**5. Play**

Open `https://blobhub.io/<your-org>/service-desk-agent/playgrounds/default`, choose **New Session** from the
session menu, and post in Requests:

```text Message theme={null}
This is Felix Brandt from Sales in Hamburg: I can't connect to the VPN since this morning.
```

The agent looks Felix up by name with `lookup_employee`, since a post names no requester, and finds the EU-West
incident on the status page.

![The playground of halden-systems/service-desk-agent on session felix-vpn: the agent's tool calls and its answer to Felix naming the EU-West incident](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/play-vpn.png?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=9ee47156c027e18a103d5435f43441d8)

Your copy answers Felix from the status page.

Every play in this tutorial starts a session of its own, so each round is judged on a clean conversation.

**6. Round 1: behaviour**

Start your coding agent in the checkout (`claude` for Claude Code) and give it:

```text Prompt theme={null}
Before the service desk opens a ticket for broken hardware, have it ask the requester for the device's asset
tag, even when the directory lists one, and open the ticket only once the requester has given it. Change only
the agent's instructions; leave the code and every other file as they are.
```

![Claude Code in the checkout, given the round 1 prompt, editing definitions/workflow\_\_desk-agent.json](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/round1-agent.svg?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=319dee171823207ac18877c23acddd16)

Round 1: the coding agent changes what the desk is told.

Review what it changed:

```bash theme={null}
git diff --word-diff
```

![Terminal: git diff --word-diff of the desk's instructions, the asset-tag rule added](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/round1-diff.svg?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=62de2e48265190f8f30b43d3f1ef8e10)

git diff shows the instruction it added.

Push it:

```bash theme={null}
blobhub --org "$ORG" workflow push -f blob.yaml
```

In a new session, post:

```text Message theme={null}
This is Felix Brandt from Sales in Hamburg: the keyboard on my laptop stopped working. Can you open a ticket?
```

The desk asks for the asset tag before it opens anything.

![The playground on session felix-laptop: the agent finds Felix Brandt in the directory and asks for the laptop's asset tag](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/round1-play.png?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=3e522f86c37be487f16e80df9d47f0ef)

The desk asks for the asset tag before it opens a hardware ticket.

Keep the change:

```bash theme={null}
git commit -am "Ask for the asset tag before a hardware ticket"
```

**7. Round 2: data**

The status page the agent reads is data inside the workflow document, the `Status page` component. Give the
agent:

```text Prompt theme={null}
The EU-West VPN incident is over. Mark it resolved on the status page this workflow reads, so the desk stops
reporting EU-West as degraded. Change only that entry.
```

![Claude Code given the round 2 prompt, editing the status page in definitions/workflow\_\_desk-agent.json](https://mintcdn.com/blobhub/oAp76CGVmY6UCqm0/tutorials/images/iterate-with-a-coding-agent/round2-agent.svg?fit=max\&auto=format\&n=oAp76CGVmY6UCqm0\&q=85\&s=f2c657405f9d98ca26571dbf4d30f49c)

Round 2: the agent marks the EU-West incident resolved.

The agent suggests deploying with `blobhub workflow deploy`; you need not, as the push below is what sends the
change.

Review what it changed:

```bash theme={null}
git diff --word-diff
```

![Terminal: git diff --word-diff of the EU-West VPN entry, its state no longer degraded](https://mintcdn.com/blobhub/DkrJUero1OCWWBPS/tutorials/images/iterate-with-a-coding-agent/round2-diff.svg?fit=max\&auto=format\&n=DkrJUero1OCWWBPS\&q=85\&s=5b2dd6e5824ea361c5a3e470b1859d48)

The change is data: one incident's state.

Push it:

```bash theme={null}
blobhub --org "$ORG" workflow push -f blob.yaml
```

In a new session, post:

```text Message theme={null}
Is EU-West back yet?
```

The composer suggests it, too. The desk checks the status page again and answers that the EU-West incident is
resolved.

![The playground on session eu-west: the agent's status checks and its answer that the EU-West incident is resolved](https://mintcdn.com/blobhub/DkrJUero1OCWWBPS/tutorials/images/iterate-with-a-coding-agent/round2-play.png?fit=max\&auto=format\&n=DkrJUero1OCWWBPS\&q=85\&s=9d76f62e5be693d126bce57e6d091a2f)

Is EU-West back yet? Now the answer is yes.

Keep the change:

```bash theme={null}
git commit -am "Mark the EU-West incident resolved"
```

**8. Round 3: from the website**

Open `https://blobhub.io/<your-org>/service-desk-agent/workflows/desk-agent`. Select the language model node,
named `Claude Fable 5.2`, and pick Claude Opus 5.5 as its model. Rename the node `Claude Opus 5.5` as well, since
the node's model picker changes the model alone, then choose **Save changes**. The node sets the model the flow
runs on outside the playground; in the playground, the model picker in Requests chooses the model for each play.

![The visual editor on desk-agent, the language model node selected, set to and named Claude Opus 5.5](https://mintcdn.com/blobhub/DkrJUero1OCWWBPS/tutorials/images/iterate-with-a-coding-agent/round3-editor.png?fit=max\&auto=format\&n=DkrJUero1OCWWBPS\&q=85\&s=a2673eb56d3a5f5709d4ad26e8d43f13)

Round 3 happens in the visual editor.

Bring the change home:

```bash theme={null}
blobhub --org "$ORG" workflow pull -f blob.yaml
```

![Terminal: workflow pull with the existing blob.yaml, pulling both definitions](https://mintcdn.com/blobhub/DkrJUero1OCWWBPS/tutorials/images/iterate-with-a-coding-agent/round3-pull.svg?fit=max\&auto=format\&n=DkrJUero1OCWWBPS\&q=85\&s=9d0b2807141e6866ef68cbe29c6ecf30)

pull brings the website's change into the checkout.

`pull` with an existing `blob.yaml` rewrites only the definition files. Review what the website changed:

```bash theme={null}
git diff --word-diff
```

![Terminal: git diff --word-diff of definitions/workflow\_\_desk-agent.json, the model changed to Claude Opus 5.5](https://mintcdn.com/blobhub/DkrJUero1OCWWBPS/tutorials/images/iterate-with-a-coding-agent/round3-diff.svg?fit=max\&auto=format\&n=DkrJUero1OCWWBPS\&q=85\&s=8b19df2e24ed516d42a13eec95f7ecf4)

git diff shows the model the editor saved.

Keep the change:

```bash theme={null}
git commit -am "Switch the agent to Claude Opus 5.5"
```

## Where next

> [card] [Own the code](https://docs.blobhub.io/cli/workflow/overview.md)
>
> Eject a code component into a Python package, build it, deploy it.

> [card] [Schedules](https://docs.blobhub.io/general/schedules.md)
>
> Run the flow on a timer.

> [card] [Listeners](https://docs.blobhub.io/blob-types/workflow/workflows/listeners.md)
>
> Start a run from the session's own events.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.