Synced from Hive. This page is pulled from hivecommons/hive@v5 during the docs build. Edit the canonical source in the Hive repository.
Workflows in hive
Hive works with two layers of workflow:
- Pipelines: a DAG of steps, jobs or tasks. There are three equal ways to bring one into hive: author a DAG workflow that hive runs on its agents, import GitHub Actions workflows, or import Tekton pipelines.
- Lifecycle workflow models: how an issue or pull request moves from opened to merged, who moves it, and which agent works in which state.
Three ways to bring a DAG into hive
| DAG workflows | GitHub Actions import | Tekton import | |
|---|---|---|---|
| What it is | A graph of agent steps that hive schedules and runs | The DAG of jobs a repository already runs in GitHub Actions | The DAG of tasks a repository or cluster already runs in Tekton |
| Source | A YAML or JSON kind: TaskWorkflow spec saved by an owner | .github/workflows/*.yml and *.yaml files | Tekton files in a repository, or a live cluster through kubectl |
| Nodes and edges | Agent steps; depends_on | Jobs; needs | Tasks; runAfter and result references |
| Who runs it | Hive: it kicks each step’s agent, retries, times out and gates downstream steps | GitHub Actions; hive reads and renders it | Tekton; hive reads and renders it |
| Where it shows | Settings → Workflows → Task workflows: editor, runs, steps by stage, attempts | Inside a lifecycle model: diagram, citations, raw JSON | Inside a lifecycle model: diagram, citations, raw JSON |
| Status | Available, off by default (workflow.tasks.enabled) | Available | Available |
| Guide | DAG workflows | Importing GitHub Actions workflows | Importing Tekton pipelines |
The three meet: an imported GitHub Actions workflow or Tekton pipeline can also be converted into a disabled DAG workflow draft that keeps its shape, for an owner to complete with agents and prompts.
DAG workflows
A DAG workflow (kind: TaskWorkflow) is a graph of agent steps that hive runs itself. Each step
is a prompt to an agent or to any free member of an agent pool, depends_on orders the steps,
and hive retries failed attempts, times them out and starts a step only once everything it
depends on has succeeded. The agent reports each step with hive-step-done. Runs start from the
dashboard, the API, a cron schedule, or an external scheduler holding a run-trigger token. The
feature is off by default (workflow.tasks.enabled).
Use it when the work is agent work that hive should drive in a set order, with parallel branches, retries and gates.
- Guide: DAG workflows covers the spec, validation, how a run executes, failure handling and a worked example.
- Walkthrough: Task workflows sets up a regression pipeline end to end, with schedules, run-trigger tokens and settings.
- Design: Task workflows design.
GitHub Actions import
Hive reads a repository’s GitHub Actions workflow files and turns each one into a pipeline in a
draft lifecycle model: jobs become nodes and needs becomes the edges. Hive derives each
pipeline’s role from its triggers and binds it into the lifecycle. GitHub Actions keeps running
the jobs; hive does not trigger, re-run or cancel them.
Use it when the pipeline already lives in GitHub Actions and you want a starting model that knows your CI.
- Guide: Importing GitHub Actions workflows covers the dashboard and
API, how jobs and
needsmap into the model, a worked example, and import as a DAG workflow draft.
Tekton import
Hive reads Tekton Pipeline, PipelineRun and Tekton Triggers resources, from files in a
repository (including Pipelines-as-Code PipelineRuns) or from a live cluster through
kubectl, and turns each pipeline into a pipeline in a draft lifecycle model: tasks become
nodes, and runAfter and result references become the edges. Tekton keeps running the
pipelines; hive does not create, re-run or cancel PipelineRuns.
Use it when the pipeline already lives in Tekton or OpenShift Pipelines and you want a starting model that knows how the repository builds and ships.
- Guide: Importing Tekton pipelines covers files and live clusters, RBAC,
the
runAftermapping, Pipelines-as-Code triggers, a worked example, and import as a DAG workflow draft.
Lifecycle workflow models
A workflow model is a declarative state machine for a repository’s issues and pull requests,
written in the workflow.hivecommons.dev/v1alpha1 format (kind: WorkflowModel). Every hive
starts with the built-in hive-default model, which is the lifecycle the Activity Monitor
columns show today: Open, Actionable, Claimed, PR in progress, CI / Review, Merge queue,
Merged.
A model can declare:
- States and columns. The states an item can be in, grouped into the Activity Monitor
columns. A state can be
parallelwith nested regions (for example review and CI running at the same time) orfinal. - Transitions and guards. Moves between states, each fired by an event (a fact such as
pr.checks is greenorlabels has triage/accepted) and optionally held by a guard such as required checks or an environment approval. - Roles and human gates. Named roles (maintainer, approver, reviewer, author) and gates a role must release before a transition happens. The compiler refuses a model in which an agent can reach a terminal outcome without crossing a gate owned by a human role.
- Agent grants and dispatch. Which agent profile may act in which states, and where hive hands an item to that profile. A hive maps each profile to one of its own agents; the grant describes the work and never widens what the agent’s session may do.
- Derivation rules. How hive works out an item’s current state from facts it already
observes.
hive-defaultand ingested models use the built-in derivation; custom models use ordered rules.
You bind a model to a repository on Settings → Repos (the per-repository Workflow select). With Derive stages from bound models off (Settings → Workflows → Library), a binding only changes the Activity Monitor columns. With it on, hive derives the repository’s stages from the model’s rules, provisions the model’s labels and dispatches agents per state.
Use a lifecycle model when you want hive to follow a process that differs from the default: an intake form and triage step, a review gate owned by named people, an assessment loop with a drafting agent and a verifying agent.
- Reference: Workflow models covers the format, the compiler, the editor, Simulate, versions and the marketplace.
- Worked example: CNCF TechDocs AI-assisted assessment is the first curated model in the marketplace (Settings → Workflows → Marketplace). It shows intake, agent dispatch to a drafter and a verifier, and a human gate after every agent step.
- Agent side: Agent configuration covers the agents that fill a model’s profiles, and Kick refusals explains what you see when an agent declines a hand-off.
Imported CI pipelines (GitHub Actions and Tekton)
The two imports above are called ingest. Each GitHub Actions workflow file or Tekton
pipeline becomes an entry in the model’s spec.pipelines. Pull-request pipelines sit on the
CI / Review states, and pipelines that run after merge (default-branch CI, release, deploy) add
Main CI, Release, Deploy and Done columns after Merged.
Hive renders these pipelines and records what it found; it does not execute them. Ingest
never uses an LLM: the same YAML always produces the same model. Everything ingest adds is
marked confidence: inferred and the model is saved with provenance ingested-unreviewed, so a
person reviews it before binding it to a repository.
Ingest also accepts a written process document (POST /api/workflows/ingest/spec, the
From a written spec panel on the Ingest view), which becomes a draft model with every
element inferred. See Workflow models for that path.
Comparison
| DAG workflow | GitHub Actions import | Tekton import | Lifecycle workflow model | |
|---|---|---|---|---|
| Describes | Agent steps and their dependencies | Jobs and their dependencies | Tasks and their dependencies | Issue and PR states, transitions, roles, gates |
| Source | A YAML or JSON spec saved by an owner, or a draft converted from an import | GitHub Actions workflow files | Tekton files or a live cluster | Built-in hive-default, the editor, the marketplace, or ingest |
| Hive executes it | Yes: hive kicks each step’s agent, retries, times out and gates downstream steps | No: GitHub Actions runs it | No: Tekton runs it | Yes: hive derives each item’s state and dispatches agents per state (with derivation on) |
| Shown in the dashboard | Settings → Workflows → Task workflows: editor, runs, steps by stage, attempts | Inside the model: diagram, citations, raw JSON | Inside the model: diagram, citations, raw JSON | Activity Monitor columns, Settings → Workflows |
| Human gates | Optional per step (approval: required) | No (runs are outside hive) | No (runs are outside hive) | Yes, required on every agent path |
| Started or bound | Manually, on a cron schedule or by a run-trigger token | Only as part of a model, bound per repository | Only as part of a model, bound per repository | Bound per repository on Settings → Repos |