# Overview

import { LinkCard, CardGrid } from '@astrojs/starlight/components';

pgflow is built on a few key concepts: **flows** are flow definitions, **runs** are executions of those flows. Each flow has **steps** that can depend on other steps - a step waits for its dependencies to complete and gets access to their outputs.

Steps execute through **tasks** (the actual units of work) - regular steps have 1 task, but map steps create one task per array element for parallel processing.

## Architecture

<CardGrid>
  <LinkCard
    title="How pgflow Works"
    href="/concepts/how-pgflow-works/"
    description="A gentle, 10-minute introduction to pgflow's architecture, state model, and execution cycle"
  />
  <LinkCard
    title="Three-layer architecture"
    href="/concepts/three-layer-architecture/"
    description="Deep dive into pgflow's separation of concerns: DSL, SQL Core, and Worker layers"
  />
  <LinkCard
    title="Data Model"
    href="/concepts/data-model/"
    description="Understanding pgflow's database schema design and table relationships"
  />
</CardGrid>

## Defining Flows

<CardGrid>
  <LinkCard
    title="Understanding flows"
    href="/concepts/understanding-flows/"
    description="Learn how flows work in pgflow, from syntax to execution"
  />
  <LinkCard
    title="Map Steps"
    href="/concepts/map-steps/"
    description="Understanding parallel array processing with map steps in pgflow workflows"
  />
  <LinkCard
    title="Context object"
    href="/concepts/context-object/"
    description="Understanding how pgflow provides platform resources to handlers through context"
  />
  <LinkCard
    title="Naming steps"
    href="/concepts/naming-steps/"
    description="Best practices for naming flows and steps"
  />
</CardGrid>