# Dependencies and ports

Dependencies define which jobs must complete before another job can run. Ports define which part of an upstream result feeds a downstream input. Use both concepts when a process has multiple branches or specialized record types.

## Set dependencies

A source can have no parents. A processing step normally depends on the source or earlier transformation that supplies its records. A job with several dependencies waits until the required upstream work is complete.

Each job ID must be unique. Dependencies must reference existing jobs, and the graph cannot contain a cycle. For example, `read → transform → save` is valid; `read → transform → read` is not.

Arrange cards for clarity, then inspect **Depends on** in the configuration panel to confirm the actual graph. Repositioning cards alone does not change ordering.

## Use named ports

A handler can expose multiple input or output ports. An explicit input binding identifies the upstream job and, where needed, its output port. Every upstream job named in a binding must also be a dependency. Several bindings to one input are combined in their declared order.

A dependency without an explicit named binding feeds the handler's default input. If you intended a specialized stream, leaving the binding implicit can produce the wrong result even when the graph is acyclic.

## Respect record contracts

Ports can expect different kinds of values, such as structured records, document references, or page images. A connection line does not convert these values automatically. Use the suggested converter or add a suitable processing step when the formats differ.

Some record-type differences are warnings requiring judgment; incompatible port kinds can block a connection or validation. Read the diagnostic for the exact upstream and downstream jobs rather than changing fields at random.

After removing or renaming a job, inspect affected bindings and validate again. Test a multi-input step with distinct sample values from each parent so you can see whether the correct data arrived.

Continue with [branching and parallel execution](/docs/workflows/branching-and-parallelism) and [validation](/docs/workflows/validation).
