﻿A service is a command that should keep running: a queue worker, a bot, a small
server. RunWisp starts it with the daemon and starts it again when it exits.

```toml title="runwisp.toml"
[services.worker]
instances = 3                 # keep three copies running
run       = "node /app/worker.js"
```

Run `runwisp reload` and the three copies start.

## Follow its output

```bash
runwisp logs -f worker
```

Each line starts with the copy it came from (`worker#2 | ...`). Every start of a
copy is a run in the history, so when one crashes, its output and exit code
stay behind for you to read.

## Task or service?

If the command exits on its own when it's done, it's a task. If it runs until
you stop it, it's a service. A script that loops forever with a `sleep` inside
is usually better as a task on a schedule; see
[A polling loop](/concepts/tasks-vs-services/#a-polling-loop).

## When it keeps crashing

A service that exits right after it starts is restarted with a growing delay.
After too many failed starts in a row, RunWisp stops trying and alerts you like
a failed task. See
[When a service can't start](/configuration/services/#when-a-service-cant-start-fatal).

## Next steps

- [Tasks and services](/concepts/tasks-vs-services/) compares the two in full.
- Every key a service accepts is in the
  [`[services.*]` reference](/configuration/services/).
