Skip to content
BENIBIX Learn

Workflow as Code

Data🗓️ OrchestrationWorkflow Orchestration

Also known as Pipelines as Code, Workflows as Code, Orchestration as Code

Writing the steps of a pipeline in a code file. No clicks in a tool.

Think of it like

It is like a recipe written down, not kept in the cook's head. Anyone can read it, copy it and fix it.

Example

Emma's team keeps every pipeline as a Python file in git. A change to the sales pipeline goes through review first. When a run breaks, git shows what changed and who changed it.

Why it matters

Clicked-together pipelines are hard to review, copy or undo. Code can be read, tested and rolled back.

Definition

Workflow as code means writing a pipeline's steps in a code file, not in clicks on a screen. The file says which tasks exist and what order they run in. The orchestrator reads the file and draws the graph from it. Because it is code, it lives in version control. Changes get reviewed, and the workflow can be tested before it runs. Airflow, Dagster and Prefect all work this way.
On the left, the workflow as a code file. On the right, the graph the orchestrator draws from it.

Common mistake

Putting slow work, like a database query, at the top of the file. The tool reads the file often, so that work runs again and again.

Key takeaways

  1. 1
    One file. Steps and order are written down.
  2. 2
    In version control. Every change has a history.
  3. 3
    Reviewed and tested. Like any other program.