Introducing a new way to review your PRs.

Read the announcement

dagster-io / dagster

An orchestration platform for the development, production, and observation of data assets.

View on GitHub

19 documents · Updated Nov 23, 2026

docs / ops-jobs-and-graphs

Ops, jobs, and graphs

Dagster separates compute logic from the context that makes it runnable. An op holds one unit of compute, a graph connects ops into a directed workflow, and a job binds that workflow to configuration, resources, and an execution method. Asset-centric workflows use the same compute model while making stored data and lineage the main objects of selection and monitoring. See Definitions and automation, Software-defined assets, and Schedules, sensors, and automation for the surrounding system.

Computation model

Ops, graphs, and jobs form three related levels of the compute model. The levels keep reusable logic separate from the choices that control where and when that logic runs.

flowchart LR
    A[Op definitions] --> B[Graph of connected ops]
    B --> C[Job with config resources and executor]
    C --> D[Run]
    E[Asset definitions] --> F[Asset selection and lineage]
    F --> C

Ops

An op is the basic unit of user-defined computation. It consumes named inputs and produces named outputs. Its compute logic can use configuration and declared resources without fixing the external service or execution mode in the op itself. An op can also declare retry behavior, a code version, and a concurrency pool for the work it represents. See python_modules/…/op_definition.py• L65-97 and docs/…/index.md• L13-43.

Ops do not define their full dependency graph on their own. An input becomes dependent on another op only when a graph or job connects the matching output to it. This lets the same op definition be reused in more than one workflow and lets each workflow provide a different environment. See docs/…/index.md• L19-21 and docs/…/graphs.md• L112-128.

References: python_modules/…/op_definition.py• L65-97 docs/…/index.md• L13-43 docs/…/index.md• L19-21 docs/…/graphs.md• L112-128

Graphs

A graph is a directed acyclic graph of ops and other graphs. The connections describe how values move between nodes and therefore determine which nodes can run after upstream values are ready. A graph can expose inputs and outputs so that a larger graph can treat it as one reusable node. See python_modules/…/graph_definition.py• L136-165 and docs/…/nesting-graphs.md• L19-46.

Graphs provide structure without being the final execution boundary. They can nest to hide detail, branch when only one input path resolves, fan in several results, or expand work from runtime-discovered dynamic outputs. These patterns change the shape of compute while keeping the graph as the place where dependencies are declared. See docs/…/graphs.md• L39-104 and docs/…/dynamic-graphs.md• L20-50.

References: python_modules/…/graph_definition.py• L136-165 docs/…/nesting-graphs.md• L19-46 docs/…/graphs.md• L39-104 docs/…/dynamic-graphs.md• L20-50

Jobs

A job is the main unit for launching and monitoring a run. An op job contains a graph of ops. A job also supplies the environment around that graph, such as resources, run configuration, tags, hooks, retry policy, loggers, partitions, and an executor. Asset jobs can also carry an automation condition that limits when asset-root work is eligible for automated evaluation. See docs/…/op-jobs.md• L13-26 and python_modules/…/job_definition.py• L126-148.

The separation matters when one logical workflow must run in several environments. The graph can remain unchanged while different jobs attach different services, configuration, or execution methods. See docs/…/op-jobs.md• L53-67.

References: python_modules/…/job_definition.py• L126-148 docs/…/op-jobs.md• L13-26 docs/…/op-jobs.md• L53-67

Job construction

Job construction turns a reusable graph into an executable definition. The graph supplies the logical dependency structure. The job supplies the run-facing choices that the graph needs.

Graph-to-job binding

The GraphDefinition.to_job boundary creates a JobDefinition from a graph and accepts the resources, configuration, executor, partition definition, hooks, metadata, and tags that complete the execution contract. The same graph can therefore produce several jobs with different operational behavior. See python_modules/…/graph_definition.py• L601-712.

The @job form combines graph composition and job creation in one declaration. Use it when the graph is specific to one job. Use a separately defined graph when the dependency structure is a reusable product of the codebase or when multiple environments need their own job bindings. See docs/…/op-jobs.md• L28-67.

References: python_modules/…/graph_definition.py• L601-712 docs/…/op-jobs.md• L28-67

Configuration layers

Configuration controls behavior without changing the dependency graph. An op can define the values it needs, a nested graph can present a smaller interface and map those values to its children, and a job can provide defaults or partition-based run configuration.

