---
title: "How a job runs"
url: https://services.dev/docs/start/how-it-runs
captured: [grow-submit.txt, walk.txt]
---
# How a job runs

URL: https://services.dev/docs/start/how-it-runs

> One order, carried from the first input to the last cent. Every Service runs the same six stops, whether AI does all of it or a credentialed person signs.

A job is one order, held until the work is done. AI delivers by default. A person is a step you place, where you want one or where the work needs one, and the job waits for them as it waits for anything else.

## The map

| Stop | What happens | Who acts |
|---|---|---|
| **Order** | A buyer, or their agent, sends the input and the most they'll pay, and gets a job with the charge held, or an offer with the exact call to send. | buyer, agent |
| **Steps** | `deliver` runs as a graph of work, review, ask and submit steps. Each starts once the steps it waits on are done, and a step can branch, loop, or route the job to another. | AI, your code, a party, an outside system |
| **Gate** | Every doer proposes, and [one gate](https://services.dev/docs/service/gate.md) commits. It checks each proposal against your guards and the job's policy, and writes it to the record or refuses it, the same way for AI and people. | the gate |
| **People** | Where you placed a person, the job waits for them to act in the delivery portal. A role names the credential the act needs, and a Pool of verified members fills it. | member, staff |
| **Delivery** | The output ships. The buyer accepts it, or sends it back with a note and the AI redoes it. Seven days after delivery it's final. | buyer |
| **Money** | The held charge releases on the fact you name: delivery, acceptance, or an outside system's receipt. One ledger splits it into AI, the person's pay and what you keep, and pays each person out on the Pool's schedule. | owner, member |

## The default job

Four lines and a price: an agent orders, AI drafts, an adversarial review passes it, and the charge releases on delivery.

```bash
npx services.dev
```

```txt title="captured"
an agent ordered Translation at $49
job_7Hq2 · delivered · document.fr-CA.pdf · $49.00 charged
  record  draft · ai | review · ai · pass
  ledger  +$49.00 · AI $0.84 · you $48.16
```

Six stops, and no person at any of them. The buyer accepts or sends it back with a note, and the AI redoes it.

## The same job, grown

This is Translation after the first four [Grow](https://services.dev/docs/grow/review.md) steps. Each key in the file is a stop on the map (its Pool and rules table are [Grow 4's](https://services.dev/docs/grow/submit.md)):

```ts title="services/translation.ts"
export default Service({
  name: 'Translation',
  description: 'A document, translated, signed and filed.',
  input: { document: 'file', to: 'language: a BCP 47 tag, such as fr-CA' },
  output: { document: 'file', filing: 'text' },
  rules: rules(),
  roles: { translator: { pool: translators(), pay: 30 } },
  deliver: {
    glossary: { ask: 'buyer', to: 'answer', items: () => [{ id: 'terms', label: 'Which terms stay in English?' }] },
    translate: 'ai',
    harden: { review: 'adversarial', lenses: ['meaning', 'terms'], rounds: 2 },
    sign: { by: 'translator', stamp: true, est: '20min' },
    file: {
      submit: 'https://registry.example.test/filings',
      to: 'the registry',
      receipt: 'filing',
      rejected: { missing_certificate: 'sign', '*': 'translate' },
      perfect: '2d',
      fallback: 'hand_off',
    },
    hand_off: { ask: 'buyer', to: 'answer', routed: true },
  },
  price: 89,
})
```

Order a job with a magic value that makes the registry reject the first filing. The rejection's code chose the branch:

```txt
→ POST /translation {"document":"lease.pdf","to":"fr-CA","key":"grow","max_usd":89,"metadata":{"sandbox":{"outside":{"reject":["missing_certificate"]}}}}
```

```txt title="magic values: metadata.sandbox.outside = { reject: [missing_certificate] }"
← job_7Hq2 · waiting · on party · $89.00 held
  waiting {"on":"party","since_at":"2026-10-25T14:02:11.000Z","step":"glossary","clock":"paused"}
# 2 hours later, the buyer answers through the link
→ POST /asks/ask_7Hq2?t=8FaWT5EoCj4h-uMyjlXp3_ {"items":{"terms":{"answer":"Lessee, Lessor, Premises"}}}

← job_7Hq2 · waiting · on claim · $89.00 held
  waiting {"on":"claim","since_at":"2026-10-25T16:02:11.000Z","step":"sign","task":"tsk_7Hq2"}
# on localhost you are the owner, and the owner holds no credential
→ POST /sworn-translators/jobs/job_7Hq2/approve
← 403 needs_a_person: sign is tsk_7Hq2, a Task for a member of sworn-translators: the member who claims and clears it attests, in their own session.

# 20 minutes later, mbr_7Hq2, the sworn translator, claims tsk_7Hq2 in the delivery portal and signs, in their own session
→ POST /tasks/tsk_7Hq2/claim
← tsk_7Hq2 · claimed · translator · sign · * · $30.00 · 20 min · $90.00 an hour · due 2026-10-27 16:02
→ POST /tasks/tsk_7Hq2/clear · GET /tasks/tsk_7Hq2/packet
→ POST /tasks/tsk_7Hq2/attest
← tsk_7Hq2 · done · translator · sign · * · $30.00 · attested · 20 min · $90.00 an hour · due 2026-10-27 16:02

← job_7Hq2 · waiting · on claim · $89.00 held
  waiting {"on":"claim","since_at":"2026-10-25T16:22:11.000Z","step":"sign","task":"tsk_7Hq3"}
# 20 minutes later, mbr_7Hq2, the sworn translator, claims tsk_7Hq3 in the delivery portal and signs, in their own session
→ POST /tasks/tsk_7Hq3/claim · POST /tasks/tsk_7Hq3/clear · POST /tasks/tsk_7Hq3/attest

← job_7Hq2 · delivered · lease.fr-CA.pdf · $89.00 charged
  record  glossary.terms · answered | glossary · buyer · answer · clock paused 2h | translate · ai | harden · ai · adversarial · 2 lenses · pass | sign · person · sworn translator · * · mbr_7Hq2 | file · the registry · rejected · missing_certificate · repairing at sign | sign · person · sworn translator · * · mbr_7Hq2 | file · the registry · accepted · rcp_7Hq3
  ledger  +$89.00 · AI $1.26 · translator $60.00 · you $27.74
```

Read the record left to right, and it is the map:
- **Order.** `max_usd` capped the price. The $89 was held from the order and charged at the end.
- **Steps.** `glossary` is an ask: the buyer acts through a link that needs no account, and the clock pauses while they do. `translate` is AI, and `harden` is two AI reviewers, one per lens. `file` is an outside system, and its typed rejection routed the job back to `sign`.
- **Gate.** Each output was proposed, checked and committed one at a time, in the order you read it.
- **People.** `sign · person · sworn translator` is the credentialed act: a Task only a verified member of the Pool can claim, attested in their own session and bound to the file's hash. The owner's own approve was refused. That's how a Service meets licensing by design.
- **Delivery.** The job shipped once the registry accepted the filing.
- **Money.** With a submit step, the charge waits for the receipt. The ledger is the split: AI, the translator's $30 for each of two signatures, and what you keep.

Every Service runs all six stops, and each key you add carries one of them. The canonical list of keys, the shape each makes and the plan it runs live on is [the default, and what each key adds](https://services.dev/docs/start/system.md#the-default-and-what-each-key-adds).

## What every stop shares

**One record.** Every proposal, refusal, answer, signature and receipt is a line on one append-only record. It's the only place a step's output is written, and how a job is replayed, exported and audited.

**One refusal.** A guard refuses AI and a person with the same `guard_refused`, and an agent that tries what only a person can gets the same shape: the reason, and the next call.

**One price, stated first.** Every Service says how it earns, and every offer, job and `check` prints it. services.dev's take is one more line on that ledger, and your plan decides which features run on live jobs ([how it earns](https://services.dev/docs/start/system.md#how-it-earns)).

## Next

**[Everyone gets an app](https://services.dev/docs/start/participants.md)**: who acts at each stop, and the app each of them gets.

---

- Up: [Your first paid job](https://services.dev/docs.md)
- Previous: [Services as software](https://services.dev/docs/start/why.md)
- Next: [Everyone gets an app](https://services.dev/docs/start/participants.md)
