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 workflowsGitHub Actions importTekton import
What it isA graph of agent steps that hive schedules and runsThe DAG of jobs a repository already runs in GitHub ActionsThe DAG of tasks a repository or cluster already runs in Tekton
SourceA YAML or JSON kind: TaskWorkflow spec saved by an owner.github/workflows/*.yml and *.yaml filesTekton files in a repository, or a live cluster through kubectl
Nodes and edgesAgent steps; depends_onJobs; needsTasks; runAfter and result references
Who runs itHive: it kicks each step’s agent, retries, times out and gates downstream stepsGitHub Actions; hive reads and renders itTekton; hive reads and renders it
Where it showsSettings → Workflows → Task workflows: editor, runs, steps by stage, attemptsInside a lifecycle model: diagram, citations, raw JSONInside a lifecycle model: diagram, citations, raw JSON
StatusAvailable, off by default (workflow.tasks.enabled)AvailableAvailable
GuideDAG workflowsImporting GitHub Actions workflowsImporting 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.

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.

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 parallel with nested regions (for example review and CI running at the same time) or final.
  • Transitions and guards. Moves between states, each fired by an event (a fact such as pr.checks is green or labels 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-default and 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 workflowGitHub Actions importTekton importLifecycle workflow model
DescribesAgent steps and their dependenciesJobs and their dependenciesTasks and their dependenciesIssue and PR states, transitions, roles, gates
SourceA YAML or JSON spec saved by an owner, or a draft converted from an importGitHub Actions workflow filesTekton files or a live clusterBuilt-in hive-default, the editor, the marketplace, or ingest
Hive executes itYes: hive kicks each step’s agent, retries, times out and gates downstream stepsNo: GitHub Actions runs itNo: Tekton runs itYes: hive derives each item’s state and dispatches agents per state (with derivation on)
Shown in the dashboardSettings → Workflows → Task workflows: editor, runs, steps by stage, attemptsInside the model: diagram, citations, raw JSONInside the model: diagram, citations, raw JSONActivity Monitor columns, Settings → Workflows
Human gatesOptional per step (approval: required)No (runs are outside hive)No (runs are outside hive)Yes, required on every agent path
Started or boundManually, on a cron schedule or by a run-trigger tokenOnly as part of a model, bound per repositoryOnly as part of a model, bound per repositoryBound per repository on Settings → Repos