Configuration formPurpose
Op configurationSet behavior for one compute unit at run time.
Graph config mappingHide child details behind a smaller graph-level interface.
Job run configSupply the full run shape or a visible default for a job.
Partitioned configMap a selected partition key to run configuration.

Configuration supplied as a dictionary is visible and editable in the UI. Do not use that form for values that must stay secret. A config mapping is useful when launchers should provide a small business-level input instead of the full per-op shape. See docs/…/op-jobs.md• L69-99 and docs/…/nesting-graphs.md• L50-74.

References: python_modules/…/job_definition.py• L434-449 python_modules/…/job_definition.py• L523-573 docs/…/op-jobs.md• L69-99 docs/…/nesting-graphs.md• L50-74

Resource and execution binding

Resources give ops access to external systems through a job-level contract. The job checks that the graph's resource needs are satisfied before execution. This keeps the compute code independent from the concrete database, API client, or service used by a deployment. See python_modules/…/job_definition.py• L621-662 and docs/…/index.md• L27-35.

The executor chooses how the job's steps run. The default executor supports in-process and multi-process behavior and defaults to multi-process execution. Other executors can provide different isolation or placement, but multi-process execution needs a reconstructable job, a usable non-ephemeral instance, and persistent outputs. See python_modules/…/job_definition.py• L402-429 and python_modules/…/executor_definition.py• L38-61.

References: python_modules/…/job_definition.py• L621-662 python_modules/…/job_definition.py• L402-429 python_modules/…/executor_definition.py• L38-61 docs/…/op-jobs.md• L69-99

Execution selection

Dagster can execute a whole job or create a valid subset of it. Selection reduces the work while preserving the dependencies needed by the selected target.

Op selection

Op selection targets nodes in an op job by name. A plain name selects one node. A leading * includes ancestors, a trailing * includes descendants, and a limited number of + characters includes ancestors or descendants for a fixed number of hops. The selected nodes must still have all required inputs resolved. See docs/…/job-execution.md• L74-110 and python_modules/…/job_definition.py• L958-1051.

SelectionMeaning
some_opThe named op.
*some_opThe op and all upstream ancestors.
some_op*The op and all downstream descendants.
some_op+++The op and descendants up to three hops away.

References: docs/…/job-execution.md• L74-110 python_modules/…/job_definition.py• L958-1051

Asset selection

Asset selection targets the data products a job should materialize. Dagster builds the executable job graph from the selected assets and keeps unselected upstream dependencies as inputs that support the selected work. Asset selection and op selection are different views of execution and cannot be supplied together for the same subset operation. See python_modules/…/job_definition.py• L958-1017 and python_modules/…/asset_job.py• L233-299.

References: python_modules/…/job_definition.py• L958-1017 python_modules/…/asset_job.py• L233-299

Partition selection

A partition definition gives a job a discrete set of keys. Selecting a key supplies the configuration for that partition and validates that the key applies to the job or selected assets. Asset jobs also use the partition definitions of their selected assets, so incompatible partition schemes can prevent job construction. See python_modules/…/job_definition.py• L879-920 and python_modules/…/asset_job.py• L371-402.

References: python_modules/…/job_definition.py• L879-920 python_modules/…/asset_job.py• L371-402

Execution paths

The same job definition can be launched through interactive tools, automation, or Python. Each path supplies a run request that is evaluated against the job's configuration and selection rules.

flowchart TD
    A[Job definition] --> B{Launch source}
    B --> C[Dagster UI]
    B --> D[CLI or API]
    B --> E[Schedule or sensor]
    B --> F[Python execution API]
    C --> G[Run configuration and selection]
    D --> G
    E --> G
    F --> G
    G --> H[Executor runs selected steps]

Run launch

The UI and command line support one-off launches, while schedules and sensors create runs from time or external state. Python execution is useful for scripts and tests. All paths lead to the same job-level concerns: configuration, resources, partition or op selection, and the chosen executor. See docs/…/job-execution.md• L17-69 and Schedules, sensors, and automation.

References: docs/…/job-execution.md• L17-69 schedules-sensors-and-automation.md

In-process execution

JobDefinition.execute_in_process provides a direct execution path that captures results in memory. It replaces the job executor with an in-process executor for that call and uses in-memory behavior for the default I/O manager. This makes it useful for local checks and tests, but it does not represent the job's normal distributed execution mode. See python_modules/…/job_definition.py• L733-838.

References: python_modules/…/job_definition.py• L733-838

Asset-centric workflows

