> For the complete documentation index, see [llms.txt](https://machinations.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://machinations.gitbook.io/docs/nodes-properties/pulling-and-pushing-resources.md).

# Pulling & Pushing Resources

getting Resources from A to B

A Node can be set to either Push or Pull Resources, function to what action it needs to take once activated.

{% hint style="info" %}
Set this attribute of a Pool in the drop-down menu in `Properties > Action`: <img src="https://2667914601-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGZcALyOGDKb9q0wdJ5%2F-MLqQYoX8e3G5EuWkn3P%2F-MLqRnFSx1G9Xbb6gujD%2Fimage.png?alt=media&amp;token=fef0c04a-3a82-4128-b78a-78c22c1c0cb3" alt="" data-size="original">&#x20;
{% endhint %}

When a Node fires, it will try to *pull* Resources through any inputs connected to it. The number of Resources it pulls is determined by the rate of the individual input [Resource Connection](https://machinations.gitbook.io/docs/connections/resource-connections)—the number beside the line.&#x20;

{% hint style="success" %}
Nodes default to pull mode.
{% endhint %}

Alternatively, a Node can be set in *push* mode. In this mode, when the Node fires, it pushes Resources along its output connections.&#x20;

{% hint style="info" %}
A Node in push mode is marked with a ***`p`***&#x20;

Passive Pools that have only outputs are automatically set to push mode, in which case the ***`p`*** marker is omitted.
{% endhint %}

![](https://2667914601-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGZcALyOGDKb9q0wdJ5%2F-LHIE6Cj3xMwG7VNkU3L%2F-LHIIjSREfLk6zlWg4md%2Fpush%26pull.jpg?alt=media\&token=228379f0-e316-43a5-872f-5bbfcafe7f9a)

**If a Node is trying to pull more Resources** than there are at the far end of its inputs, it will handle it in one of two ways:&#x20;

1. By default, a Node pulls as many Resources as it can, up to the flow rates of its inputs. If not enough Resources are available, it still pulls those that are.
2. Alternatively, a Node can be set to *pull all* Resources. In this mode, when not all Resources are available, *none* are pulled.&#x20;

{% hint style="info" %}
Nodes that are in pull all mode are marked with an & sign.&#x20;
{% endhint %}

These rules also apply to pushing Nodes: by default, a pushing Node sends as many Resources as there are available out along its output Resource Connection up to the output’s flow rate.

{% hint style="info" %}
A pushing Node in *all* mode sends Resources only when it can supply all of its outputs. This means that Nodes in push mode might be *marked with both a p and an &*.
{% endhint %}

![Push and Pull All](https://2667914601-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LGZcALyOGDKb9q0wdJ5%2F-LHILMn_vkSEl7fPzJaj%2F-LHIMCRpkvVCLw6VMfEA%2Fpushall-pullall.jpg?alt=media\&token=7316a647-c375-4f56-88fa-6a7582aa6f32)

#### :wrench: Hourglass Example

In the video below, using Pools and Resource Connections, we constructed a simple hourglass.&#x20;

The top Pool (A) is passive and contains 5 Resources, while the bottom Pool (B) is automatic and starts without any Resources. Every time step (in this case 1 second), B will pull one Resource from A, until all Resources have moved from A to B.

{% embed url="<https://www.youtube.com/watch?v=O62HdjzGOM4>" %}

{% hint style="info" %}
You may want to check out:
{% endhint %}
