---
id: plugins-guides-start-and-stop
title: "Start and keep running"
summary: "Which components run when a flow starts, which plugins keep a flow running, when a flow stops on its own, and the Keep alive setting."
audience: user
keywords: "start, keep alive, keepalive, run once, Timer, listener, start pin, flow stops, decommission, start mode, autostart"
---
# Start and keep running

A flow either runs once and stops, or keeps running and waits for work. The components you place decide which.

## What runs when a flow starts

When a flow starts, it calls every component whose start or input pin is unconnected and needs no data. A **Timer**
starts its schedule, an **Http listener** opens its port, a **Kafka subscriber** connects, and a **Try catch** or a
script with nothing in front of it runs once.

## Flows that keep running

A flow keeps running while it holds a component that waits for work. These plugins keep it running:

| Category | Plugins |
|---|---|
| Flow | **Timer**, **Fork** |
| Web | **Http listener**, **Web socket listener**, **Web socket client** |
| Event | **Kafka**, **MQTT** and **NATS** subscribers and publishers |
| Network | **TCP server**, **UDP server** |
| Pipes | **Pipe listener** |
| Messaging | **Sms receiver**, **Ussd server** |
| Text | **RSS/Atom parser** |

A flow [published as a plugin](/documentation/publishing/) also keeps running, so it is ready whenever another flow calls it.

## Flows that run once

A flow without such a component runs its start components, and stops when they return. Use this for one-off jobs:
a migration, a load, a test run.

```text
Script (runs once) → Sql query → CSV encoder → Write file
```

To keep such a flow running anyway, for example because a script starts its own background work, switch on
**Keep alive** in the [flow configuration](/documentation/designer/build#flow-properties).

## When a flow starts

The **start mode** in the designer toolbar decides whether the flow starts on its own:

| Mode | The flow starts |
|---|---|
| **Manual** | Only when someone starts it, or a **Start flow** component starts it |
| **Auto** | Every time the controller starts |
| **Disabled** | Never |

For **Auto** flows, **Modify auto start dependencies** picks the flows that must be running first.

## Stop a flow

Stop a flow in the designer or from the [Environment explorer](/documentation/designer/operate#environment-explorer). A flow also
stops when a record has nowhere to go: see [When nothing matches](./pins-and-routing#when-nothing-matches).