Assets and ops describe different centers of gravity for the same compute system. An op describes work. An asset definition describes a stored object and its dependencies. The function behind an asset is still an op, but the asset definition makes lineage known before a run starts. See docs/…/index.md• L9-21 and Software-defined assets.

Graph-backed assets

A graph-backed asset uses several ops to produce one or more named assets. It keeps the intermediate compute steps visible for execution and retry purposes without requiring every intermediate value to become a stored asset. This is a bridge for multi-step logic that needs asset lineage at its boundary. See docs/…/graph-backed-assets.md• L7-15.

References: docs/…/graph-backed-assets.md• L7-15

Asset jobs

An asset job starts from an asset selection rather than from a hand-written op selection. Dagster derives the job's op dependencies from the asset graph, adds the resources required by the selected definitions, and binds the result to a normal job execution model. This lets asset workflows use the same executor, configuration, partition, and launch paths as op jobs while keeping materialization and lineage as the product view. See python_modules/…/asset_job.py• L82-212 and docs/…/asset-jobs.md• L7-26.

References: python_modules/…/asset_job.py• L82-212 docs/…/asset-jobs.md• L7-26

Legacy compute terminology

Older Dagster APIs and stored execution data can use pipeline and solid terms. Current definitions use job and op; compatibility code maps older pipeline and solid selection fields to the current job and op concepts. Treat the older terms as compatibility labels rather than as a separate execution model. See python_modules/…/executor_definition.py• L43-53 and python_modules/…/reconstruct.py• L160-190.

References: python_modules/…/reconstruct.py• L160-190 python_modules/…/executor_definition.py• L43-53

Change checklist

When these files or sections are changed, remember to consider these:

  • An op input or output change can alter graph dependencies, graph-backed asset mappings, and valid op selections.
  • A change to an op's retry policy, code version, or concurrency pool can alter run behavior and the limits applied to its execution.
  • A graph-to-job binding change can alter resource requirements, configuration shape, executor requirements, and whether distributed runs can persist outputs.
  • A config mapping or partition definition change can alter UI launch inputs and the run requests created by schedules or sensors.
  • An asset selection or graph-backed output change can alter asset-job dependencies, lineage, and whether partial materialization is valid.
  • A change to an asset job's automation condition can alter which automated evaluations are valid for the job.
  • A change to compatibility names or selection fields must preserve translation between legacy pipeline or solid data and current job or op data.

Important failure modes

TriggerConsequenceGuard
A graph has a cycle.The graph cannot become a valid executable job.Keep dependencies acyclic and validate the graph definition.
A required graph input has no upstream value, default, or top-level input.Job construction or subset creation fails because the selected work cannot resolve its input.Connect the input or provide a supported top-level value.
A job omits a required resource.Job validation fails before the affected op can run.Bind matching resources at the job or definitions boundary.
Multi-process execution uses an ephemeral instance or non-persistent op outputs.The executor cannot satisfy its process-boundary requirements.Use a loadable instance and persistent output handling for distributed runs.
Op selection removes a required upstream input.The selected graph is rejected as an invalid subset.Select the needed ancestors or provide the input directly.
An asset job selects part of a non-subsettable multi-asset definition.Asset-job construction fails instead of silently materializing an incomplete group.Select all outputs or use a subsettable definition.
Selected assets use incompatible partition definitions.The asset job cannot infer one partition scheme for the selection.Use a compatible selection or provide a valid common partition definition.
An asset job uses an automation condition that does not target its root assets.Job construction fails because the condition cannot be evaluated at the job boundary.Apply a job-root asset condition to an asset job.

Key files

FileWhy to read it
docs/…/index.mdExplains the role of ops as isolated compute units and their inputs, outputs, resources, and configuration.
docs/…/graphs.mdShows graph composition, dependency patterns, nested graphs, and dynamic work.
docs/…/op-jobs.mdDescribes job creation, graph reuse, configuration forms, and launch options.
docs/…/job-execution.mdDescribes launch paths, op selection, executors, and concurrency controls.
docs/…/graph-backed-assets.mdExplains how multi-step op graphs become asset-producing workflows.
python_modules/…/op_definition.pyDefines the op contract for compute, inputs, outputs, configuration, resources, retries, and pools.
python_modules/…/graph_definition.pyDefines the graph contract and the boundary that turns a graph into a job.
python_modules/…/job_definition.pyDefines job configuration, resources, selection, partitions, automation conditions, and direct execution.
python_modules/…/asset_job.pyShows how asset selections become executable job graphs.