> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Orchestration Logic

> How to arrange, nest, or reuse nodes when building a Workflow or Chatflow

## Serial and Parallel Execution

<Frame>
  <img src="https://mintcdn.com/dify-6c0370d8/xGr6gOhRwlVIl2gB/images/use-dify/workflow/serial-vs-parallel-execution.png?fit=max&auto=format&n=xGr6gOhRwlVIl2gB&q=85&s=c8d8b6a82092072fb8dac32973794488" alt="Serial vs. Parallel Execution" width="1896" height="568" data-path="images/use-dify/workflow/serial-vs-parallel-execution.png" />
</Frame>

When building a workflow, you can arrange nodes in series or in parallel:

* **In series**, nodes run one after another. Each node can read variables from any node earlier in the chain.

* **In parallel**, nodes run at the same time. They can't read each other's variables, but where parallel branches converge, the downstream node can read from all of them.

<Info>
  A single execution path supports up to 50 nodes. Self-hosted deployments can change this limit with the `MAX_TREE_DEPTH` environment variable.
</Info>

## Node Reuse

All nodes except User Input can be copied and pasted within the same workflow, across workflows, or across Dify instances, though there might be compatibility issues between Dify versions.

<Note>
  Pasting across workflows or Dify instances requires the Dify page to be served over HTTPS or accessed via a loopback address (such as `http://localhost` or `http://127.0.0.1`).
</Note>

When you paste a node, its configuration moves with it, but the availability of anything that depends on the surrounding environment is re-evaluated at the destination:

* **Workflow-specific resources**, such as variables
* **Workspace-specific resources**, such as tools, plugins, and knowledge bases

## Iteration and Loop

For nodes that should run multiple times (once per item in a list or until a condition is met), place them inside an [Iteration](/en/use-dify/nodes/iteration) or [Loop](/en/use-dify/nodes/loop) node.
