---
title: How it works
description: How Pipedash loads cached pipelines, polls each provider on its own interval, backs off on failure and pushes updates.
---

Pipedash keeps a local cache of the pipelines, shows it right away and refreshes it in the background. This page follows one refresh from startup to screen.

## Startup

When setup is complete, Pipedash loads every saved provider and starts the refresh loop.

The dashboard does not wait for the network. It shows the last stored pipelines from the database first. The first refresh arrives a moment later and replaces them.

## Refresh schedule

One loop wakes every 5 seconds. Each provider has its own refresh interval, and the loop fetches every provider that is due.

| Value | Setting |
|---|---|
| Wake interval | 5 seconds |
| Refresh interval | 30 seconds for a provider added in the app or `config.toml`, set per provider |
| Allowed range | 5 to 300 seconds in Settings. `config.toml` accepts an unsigned 32-bit interval, and `0` disables scheduled polling |
| First fetch | Due at once for a provider that has no earlier attempt |
| Fetch timeout | 30 seconds for one provider |
| Parallel fetches | 10 providers at most |

Settings > Providers edits the interval of one provider. The [refresh page](/docs/features/refresh) describes the control.

A successful fetch updates the cache and sends a `pipelines-updated` event. A pipeline with a changed status or last run adds a `pipeline-status-changed` event.

### Active and idle modes

The desktop app is active while its window has focus and idle when the window loses focus. The web server has no window, so it always stays active.

In idle mode the loop skips scheduled fetches. A manual refresh and the first fetch of a new provider still run. Old metrics still clean up every 6 hours.

```mermaid
sequenceDiagram
    participant RL as Refresh loop
    participant SC as Scheduler
    participant PL as Provider
    participant UI as Interface
    loop every 5 seconds
        alt active mode
            RL->>SC: claim providers that are due
            SC-->>RL: due providers
            RL->>PL: fetch pipelines, 30 s timeout
            alt success
                PL-->>RL: pipelines
                RL-->>UI: pipelines updated
                RL->>SC: next attempt after one interval
            else transient failure
                RL->>SC: next attempt after a longer wait
            end
        else idle mode
            RL->>RL: skip scheduled fetches
        end
    end
```

## Backoff

A failing provider receives fewer requests. The scheduler counts consecutive failures for each provider and resets the count after a successful fetch.

| Result of a fetch | Wait before the next attempt |
|---|---|
| Success | One refresh interval |
| Network error, timeout or unavailable service | The interval doubled for each consecutive failure, up to 10 minutes. A retry hint from the provider can make the wait longer, up to 1 hour |
| Rate limit | The wait the provider asks for, up to 1 hour. Without a hint, the doubled interval. Never shorter than the interval |
| Other errors, such as a rejected token | One refresh interval, with no growth |
| Major outage reported for the provider | At least 2 minutes between scheduled attempts |

A manual refresh fetches at once. It still respects a rate-limit wait and skips a provider that Pipedash fetched in the last 10 seconds. It returns after 25 seconds at most. A manual refresh of a provider that is already fetching waits for that fetch.

When a provider reports less than 10% of its API quota remaining, Pipedash pauses refreshes until the reported reset time. Providers that do not report quota information use the normal schedule and error backoff. The sidebar and Settings > Providers show "Paused until" with the reset time.

The [provider health](/docs/features/provider-health) page explains where an outage report comes from.

## Live updates

The backend pushes an event to the interface when something changes. Examples are new pipeline data, a triggered run, a provider change and a provider health alert. While a run's log or job list is open, the backend also watches that run and pushes its changes, so the logs and the status of unfinished runs update live without polling. The interface refetches the affected data when an event arrives. The web server sends these events as JSON over a WebSocket. The [REST API page](/docs/deployment/rest-api) lists them.

On iOS the refresh loop runs while the app runs. Background checks run separately, and iOS decides when they run. The [notifications](/docs/features/notifications) page describes them.

## From provider data to the screen

Provider plugins return pipeline and run facts. The core applies filtering, sorting, pagination and action policy. Its `Presenter` adds the action availability and run display data that the interface renders.

```mermaid
flowchart LR
    P["Provider plugin<br/>pipeline and run facts"] --> C["Core services<br/>selection and policy"]
    C --> R["Presenter<br/>actions and run display"]
    R --> T["IPC, REST and events"]
    T --> U["React interface"]
```

Pipelines include `actions`. Runs include `actions`, `display` and `pace`. Plugin metadata supplies provider-specific terminology, labels and notices. The same backend data reaches desktop commands, REST responses and events.

The frontend keeps local interface state, such as an open dialog or an unsaved form. It does not decide whether a provider action is allowed. The backend checks that policy again when an action request arrives.

## Provider calls

Each provider is a plugin that fetches pipelines and run history. Its capabilities and policy determine which actions are available. Some providers reconcile or deploy a resource instead of starting a workflow. Some have no cancel action.

When a provider fails, the interface shows its error. The [plugin development page](/docs/resources/plugin-development) describes the plugin interface.

## Storage

The pipeline cache, run history cache, workflow parameter cache, provider list and metrics live in one database. SQLite is the default and PostgreSQL is the alternative. Tokens live in a separate token store chosen during setup. The [architecture page](/docs/resources/architecture) lists the tables, and the [refresh](/docs/features/refresh) and [cache](/docs/features/cache) pages describe the user-facing behavior.
